Fix disabling wxStaticText repeatedly in wxOSX.

Changes in r78108 would reset control's color to gray if it was disabled
more than once in a row. Guard against this and only remember the color
of an enabled control.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-11-12 15:11:13 +00:00
parent 6389c36e9b
commit 915a35aa96

View File

@@ -55,7 +55,9 @@
}
- (void) setEnabled:(BOOL) flag
{
{
bool wasEnabled = [self isEnabled];
[super setEnabled: flag];
if (![self drawsBackground]) {
@@ -68,9 +70,12 @@
[self setTextColor: m_textColor];
}
else
{
[m_textColor release];
m_textColor = [[self textColor] retain];
{
if (wasEnabled)
{
[m_textColor release];
m_textColor = [[self textColor] retain];
}
[self setTextColor: [NSColor secondarySelectedControlColor]];
}
}