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:
@@ -56,6 +56,8 @@
|
|||||||
|
|
||||||
- (void) setEnabled:(BOOL) flag
|
- (void) setEnabled:(BOOL) flag
|
||||||
{
|
{
|
||||||
|
bool wasEnabled = [self isEnabled];
|
||||||
|
|
||||||
[super setEnabled: flag];
|
[super setEnabled: flag];
|
||||||
|
|
||||||
if (![self drawsBackground]) {
|
if (![self drawsBackground]) {
|
||||||
@@ -68,9 +70,12 @@
|
|||||||
[self setTextColor: m_textColor];
|
[self setTextColor: m_textColor];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (wasEnabled)
|
||||||
{
|
{
|
||||||
[m_textColor release];
|
[m_textColor release];
|
||||||
m_textColor = [[self textColor] retain];
|
m_textColor = [[self textColor] retain];
|
||||||
|
}
|
||||||
[self setTextColor: [NSColor secondarySelectedControlColor]];
|
[self setTextColor: [NSColor secondarySelectedControlColor]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user