From bc98111a23da2901b5c17883fc65ad81a3ea97f0 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Sun, 8 May 2011 01:00:49 +0200 Subject: Removed magic numbers with GetButtonBorders() usage instead. --- src/gui/fpg_button.pas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gui/fpg_button.pas') diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas index 0ce2df8e..92b29164 100644 --- a/src/gui/fpg_button.pas +++ b/src/gui/fpg_button.pas @@ -520,6 +520,7 @@ procedure TfpgBaseButton.HandlePaint; var tx, ty, ix, iy: integer; r: TfpgRect; + border: TRect; offset: TPoint; lBtnFlags: TfpgButtonFlags; clr: TfpgColor; @@ -530,6 +531,7 @@ begin Canvas.ClearClipRect; r.SetRect(0, 0, Width, Height); + border := fpgStyle.GetButtonBorders; lBtnFlags := []; if FDown then @@ -571,7 +573,7 @@ begin if FFocused and (not FEmbedded) then begin - InflateRect(r, -3, -3); + InflateRect(r, -border.Left, -border.Top); fpgStyle.DrawFocusRect(Canvas, r); end; @@ -606,7 +608,7 @@ begin if AllowMultiLineText and (FImageLayout = ilImageLeft) then begin r.SetRect(0, 0, Width, Height); - InflateRect(r, -3, -3); { same as focus rectangle } + InflateRect(r, -border.Left, -border.Top); { same as focus rectangle } if FShowImage and Assigned(FImage) then begin ix := FImageMargin + FImage.Width; @@ -618,7 +620,7 @@ begin if FDown then OffsetRect(r, offset.x, offset.y); - lTextFlags := [txtHCenter, txtVCenter{, txtWrap}]; + lTextFlags := [txtHCenter, txtVCenter]; if not Enabled then lTextFlags += [txtDisabled]; Canvas.DrawText(r, Text, lTextFlags); { DrawText does use fpgStyle } -- cgit v1.2.3-70-g09d2