From b8b108a2e3db8a24288bb62bdd5c2cfb493ba4c8 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 2 Apr 2013 11:56:03 +0100 Subject: Buttons & Styles now support hover effect on standard buttons too. Before we only had the mouse hover effect on Flat buttons. But now the Style can enable hover support for normal buttons too. Important for Win7 and MacOSX like themes. --- src/gui/fpg_button.pas | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas index 28db95d6..3bc026de 100644 --- a/src/gui/fpg_button.pas +++ b/src/gui/fpg_button.pas @@ -550,6 +550,12 @@ begin Include(lBtnFlags, btfHover) else if FFlat then Include(lBtnFlags, btfFlat); + + if (not FFlat) and (not FDown) and fpgStyle.HasButtonHoverEffect then + begin + if FState = 1 then + Include(lBtnFlags, btfHover); + end; end else begin @@ -558,7 +564,7 @@ begin Include(lBtnFlags, btfHover); end; - if not FFlat and FDefault then + if (not FFlat) and FDefault then Include(lBtnFlags, btfIsDefault); if FBackgroundColor <> clButtonFace then @@ -747,7 +753,7 @@ begin FDown := False; Repaint; end - else if FFlat then + else if FFlat or fpgStyle.HasButtonHoverEffect then begin if Enabled then Repaint; @@ -766,7 +772,7 @@ begin FDown := True; Repaint; end - else if FFlat then + else if FFlat or fpgStyle.HasButtonHoverEffect then begin if Enabled then Repaint; -- cgit v1.2.3-70-g09d2