summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-11-09 13:21:23 +0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-11-15 19:05:21 +0000
commit67e3d192398ccf06d4411acc86df7748b0de98a5 (patch)
treec05635b842507d2486411be86892a0037b20a5a5
parent1939cb02104d8e5ca0e4169e18b8e1f400090921 (diff)
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>
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm12
1 files 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)