From 67e3d192398ccf06d4411acc86df7748b0de98a5 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 9 Nov 2017 13:21:23 +0700 Subject: [PATCH] QMacStyle: Render tool button even when a11y is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/styles/mac/qmacstyle_mac.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index c7f573cc08..1246f64a7d 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -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)