diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index 9ac21f6245..a652192722 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -55,10 +55,8 @@ bool wxPanel::Create(wxWindow *parent, wxWindowID id, if ( ret ) { -#ifndef __WXGTK__ SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); -#endif } return ret; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index cc3a5b7c45..332fd7407e 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2891,7 +2891,8 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) return TRUE; } - if (m_wxwindow) + if ((m_wxwindow) && + (m_backgroundColour != wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE))) { /* wxMSW doesn't clear the window here. I don't do that either to provide compatibility. call Clear() to do the job. */ @@ -2900,17 +2901,7 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) gdk_window_set_background( window, m_backgroundColour.GetColor() ); } - wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); - if (sysbg == m_backgroundColour) - { - m_backgroundColour = wxNullColour; - ApplyWidgetStyle(); - m_backgroundColour = sysbg; - } - else - { - ApplyWidgetStyle(); - } + ApplyWidgetStyle(); return TRUE; } @@ -2943,17 +2934,7 @@ bool wxWindow::SetForegroundColour( const wxColour &colour ) return TRUE; } - wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); - if ( sysbg == m_backgroundColour ) - { - m_backgroundColour = wxNullColour; - ApplyWidgetStyle(); - m_backgroundColour = sysbg; - } - else - { - ApplyWidgetStyle(); - } + ApplyWidgetStyle(); return TRUE; } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index cc3a5b7c45..332fd7407e 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2891,7 +2891,8 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) return TRUE; } - if (m_wxwindow) + if ((m_wxwindow) && + (m_backgroundColour != wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE))) { /* wxMSW doesn't clear the window here. I don't do that either to provide compatibility. call Clear() to do the job. */ @@ -2900,17 +2901,7 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) gdk_window_set_background( window, m_backgroundColour.GetColor() ); } - wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); - if (sysbg == m_backgroundColour) - { - m_backgroundColour = wxNullColour; - ApplyWidgetStyle(); - m_backgroundColour = sysbg; - } - else - { - ApplyWidgetStyle(); - } + ApplyWidgetStyle(); return TRUE; } @@ -2943,17 +2934,7 @@ bool wxWindow::SetForegroundColour( const wxColour &colour ) return TRUE; } - wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); - if ( sysbg == m_backgroundColour ) - { - m_backgroundColour = wxNullColour; - ApplyWidgetStyle(); - m_backgroundColour = sysbg; - } - else - { - ApplyWidgetStyle(); - } + ApplyWidgetStyle(); return TRUE; }