Backported wxGTK wxSYS_COLOUR_WINDOW fix to 2.8.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-11-05 22:48:57 +00:00
parent 4a2f97be30
commit 15b33070e4
2 changed files with 43 additions and 10 deletions

View File

@@ -92,25 +92,29 @@ Major new features in 2.8 release
----- -----
All (GUI): All (GUI):
- wxGraphicsContext implementations now all have the pixel's center at 0.5,0.5,
avoiding differences in anti-aliasing between platforms - wxGraphicsContext implementations now all have the pixel's center at (0.5,0.5),
avoiding differences in anti-aliasing between platforms.
wxMSW: wxMSW:
- Correct (harmless) warnings given for forward-declared DLL-exported classes - Correct (harmless) warnings given for forward-declared DLL-exported classes
by mingw32 4.2 (Tim Stahlhut) by mingw32 4.2 (Tim Stahlhut).
wxGTK: wxGTK:
- Added gtk.window.force-background-colour wxSystemOptions option to work around - Added gtk.window.force-background-colour wxSystemOptions option to work around
a background colour bug in the gtk-qt theme under KDE. a background colour bug in the gtk-qt theme under KDE.
- wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) now returns the background
colour of text controls.
wxMac: wxMac:
- multiline textcontrols now support attributes for margins and alignement, only
a single tab distance can be set though - Multiline textcontrols now support attributes for margins and alignement; only
- deactivated refcounting checks when running under leopard for the toolbar implementation a single tab distance can be set though.
as the implementation there seems to be different - Deactivated refcounting checks when running under leopard for the toolbar implementation
- fixed 'Reopen' application behaviour (not always was a window shown when reopening the app) as the implementation there seems to be different.
- Fixed 'Reopen' application behaviour (a window was not always shown when reopening the app).
2.8.6 2.8.6

View File

@@ -42,6 +42,7 @@ struct wxSystemObjects
m_colHighlight, m_colHighlight,
m_colHighlightText, m_colHighlightText,
m_colListBox, m_colListBox,
m_colWindow,
m_colBtnText, m_colBtnText,
m_colMenuItemHighlight, m_colMenuItemHighlight,
m_colTooltip, m_colTooltip,
@@ -52,6 +53,21 @@ struct wxSystemObjects
static wxSystemObjects gs_objects; 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_colBtnText = wxColour();
gs_objects.m_colMenuItemHighlight = wxColour();
gs_objects.m_colTooltip = wxColour();
gs_objects.m_colTooltipText = wxColour();
gs_objects.m_fontSystem = wxNullFont;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxSystemSettings implementation // wxSystemSettings implementation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -61,7 +77,8 @@ enum wxGtkWidgetType
{ {
wxGTK_BUTTON, wxGTK_BUTTON,
wxGTK_LIST, wxGTK_LIST,
wxGTK_MENUITEM wxGTK_MENUITEM,
wxGTK_TEXTCTRL
}; };
// the colour we need // the colour we need
@@ -90,6 +107,10 @@ static bool GetColourFromGTKWidget(GdkColor& gdkColor,
widget = gtk_button_new(); widget = gtk_button_new();
break; break;
case wxGTK_TEXTCTRL:
widget = gtk_text_view_new();
break;
case wxGTK_LIST: case wxGTK_LIST:
widget = gtk_tree_view_new_with_model( widget = gtk_tree_view_new_with_model(
(GtkTreeModel*)gtk_list_store_new(1, G_TYPE_INT)); (GtkTreeModel*)gtk_list_store_new(1, G_TYPE_INT));
@@ -176,7 +197,15 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
break; break;
case wxSYS_COLOUR_WINDOW: 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; break;
case wxSYS_COLOUR_3DDKSHADOW: case wxSYS_COLOUR_3DDKSHADOW: