]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/settings.cpp
calling explicit base class constructor from copy constructor
[wxWidgets.git] / src / gtk / settings.cpp
index 6e5e0f363f21e95c4cd16766f1cbd5515296222a..d4b9201cc653b4033b74b13d297e6dae5596e685 100644 (file)
 #include "wx/settings.h"
 
 #ifndef WX_PRECOMP
-    #include "wx/cmndata.h"
     #include "wx/toplevel.h"
 #endif
 
 #include "wx/fontutil.h"
+#include "wx/fontenum.h"
 
 #include <gtk/gtk.h>
 #include "wx/gtk/private/win_gtk.h"
@@ -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:
@@ -227,11 +233,12 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
 
         case wxSYS_COLOUR_MAX:
         default:
-            wxFAIL_MSG( _T("unknown system colour index") );
+            wxFAIL_MSG( wxT("unknown system colour index") );
             color = *wxWHITE;
             break;
     }
 
+    wxASSERT(color.IsOk());
     return color;
 }
 
@@ -255,6 +262,15 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
                 wxNativeFontInfo info;
                 info.description = ButtonStyle()->font_desc;
                 gs_fontSystem = wxFont(info);
+
+#if wxUSE_FONTENUM
+                // (try to) heal the default font (on some common systems e.g. Ubuntu
+                // it's "Sans Serif" but the real font is called "Sans"):
+                if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) &&
+                    gs_fontSystem.GetFaceName() == "Sans Serif")
+                    gs_fontSystem.SetFaceName("Sans");
+#endif // wxUSE_FONTENUM
+
                 info.description = NULL;
             }
             font = gs_fontSystem;
@@ -263,6 +279,9 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
         default:
             break;
     }
+
+    wxASSERT( font.IsOk() );
+
     return font;
 }