X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/330b31898350691dfed883dd9d01be4399ade4cc..74a8f67d96591cec101def2a7d47c64072aff7fd:/src/gtk/settings.cpp diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 35f0649a37..0712e10fe7 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -14,7 +14,6 @@ #include "wx/settings.h" #ifndef WX_PRECOMP - #include "wx/cmndata.h" #include "wx/toplevel.h" #endif @@ -23,6 +22,7 @@ #include #include "wx/gtk/private/win_gtk.h" +#include "wx/gtk/private/gtk2-compat.h" bool wxGetFrameExtents(GdkWindow* window, int* left, int* right, int* top, int* bottom); @@ -61,7 +61,7 @@ static const GtkStyle* ButtonStyle() gtk_widget_ensure_style(s_widget); g_signal_connect(s_widget, "style_set", G_CALLBACK(style_set), NULL); } - return s_widget->style; + return gtk_widget_get_style(s_widget); } static const GtkStyle* ListStyle() @@ -74,7 +74,7 @@ static const GtkStyle* ListStyle() gtk_container_add(ContainerWidget(), s_widget); gtk_widget_ensure_style(s_widget); } - return s_widget->style; + return gtk_widget_get_style(s_widget); } static const GtkStyle* TextCtrlStyle() @@ -86,7 +86,7 @@ static const GtkStyle* TextCtrlStyle() gtk_container_add(ContainerWidget(), s_widget); gtk_widget_ensure_style(s_widget); } - return s_widget->style; + return gtk_widget_get_style(s_widget); } static const GtkStyle* MenuItemStyle() @@ -98,7 +98,7 @@ static const GtkStyle* MenuItemStyle() gtk_container_add(ContainerWidget(), s_widget); gtk_widget_ensure_style(s_widget); } - return s_widget->style; + return gtk_widget_get_style(s_widget); } static const GtkStyle* MenuBarStyle() @@ -110,7 +110,7 @@ static const GtkStyle* MenuBarStyle() gtk_container_add(ContainerWidget(), s_widget); gtk_widget_ensure_style(s_widget); } - return s_widget->style; + return gtk_widget_get_style(s_widget); } static const GtkStyle* ToolTipStyle() @@ -125,7 +125,7 @@ static const GtkStyle* ToolTipStyle() gtk_widget_set_name(s_widget, name); gtk_widget_ensure_style(s_widget); } - return s_widget->style; + return gtk_widget_get_style(s_widget); } wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) @@ -190,6 +190,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: @@ -252,7 +258,7 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) case wxSYS_SYSTEM_FONT: case wxSYS_DEVICE_DEFAULT_FONT: case wxSYS_DEFAULT_GUI_FONT: - if (!gs_fontSystem.Ok()) + if (!gs_fontSystem.IsOk()) { wxNativeFontInfo info; info.description = ButtonStyle()->font_desc; @@ -311,8 +317,8 @@ static int GetBorderWidth(wxSystemMetric index, wxWindow* win) int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win ) { GdkWindow *window = NULL; - if(win && GTK_WIDGET_REALIZED(win->GetHandle())) - window = win->GetHandle()->window; + if (win) + window = gtk_widget_get_window(win->GetHandle()); switch (index) {