X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c79853685d09ba1d7eaef604395c40b731ed2f34..a02dc3e3ff6a99000b29eeac3be32bcf6dd776da:/src/gtk/settings.cpp diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index db8fbc1bb6..ca5965f55d 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -128,23 +128,29 @@ wxColour wxSystemSettings::GetSystemColour( int index ) { if (!g_systemHighlightColour) { -/* - g_systemHighlightColour = - new wxColour( 0 >> SHIFT, - 0 >> SHIFT, - 0x9c40 >> SHIFT ); -*/ GtkWidget *widget = gtk_button_new(); GtkStyle *def = gtk_rc_get_style( widget ); - int red = def->bg[GTK_STATE_SELECTED].red; - int green = def->bg[GTK_STATE_SELECTED].green; - int blue = def->bg[GTK_STATE_SELECTED].blue; + if (!def) + def = gtk_widget_get_default_style(); + if (def) + { + int red = def->bg[GTK_STATE_SELECTED].red; + int green = def->bg[GTK_STATE_SELECTED].green; + int blue = def->bg[GTK_STATE_SELECTED].blue; + g_systemHighlightColour = + new wxColour( red >> SHIFT, + green >> SHIFT, + blue >> SHIFT ); + } + else + { + g_systemHighlightColour = + new wxColour( 0 >> SHIFT, + 0 >> SHIFT, + 0x9c40 >> SHIFT ); + } gtk_widget_destroy( widget ); - g_systemHighlightColour = - new wxColour( red >> SHIFT, - green >> SHIFT, - blue >> SHIFT ); } return *g_systemHighlightColour; }