summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-11-04 07:33:37 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-05 12:38:59 (GMT)
commit427e398a7b7f3345fb4dcbc275b3ea29f211851b (patch)
tree559c0499e85cfafa0e857e4823eaeb2058250d9e /src
parentc2600ca630d8adf13d6b8cfea8f833291bf7b6f1 (diff)
downloadQt-427e398a7b7f3345fb4dcbc275b3ea29f211851b.zip
Qt-427e398a7b7f3345fb4dcbc275b3ea29f211851b.tar.gz
Qt-427e398a7b7f3345fb4dcbc275b3ea29f211851b.tar.bz2
Correct QToolBar layout on retina displays.
QStyleOptionToolButton::iconSize will be 2x on retina displays. The layout size should not be 2x however, that causes excessive spacing in the toolbar. Task-number: QTBUG-34484 Change-Id: I48cf47044af5b76f39e08c1d580034b84ef2755d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qtoolbutton.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp
index bd74bed..8c4ce84 100644
--- a/src/gui/widgets/qtoolbutton.cpp
+++ b/src/gui/widgets/qtoolbutton.cpp
@@ -427,6 +427,11 @@ QSize QToolButton::sizeHint() const
QSize icon = opt.iconSize;
w = icon.width();
h = icon.height();
+#ifdef Q_WS_MAC
+ extern CGFloat qt_mac_get_scalefactor();
+ w /= qt_mac_get_scalefactor();
+ h /= qt_mac_get_scalefactor();
+#endif
}
if (opt.toolButtonStyle != Qt::ToolButtonIconOnly) {