From b1d219b78781df6b9dea53cde9b152e6d0a4341c Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Sun, 24 Jul 2011 23:34:58 +0200 Subject: docview: adjusted Margin Size Style to Avg Char Width. This gives an overall improved margin size. In future we should make this user selectable in Docview's Preferences dialog. --- docview/components/richtext/RichTextStyleUnit.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas index b64e2a74..70813b32 100644 --- a/docview/components/richtext/RichTextStyleUnit.pas +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -81,7 +81,7 @@ type property DefaultAlignment: TTextAlignment read FDefaultAlignment write SetDefaultAlignment; property DefaultWrap: boolean read FDefaultWrap write SetDefaultWrap default True; property AtLeastOneWordBeforeWrap: boolean read FAtLeastOneWordBeforeWrap write SetAtLeastOneWordBeforeWrap; - property MarginSizeStyle: TMarginSizeStyle read FMarginSizeStyle write SeTMarginSizeStyle; + property MarginSizeStyle: TMarginSizeStyle read FMarginSizeStyle write SetMarginSizeStyle; property MarginChar: longint read FMarginChar write SetMarginChar; // margins are exposed as individual properties here // since the Sibyl IDE cannot cope with editing a record property @@ -290,12 +290,11 @@ ProfileEvent('DEBUG: ApplyStyleTag >>>'); MarginParam2 := tmpFontParts[1] else MarginParam2 := ''; + if MarginParam2 = 'pixels' then NewMargin := MarginSize - else if MarginParam2 = 'deffont' then NewMargin := MarginSize * ASettings.NormalFont.TextWidth('w') // .Width - else begin case ASettings.MarginSizeStyle of @@ -359,7 +358,8 @@ begin FDefaultWrap := true; FAtLeastOneWordBeforeWrap := false; - FMarginSizeStyle := msMaximumCharWidth; + { TODO: Add this property to DocView's Preferences dialog } + FMarginSizeStyle := msAverageCharWidth; FMarginChar := Ord( ' ' ); FMargins.Left := 0; -- cgit v1.2.3-70-g09d2