X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/53357e241eefd2d757d38c1a5b83c28161c2ee56..200c18cc6c5c11353f42c0550651c18a8a4cd5b0:/src/gtk/settings.cpp diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 2db3089d23..7de06c56e3 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -19,6 +19,7 @@ #endif #include "wx/fontutil.h" +#include "wx/fontenum.h" #include #include "wx/gtk/private/win_gtk.h" @@ -185,6 +186,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: @@ -223,11 +228,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; } @@ -251,6 +257,13 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) wxNativeFontInfo info; info.description = ButtonStyle()->font_desc; gs_fontSystem = wxFont(info); + + // (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"); + info.description = NULL; } font = gs_fontSystem; @@ -259,6 +272,9 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) default: break; } + + wxASSERT(font.IsOk() && wxFontEnumerator::IsValidFacename(font.GetFaceName())); + return font; }