From 410207c3b3dc8cc19a5443f6ec54887265c7af0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 17 Feb 2000 15:17:31 +0000 Subject: [PATCH] fixed detection of listbox background git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/settings.cpp | 9 ++++----- src/gtk1/settings.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 29e3b821f9..658c74ab4e 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -164,13 +164,13 @@ wxColour wxSystemSettings::GetSystemColour( int index ) { GtkWidget *widget = gtk_list_new(); GtkStyle *def = gtk_rc_get_style( widget ); - if (!def) + if (!def) def = gtk_widget_get_default_style(); if (def) { - int red = def->bg[GTK_STATE_NORMAL].red; - int green = def->bg[GTK_STATE_NORMAL].green; - int blue = def->bg[GTK_STATE_NORMAL].blue; + int red = def->base[GTK_STATE_NORMAL].red; + int green = def->base[GTK_STATE_NORMAL].green; + int blue = def->base[GTK_STATE_NORMAL].blue; g_systemListBoxColour = new wxColour( red >> SHIFT, green >> SHIFT, @@ -179,7 +179,6 @@ wxColour wxSystemSettings::GetSystemColour( int index ) else g_systemListBoxColour = new wxColour(*wxWHITE); gtk_widget_destroy( widget ); - } return *g_systemListBoxColour; } diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp index 29e3b821f9..658c74ab4e 100644 --- a/src/gtk1/settings.cpp +++ b/src/gtk1/settings.cpp @@ -164,13 +164,13 @@ wxColour wxSystemSettings::GetSystemColour( int index ) { GtkWidget *widget = gtk_list_new(); GtkStyle *def = gtk_rc_get_style( widget ); - if (!def) + if (!def) def = gtk_widget_get_default_style(); if (def) { - int red = def->bg[GTK_STATE_NORMAL].red; - int green = def->bg[GTK_STATE_NORMAL].green; - int blue = def->bg[GTK_STATE_NORMAL].blue; + int red = def->base[GTK_STATE_NORMAL].red; + int green = def->base[GTK_STATE_NORMAL].green; + int blue = def->base[GTK_STATE_NORMAL].blue; g_systemListBoxColour = new wxColour( red >> SHIFT, green >> SHIFT, @@ -179,7 +179,6 @@ wxColour wxSystemSettings::GetSystemColour( int index ) else g_systemListBoxColour = new wxColour(*wxWHITE); gtk_widget_destroy( widget ); - } return *g_systemListBoxColour; } -- 2.45.2