Fix disabling wxStaticText repeatedly in wxOSX.

Changes in r78107 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/trunk@78144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-11-12 15:10:56 +00:00
parent 6aa18bf7c4
commit bb57c8e60f

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]];
}
}