diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2009-12-10 00:21:17 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2009-12-10 00:21:59 +0200 |
commit | e678dec4cacc93dd8ba0e244432e555ff4595f8c (patch) | |
tree | 1bd46d3350db09f0f65eebadc8fe6047106ebf49 | |
parent | 49704988c885e1b14f001474cce986815134dee1 (diff) | |
download | fpGUI-e678dec4cacc93dd8ba0e244432e555ff4595f8c.tar.xz |
Tweak of color usage and the look of popup menus
* Color now more closely matches WinXP colors
* Improved the border look of popup menus and any 3d bevels
* Replaced standard text drawing with fpgStyle text drawing
* Menu dividers are now 3D and not flat black line
-rw-r--r-- | src/corelib/fpg_main.pas | 18 | ||||
-rw-r--r-- | src/corelib/predefinedcolors.inc | 2 | ||||
-rw-r--r-- | src/gui/fpg_menu.pas | 25 |
3 files changed, 26 insertions, 19 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index e8c26eae..65f75618 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -1623,25 +1623,25 @@ begin {$Note Refactor this so under Windows it can detect the system colors instead. Also under Linux (KDE and Gnome) we should be able to detect the system colors.} - fpgSetNamedColor(clWindowBackground, $D4D0C8); + fpgSetNamedColor(clWindowBackground, $D5D2CD); fpgSetNamedColor(clBoxColor, $FFFFFF); - fpgSetNamedColor(clShadow1, $808080); - fpgSetNamedColor(clShadow2, $404040); - fpgSetNamedColor(clHilite1, $E0E0E0); - fpgSetNamedColor(clHilite2, $FFFFFF); + fpgSetNamedColor(clShadow1, $848284); // medium + fpgSetNamedColor(clShadow2, $424142); // dark + fpgSetNamedColor(clHilite1, $E0E0E0); // light + fpgSetNamedColor(clHilite2, $FFFFFF); // white fpgSetNamedColor(clText1, $000000); fpgSetNamedColor(clText2, $000040); fpgSetNamedColor(clText3, $800000); fpgSetNamedColor(clText4, $404000); - fpgSetNamedColor(clSelection, $0A246A); + fpgSetNamedColor(clSelection, $08246A); fpgSetNamedColor(clSelectionText, $FFFFFF); fpgSetNamedColor(clInactiveSel, $D0D0FF); fpgSetNamedColor(clInactiveSelText, $000000); fpgSetNamedColor(clScrollBar, $E8E4DB); - fpgSetNamedColor(clButtonFace, $D4D0C8); + fpgSetNamedColor(clButtonFace, $D5D2CD); fpgSetNamedColor(clListBox, $FFFFFF); fpgSetNamedColor(clGridLines, $A0A0A0); - fpgSetNamedColor(clGridHeader, $D4D0C8); + fpgSetNamedColor(clGridHeader, $D5D2CD); fpgSetNamedColor(clWidgetFrame, $000000); fpgSetNamedColor(clInactiveWgFrame, $A0A0A0); fpgSetNamedColor(clTextCursor, $000000); @@ -1839,7 +1839,7 @@ begin Exit; //==> if not AEnabled then begin - ACanvas.SetTextColor(clHilite1); + ACanvas.SetTextColor(clHilite2); ACanvas.DrawString(x+1, y+1, AText); ACanvas.SetTextColor(clShadow1); end; diff --git a/src/corelib/predefinedcolors.inc b/src/corelib/predefinedcolors.inc index 897a528d..3de9daf4 100644 --- a/src/corelib/predefinedcolors.inc +++ b/src/corelib/predefinedcolors.inc @@ -1,4 +1,4 @@ -{%mainunit gfxbase.pas} +{%mainunit fpg_base.pas} // The following colors match the predefined Delphi Colors // NOTE: diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas index fb77f55b..cfab93bf 100644 --- a/src/gui/fpg_menu.pas +++ b/src/gui/fpg_menu.pas @@ -293,7 +293,6 @@ var p: integer; achar: string; begin -// writeln('DrawText x:', x, ' y:', y); if not Enabled then ACanvas.SetFont(fpgStyle.MenuDisabledFont) else @@ -307,12 +306,15 @@ begin if p > 0 then begin // first part of text before the & sign - ACanvas.DrawString(x, y, UTF8Copy(s, 1, p-1)); +// ACanvas.DrawString(x, y, UTF8Copy(s, 1, p-1)); + fpgStyle.DrawString(ACanvas, x, y, UTF8Copy(s, 1, p-1), Enabled); + inc(x, fpgStyle.MenuFont.TextWidth(UTF8Copy(s, 1, p-1))); if UTF8Copy(s, p+1, 1) = achar then begin // Do we need to paint a actual & sign (create via && in item text) - ACanvas.DrawString(x, y, achar); +// ACanvas.DrawString(x, y, achar); + fpgStyle.DrawString(ACanvas, x, y, achar, Enabled); inc(x, fpgStyle.MenuFont.TextWidth(achar)); end else @@ -320,7 +322,8 @@ begin // Draw the HotKey text if Enabled then ACanvas.SetFont(fpgStyle.MenuAccelFont); - ACanvas.DrawString(x, y, UTF8Copy(s, p+1, 1)); +// ACanvas.DrawString(x, y, UTF8Copy(s, p+1, 1)); + fpgStyle.DrawString(ACanvas, x, y, UTF8Copy(s, p+1, 1), Enabled); inc(x, ACanvas.Font.TextWidth(UTF8Copy(s, p+1, 1))); if Enabled then ACanvas.SetFont(fpgStyle.MenuFont); @@ -331,7 +334,8 @@ begin // Draw the remaining text after the & sign if UTF8Length(s) > 0 then - ACanvas.DrawString(x, y, s); +// ACanvas.DrawString(x, y, s); + fpgStyle.DrawString(ACanvas, x, y, s, Enabled); end; function TfpgMenuItem.GetCommand: ICommand; @@ -974,7 +978,7 @@ begin Canvas.BeginDraw; // inherited HandlePaint; Canvas.Clear(BackgroundColor); - Canvas.SetColor(clWidgetFrame); + Canvas.SetColor(clWindowBackground); Canvas.DrawRectangle(0, 0, Width, Height); // black rectangle border Canvas.DrawButtonFace(1, 1, Width-1, Height-1, []); // 3d rectangle inside black border @@ -1019,8 +1023,10 @@ var begin if mi.Separator then begin - Canvas.SetColor(clMenuText); - Canvas.DrawLine(rect.Left, rect.Top+2, rect.Right+1, rect.Top+2); + Canvas.SetColor(clShadow1); + Canvas.DrawLine(rect.Left+1, rect.Top+2, rect.Right, rect.Top+2); + Canvas.SetColor(clHilite2); + Canvas.DrawLine(rect.Left+1, rect.Top+3, rect.Right, rect.Top+3); end else begin @@ -1031,7 +1037,8 @@ begin if mi.HotKeyDef <> '' then begin s := mi.HotKeyDef; - Canvas.DrawString(rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s); + fpgStyle.DrawString(Canvas, rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s, mi.Enabled); +// Canvas.DrawString(rect.Right-FMenuFont.TextWidth(s)-FTextMargin, rect.Top, s); end; if mi.SubMenu <> nil then |