]> git.saurik.com Git - wxWidgets.git/commitdiff
make colours used by list and tree controls more consistent with the system theme...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Dec 2008 13:03:24 +0000 (13:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 25 Dec 2008 13:03:24 +0000 (13:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/settings.h
interface/wx/settings.h
src/generic/listctrl.cpp
src/generic/treectlg.cpp
src/gtk/settings.cpp
src/gtk1/settings.cpp
src/msw/settings.cpp
src/osx/carbon/settings.cpp

index 76500b4eb884413d1485cafc8fe2e960c16fee41..3fe46534e093fc914bb0da456ff25ab9fd11dd7d 100644 (file)
@@ -79,6 +79,7 @@ enum wxSystemColour
     wxSYS_COLOUR_GRADIENTINACTIVECAPTION,
     wxSYS_COLOUR_MENUHILIGHT,
     wxSYS_COLOUR_MENUBAR,
+    wxSYS_COLOUR_LISTBOXTEXT,
 
     wxSYS_COLOUR_MAX
 };
index aab3f0cfdb2a07d71ce1b916b5843ac2712b6e09..9acd7d301e552c5a4db030de78233f2267d2bca1 100644 (file)
@@ -67,12 +67,18 @@ enum wxSystemColour
     wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
     wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
 
-    wxSYS_COLOUR_LISTBOX,
+    wxSYS_COLOUR_LISTBOX,             ///< Background colour for list-like contols.
     wxSYS_COLOUR_HOTLIGHT,
     wxSYS_COLOUR_GRADIENTACTIVECAPTION,
     wxSYS_COLOUR_GRADIENTINACTIVECAPTION,
     wxSYS_COLOUR_MENUHILIGHT,
     wxSYS_COLOUR_MENUBAR,
+    /**
+        Text colour for list-like controls.
+
+        @since 2.9.0
+     */
+    wxSYS_COLOUR_LISTBOXTEXT,
 
     wxSYS_COLOUR_MAX
 };
index 66710677d16688e8ee0d06c34bcb9cc5e5981a45..bf9e05c4170e386692b983d57156e428829424d4 100644 (file)
@@ -5763,7 +5763,7 @@ wxGenericListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
 #else
     wxUnusedVar(variant);
     wxVisualAttributes attr;
-    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT);
     attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
     attr.font  = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     return attr;
index 52868f92265551d5f81a472282f5e1f6bb7bf4fc..5baa32ad7f29552fc90126b3cd0c73c5d91b8d2c 100644 (file)
@@ -3934,7 +3934,7 @@ wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return wxListBox::GetClassDefaultAttributes(variant);
 #else
     wxVisualAttributes attr;
-    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT);
     attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
     attr.font  = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     return attr;
index 2db3089d23336b3cd77fb91fa15dc5929f2926dc..6e5e0f363f21e95c4cd16766f1cbd5515296222a 100644 (file)
@@ -185,6 +185,10 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
             color = wxColor(ListStyle()->base[GTK_STATE_NORMAL]);
             break;
 
+        case wxSYS_COLOUR_LISTBOXTEXT:
+            color = wxColor(ListStyle()->text[GTK_STATE_NORMAL]);
+            break;
+
         case wxSYS_COLOUR_MENUTEXT:
         case wxSYS_COLOUR_WINDOWTEXT:
         case wxSYS_COLOUR_CAPTIONTEXT:
index 18cef0de2c186098cb57248a4e9ea07c1dc920b7..34887192ba61343d29c921fa251ac8d89ebbe334 100644 (file)
@@ -250,6 +250,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
         case wxSYS_COLOUR_CAPTIONTEXT:
         case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
         case wxSYS_COLOUR_BTNTEXT:
+        case wxSYS_COLOUR_LISTBOXTEXT:
             if (!gs_objects.m_colBtnText.Ok())
             {
                 int red, green, blue;
index 476873b4af9ef8cf45a4ece9d83a85041c7198a3..591b4f7c634c21bd3666eb78c9126886f97ebdfd 100644 (file)
@@ -127,7 +127,12 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         0,          // MENUBAR (unused)
     };
 
-    if ( index == wxSYS_COLOUR_LISTBOX )
+    if ( index == wxSYS_COLOUR_LISTBOXTEXT)
+    {
+        // there is no standard colour with this index, map to another one
+        index = wxSYS_COLOUR_WINDOWTEXT;
+    }
+    else if ( index == wxSYS_COLOUR_LISTBOX )
     {
         // there is no standard colour with this index, map to another one
         index = wxSYS_COLOUR_WINDOW;
index be6c68ca1b0a369a5fd781c141f61a6c36b1cd47..ad5c4f79873536a64a66a4955691a49b4afdd9d1 100644 (file)
@@ -75,6 +75,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_CAPTIONTEXT:
         case wxSYS_COLOUR_INFOTEXT:
         case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
+        case wxSYS_COLOUR_LISTBOXTEXT:
             resultColor = *wxBLACK;
             break ;