summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-21 11:11:57 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-21 11:11:57 +0200
commit85f360e93353b2687c49891d5fecf3700bcd7748 (patch)
tree5cc8cc93bad6f6807060c5379094f4282f4fa81d /src
parent8c653c16e4d86cbd7fab92d4688226db1646ed78 (diff)
downloadfpGUI-85f360e93353b2687c49891d5fecf3700bcd7748.tar.xz
DrawButtonFace(): Improved the look of Flat=True buttons
Flat=True (toolbar) style buttons now have a thinner border when the mouse hovers over them. They also have an improved look in Down=True state.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/fpg_main.pas26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas
index a83c5590..5505359a 100644
--- a/src/corelib/fpg_main.pas
+++ b/src/corelib/fpg_main.pas
@@ -1759,7 +1759,12 @@ begin
if (btfIsEmbedded in AFlags) then
ACanvas.SetColor(clHilite2)
else
- ACanvas.SetColor(clShadow2);
+ begin
+ if (btfFlat in AFlags) or (btfHover in AFlags) then
+ ACanvas.SetColor(clShadow1) { light shadow }
+ else
+ ACanvas.SetColor(clShadow2); { dark shadow }
+ end;
end
else
ACanvas.SetColor(clHilite2);
@@ -1781,14 +1786,27 @@ begin
if (btfIsEmbedded in AFlags) then
ACanvas.SetColor(clHilite1)
else
- ACanvas.SetColor(clShadow2);
+ begin
+ if (btfFlat in AFlags) or (btfHover in AFlags) then
+ ACanvas.SetColor(clHilite2) { light shadow }
+ else
+ ACanvas.SetColor(clShadow2); { dark shadow }
+ end;
end
else
- ACanvas.SetColor(clShadow2);
-
+ begin
+ if btfHover in AFlags then
+ ACanvas.SetColor(clShadow1) { light shadow }
+ else
+ ACanvas.SetColor(clShadow2); { dark shadow }
+ end;
+
ACanvas.DrawLine(r.Right, r.Top, r.Right, r.Bottom); // right
ACanvas.DrawLine(r.Right, r.Bottom, r.Left-1, r.Bottom); // bottom
+ if (btfFlat in AFlags) or (btfHover in AFlags) then
+ exit; { "toolbar" style buttons need a nice thing/flat border }
+
// Right and Bottom (inner)
if btfIsPressed in AFlags then
begin