summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-07-24 23:34:58 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-07-24 23:34:58 +0200
commitb1d219b78781df6b9dea53cde9b152e6d0a4341c (patch)
tree9af15711004a6b0fab6490e922355e2142503a18
parent46c52a217b9b4031ae3e02ef037547ff7afba3e9 (diff)
downloadfpGUI-b1d219b78781df6b9dea53cde9b152e6d0a4341c.tar.xz
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.
-rw-r--r--docview/components/richtext/RichTextStyleUnit.pas8
1 files 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;