Mac style: Fix disabled menu item palette entry

Also, removed an "magic color" form the style implementation.

Change-Id: Iefd3ddc0d9d651d2b87f20eb1f9990a214b651df
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
bb10
Gabriel de Dietrich 2013-03-27 15:02:47 +01:00 committed by The Qt Project
parent fc8759064c
commit 6c10f5203b
2 changed files with 3 additions and 2 deletions

View File

@ -95,6 +95,7 @@ QColor qt_mac_colorForThemeTextColor(ThemeTextColor themeColor)
case kThemeTextColorPushButtonInactive:
case kThemeTextColorTabFrontInactive:
case kThemeTextColorBevelButtonInactive:
case kThemeTextColorMenuItemDisabled:
return QColor(127, 127, 127, 255);
case kThemeTextColorMenuItemSelected:
return Qt::white;
@ -164,7 +165,7 @@ static QMacPaletteMap mac_widget_colors[] = {
QMacPaletteMap(QPlatformTheme::TabBarPalette, kThemeTextColorTabFrontActive, kThemeTextColorTabFrontInactive),
QMacPaletteMap(QPlatformTheme::LabelPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
QMacPaletteMap(QPlatformTheme::GroupBoxPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
QMacPaletteMap(QPlatformTheme::MenuPalette, kThemeTextColorPopupLabelActive, kThemeTextColorPopupLabelInactive),
QMacPaletteMap(QPlatformTheme::MenuPalette, kThemeTextColorMenuItemActive, kThemeTextColorMenuItemDisabled),
//### TODO: The zeros below gives white-on-black text.
QMacPaletteMap(QPlatformTheme::TextEditPalette, 0, 0),
QMacPaletteMap(QPlatformTheme::TextLineEditPalette, 0, 0),

View File

@ -4001,7 +4001,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (!enabled)
p->setPen(mi->palette.text().color());
else if (active)
p->setPen(QColor(Qt::white)); // QPalette's API is incomplete for this case
p->setPen(mi->palette.highlightedText().color());
else
p->setPen(mi->palette.buttonText().color());