]> git.saurik.com Git - wxWidgets.git/commitdiff
get wxSYS_COLOUR_HIGHLIGHTTEXT from GTK+, ticket 4733
authorPaul Cornett <paulcor@bullseye.com>
Tue, 20 May 2008 15:10:11 +0000 (15:10 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 20 May 2008 15:10:11 +0000 (15:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/settings.cpp

index 7b1596ed2d0b507fef0dcf4d65d21c494f348687..cfd73c9bf95ce8139e8e7fba52a3ea260c13bf4a 100644 (file)
@@ -90,6 +90,7 @@ enum wxGtkColourType
 {
     wxGTK_FG,
     wxGTK_BG,
+    wxGTK_TEXT,
     wxGTK_BASE
 };
 
@@ -150,6 +151,10 @@ static bool GetColourFromGTKWidget(GdkColor& gdkColor,
                 gdkColor = def->bg[state];
                 break;
 
+            case wxGTK_TEXT:
+                gdkColor = def->text[state];
+                break;
+
             case wxGTK_BASE:
                 gdkColor = def->base[state];
                 break;
@@ -317,11 +322,12 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
         case wxSYS_COLOUR_HIGHLIGHTTEXT:
             if (!gs_objects.m_colHighlightText.Ok())
             {
-                wxColour hclr = GetColour(wxSYS_COLOUR_HIGHLIGHT);
-                if (hclr.Red() > 200 && hclr.Green() > 200 && hclr.Blue() > 200)
-                    gs_objects.m_colHighlightText = *wxBLACK;
-                else
-                    gs_objects.m_colHighlightText = *wxWHITE;
+                gdkColor.red =
+                gdkColor.green =
+                gdkColor.blue = 0;
+                GetColourFromGTKWidget(
+                    gdkColor, wxGTK_BUTTON, GTK_STATE_SELECTED, wxGTK_TEXT);
+                gs_objects.m_colHighlightText = wxColour(gdkColor);
             }
             color = gs_objects.m_colHighlightText;
             break;