wxSYS_COLOUR_WINDOW is no longer hard-wired in wxGTK
Added function to reset stored system colours git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
52170c5b44
commit
a51d7c4bda
@ -42,6 +42,8 @@ struct wxSystemObjects
|
||||
m_colHighlight,
|
||||
m_colHighlightText,
|
||||
m_colListBox,
|
||||
m_colWindow,
|
||||
m_colWindowText,
|
||||
m_colBtnText,
|
||||
m_colMenuItemHighlight,
|
||||
m_colTooltip,
|
||||
@ -52,6 +54,22 @@ struct wxSystemObjects
|
||||
|
||||
static wxSystemObjects gs_objects;
|
||||
|
||||
void wxClearGtkSystemObjects()
|
||||
{
|
||||
gs_objects.m_colBtnFace = wxColour();
|
||||
gs_objects.m_colBtnShadow = wxColour();
|
||||
gs_objects.m_colBtnHighlight = wxColour();
|
||||
gs_objects.m_colHighlightText = wxColour();
|
||||
gs_objects.m_colListBox = wxColour();
|
||||
gs_objects.m_colWindow = wxColour();
|
||||
gs_objects.m_colWindowText = wxColour();
|
||||
gs_objects.m_colBtnText = wxColour();
|
||||
gs_objects.m_colMenuItemHighlight = wxColour();
|
||||
gs_objects.m_colTooltip = wxColour();
|
||||
gs_objects.m_colTooltipText = wxColour();
|
||||
gs_objects.m_fontSystem = wxNullFont;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSystemSettings implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -61,7 +79,8 @@ enum wxGtkWidgetType
|
||||
{
|
||||
wxGTK_BUTTON,
|
||||
wxGTK_LIST,
|
||||
wxGTK_MENUITEM
|
||||
wxGTK_MENUITEM,
|
||||
wxGTK_TEXTCTRL
|
||||
};
|
||||
|
||||
// the colour we need
|
||||
@ -90,6 +109,10 @@ static bool GetColourFromGTKWidget(GdkColor& gdkColor,
|
||||
widget = gtk_button_new();
|
||||
break;
|
||||
|
||||
case wxGTK_TEXTCTRL:
|
||||
widget = gtk_text_view_new();
|
||||
break;
|
||||
|
||||
case wxGTK_LIST:
|
||||
widget = gtk_tree_view_new_with_model(
|
||||
(GtkTreeModel*)gtk_list_store_new(1, G_TYPE_INT));
|
||||
@ -176,7 +199,15 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
|
||||
break;
|
||||
|
||||
case wxSYS_COLOUR_WINDOW:
|
||||
color = *wxWHITE;
|
||||
if (!gs_objects.m_colWindow.Ok())
|
||||
{
|
||||
gdkColor.red =
|
||||
gdkColor.green =
|
||||
gdkColor.blue = 0xFFFF;
|
||||
GetColourFromGTKWidget(gdkColor, wxGTK_TEXTCTRL, GTK_STATE_NORMAL, wxGTK_BASE);
|
||||
gs_objects.m_colWindow = wxColor(gdkColor);
|
||||
}
|
||||
color = gs_objects.m_colWindow;
|
||||
break;
|
||||
|
||||
case wxSYS_COLOUR_3DDKSHADOW:
|
||||
|
Loading…
Reference in New Issue
Block a user