QMacStyle: Render tool button even when a11y is missing

Tool buttons were being skipped a couple cases (CE_ToolButtonLabel
and CC_ToolButton) when accessibility was disabled. Although unlikely
anyone would disable accessibility on macOS, we fall back to the non-
toolbar rendering if that were to be the case.

Change-Id: Ie8ee11475efbe4b418c34842317bafeba80c3c57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
bb10
Gabriel de Dietrich 2017-11-09 13:21:23 +07:00
parent 1939cb0210
commit 67e3d19239
1 changed files with 6 additions and 6 deletions

View File

@ -3786,12 +3786,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
} else {
QCommonStyle::drawControl(ce, &myTb, p, w);
}
} else {
} else
#endif // QT_NO_ACCESSIBILITY
{
QCommonStyle::drawControl(ce, &myTb, p, w);
}
#else
Q_UNUSED(tb)
#endif
}
break;
case CE_ToolBoxTabShape:
@ -5674,7 +5673,9 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
p->fillPath(path, brush);
}
proxy()->drawControl(CE_ToolButtonLabel, opt, p, widget);
} else {
} else
#endif // QT_NO_ACCESSIBILITY
{
ThemeButtonKind bkind = kThemeBevelButton;
switch (d->aquaSizeConstrain(opt, widget)) {
case QStyleHelper::SizeDefault:
@ -5757,7 +5758,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
label.rect = buttonRect.adjusted(fw, fw, -fw, -fw);
proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget);
}
#endif
}
break;
#if QT_CONFIG(dial)