only use font/colours in SetWidgetStyle() if they're set

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-04-01 12:45:24 +00:00
parent 02a8e64ca3
commit 40452e0583
2 changed files with 6 additions and 6 deletions

View File

@@ -4166,7 +4166,7 @@ void wxWindowGTK::SetWidgetStyle()
GtkStyle *style = GetWidgetStyle(); GtkStyle *style = GetWidgetStyle();
if (m_font != wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT )) if ( m_hasFont )
{ {
#ifdef __WXGTK20__ #ifdef __WXGTK20__
pango_font_description_free( style->font_desc ); pango_font_description_free( style->font_desc );
@@ -4177,7 +4177,7 @@ void wxWindowGTK::SetWidgetStyle()
#endif #endif
} }
if (m_foregroundColour.Ok()) if ( m_hasFgCol )
{ {
m_foregroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) ); m_foregroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
if (m_foregroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)) if (m_foregroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT))
@@ -4203,7 +4203,7 @@ void wxWindowGTK::SetWidgetStyle()
} }
} }
if (m_backgroundColour.Ok()) if ( m_hasBgCol )
{ {
m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) ); m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)) if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))

View File

@@ -4166,7 +4166,7 @@ void wxWindowGTK::SetWidgetStyle()
GtkStyle *style = GetWidgetStyle(); GtkStyle *style = GetWidgetStyle();
if (m_font != wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT )) if ( m_hasFont )
{ {
#ifdef __WXGTK20__ #ifdef __WXGTK20__
pango_font_description_free( style->font_desc ); pango_font_description_free( style->font_desc );
@@ -4177,7 +4177,7 @@ void wxWindowGTK::SetWidgetStyle()
#endif #endif
} }
if (m_foregroundColour.Ok()) if ( m_hasFgCol )
{ {
m_foregroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) ); m_foregroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
if (m_foregroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)) if (m_foregroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT))
@@ -4203,7 +4203,7 @@ void wxWindowGTK::SetWidgetStyle()
} }
} }
if (m_backgroundColour.Ok()) if ( m_hasBgCol )
{ {
m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) ); m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)) if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))