Set/Reset ThemeEnabled when changing the fore/background colours.

Using wxNullColour will reset to defaults.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-06-17 21:31:13 +00:00
parent 948f6c6e4c
commit 44dfb5ce92
3 changed files with 38 additions and 28 deletions

View File

@@ -1007,25 +1007,23 @@ wxColour wxWindowBase::GetForegroundColour() const
bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
{
if ( !colour.Ok() || (colour == m_backgroundColour) )
if ( colour == m_backgroundColour )
return false;
m_hasBgCol = colour.Ok();
m_backgroundColour = colour;
m_hasBgCol = true;
SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() );
return true;
}
bool wxWindowBase::SetForegroundColour( const wxColour &colour )
{
if ( !colour.Ok() || (colour == m_foregroundColour) )
if (colour == m_foregroundColour )
return false;
m_hasFgCol = colour.Ok();
m_foregroundColour = colour;
m_hasFgCol = true;
SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.Ok() );
return true;
}