]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT to fix tree and list control selection rendering.
authorJulian Smart <julian@anthemion.co.uk>
Fri, 25 Feb 2011 09:38:35 +0000 (09:38 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 25 Feb 2011 09:38:35 +0000 (09:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
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/motif/settings.cpp
src/msw/settings.cpp
src/os2/settings.cpp
src/osx/carbon/settings.cpp
src/palmos/settings.cpp
src/univ/settingsuniv.cpp

index 8de41ae424b0b8009bfb287540bc78bfbe570ef0..d9c2dd40490d35aa7d9675c16a3eb79b1380226f 100644 (file)
@@ -81,6 +81,7 @@ enum wxSystemColour
     wxSYS_COLOUR_MENUHILIGHT,
     wxSYS_COLOUR_MENUBAR,
     wxSYS_COLOUR_LISTBOXTEXT,
+    wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT,
 
     wxSYS_COLOUR_MAX,
 
index ef3d4fd317b7febe6d93f244627610c97b579254..512b1aa9674f1337d9083fbf134ce6fceb38de16 100644 (file)
@@ -109,6 +109,13 @@ enum wxSystemColour
      */
     wxSYS_COLOUR_LISTBOXTEXT,
 
+    /**
+        Text colour for the unfocused selection of list-like controls.
+
+        @since 2.9.1
+     */
+    wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT,
+
     wxSYS_COLOUR_MAX
 
 
index 02b14b51f71a42684e46550bb053eef1481e9a2b..89c08e18c613863d60736853daf01341ff9f2a96 100644 (file)
@@ -687,7 +687,10 @@ void wxListLineData::ApplyAttributes(wxDC *dc,
         else
             colText = *wxBLACK;
 #else
-        colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+        if ( hasFocus )
+            colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+        else
+            colText = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT);
 #endif
     }
     else if ( attr && attr->HasTextColour() )
index c3b739e4d33ce37ca97c8bca51794978f7c69a46..67e0cf5f63401e72960c2d79c1fa0ac432fe7d5e 100644 (file)
@@ -2759,7 +2759,10 @@ wxGenericTreeCtrl::PaintLevel(wxGenericTreeItem *item,
 #ifdef __WXMAC__
             colText = *wxWHITE;
 #else
-            colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+            if (m_hasFocus)
+                colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+            else
+                colText = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT);
 #endif
         }
         else
index 20e413249f2c115ddb4442a21dc0a5b11f75f325..d4b9201cc653b4033b74b13d297e6dae5596e685 100644 (file)
@@ -189,6 +189,12 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
             color = wxColor(ListStyle()->text[GTK_STATE_NORMAL]);
             break;
 
+        case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
+            // This is for the text in a list control (or tree) when the
+            // item is selected, but not focused
+            color = wxColor(ListStyle()->text[GTK_STATE_ACTIVE]);
+            break;
+
         case wxSYS_COLOUR_MENUTEXT:
         case wxSYS_COLOUR_WINDOWTEXT:
         case wxSYS_COLOUR_CAPTIONTEXT:
index e8da9443c1f2641bb1a5d33ab5857c701b072f1f..36ba1f63d61f1960aaf3f882653e09447e261a8b 100644 (file)
@@ -281,6 +281,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
             }
             return gs_objects.m_colTooltipText;
 
+        case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
         case wxSYS_COLOUR_HIGHLIGHTTEXT:
             if (!gs_objects.m_colHighlightText.Ok())
             {
index 9b5b08342256c45be51e646bf9d288f7b0b4be14..cedbbdf2320aa6aef4a0af77d266ef75946a4c7f 100644 (file)
@@ -128,6 +128,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         }
     }
     case wxSYS_COLOUR_HIGHLIGHTTEXT:
+    case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
     {
         return *wxWHITE;
     }
index eec4fea1a9d8908bf778e46538f9e4cc55dc2073..4fbc2299f64f2582b02f437e05bee9374dddaef3 100644 (file)
@@ -133,6 +133,11 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         // there is no standard colour with this index, map to another one
         index = wxSYS_COLOUR_WINDOWTEXT;
     }
+    else if ( index == wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT)
+    {
+        // there is no standard colour with this index, map to another one
+        index = wxSYS_COLOUR_HIGHLIGHTTEXT;
+    }
     else if ( index == wxSYS_COLOUR_LISTBOX )
     {
         // there is no standard colour with this index, map to another one
index c3f6e7bc0fa53deea2be546592b476e523c90065..484be7380c92ca6da48ffa3aea589eacd0d557bf 100644 (file)
@@ -172,6 +172,7 @@ wxColour wxSystemSettingsNative::GetColour(
             break;
 
         case wxSYS_COLOUR_HIGHLIGHTTEXT:
+        case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
             vSysClr = SYSCLR_HILITEFOREGROUND;
             break;
 
index bc6b13ad73785b2891be80f89aec4f910e808f9e..1bac3eaa5beefa2068db0393f39b524d8a911d0e 100644 (file)
@@ -110,6 +110,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
             break ;
 
         case wxSYS_COLOUR_HIGHLIGHTTEXT :
+        case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT :
 #if wxOSX_USE_COCOA_OR_CARBON
             {
                 wxColour highlightcolor( wxMacCreateCGColorFromHITheme(-3 /* kThemeBrushPrimaryHighlightColor */) );
index e9d5be3f199f58e4e7844618c556ff5196a5b45d..ecb01c9bd5a3cbf8895275ec3a9d8c8e9656faa5 100644 (file)
@@ -76,6 +76,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_INACTIVEBORDER:
         case wxSYS_COLOUR_APPWORKSPACE:
         case wxSYS_COLOUR_HIGHLIGHT:
+        case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
         case wxSYS_COLOUR_HIGHLIGHTTEXT:
         case wxSYS_COLOUR_BTNFACE:
         case wxSYS_COLOUR_BTNSHADOW:
index a382d39219ce19e8c5d0eef917742be816a1162c..8d7ea622ca93fb18a0b47a5712971c37c0fb0577 100644 (file)
@@ -78,6 +78,7 @@ wxColour wxSystemSettings::GetColour(wxSystemColour index)
         wxColourScheme::MAX /* wxSYS_COLOUR_MENUHILIGHT */,
         wxColourScheme::MAX /* wxSYS_COLOUR_MENUBAR */,
         wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_LISTBOXTEXT */,
+        wxColourScheme::HIGHLIGHT_TEXT /* wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT */
     };
 
     wxCOMPILE_TIME_ASSERT( WXSIZEOF(s_mapSysToThemeCol) == wxSYS_COLOUR_MAX,