From bb8c4f991b4e7e1ca49978c253f8ac729faeb262 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 11 Aug 2011 16:52:38 +0200 Subject: RichView: Correctly calculate the HScrollBar Max value. Now that we correctly the FLayout.Width value this change could now be made. --- docview/components/richtext/RichTextView.pas | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'docview') diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas index 46873de1..0cce5705 100644 --- a/docview/components/richtext/RichTextView.pas +++ b/docview/components/richtext/RichTextView.pas @@ -1233,7 +1233,7 @@ begin // Calculate used and available width AvailableWidth := GetTextAreaWidth; - MaxDisplayWidth := FLayout.Width + 200; { TODO : We need to fix FLayout.Width first before we remove + 200 } + MaxDisplayWidth := FLayout.Width; // Horizontal scroll setup if MaxDisplayWidth > AvailableWidth then @@ -1242,8 +1242,7 @@ begin // FHScrollbar.SliderSize := AvailableWidth div 2; FHScrollbar.Min := 0; if FNeedHScroll then - { TODO : As soon as we fix FLayout.Width, then we can enable the extra code below } - FHScrollbar.Max := (MaxDisplayWidth) // - AvailableWidth) + FScrollbarWidth + FHScrollbar.Max := (MaxDisplayWidth - AvailableWidth) + FScrollbarWidth else begin FHScrollBar.Position := 0; -- cgit v1.2.3-70-g09d2