From 01054603a797805cc5c18c65aed7f0f192b68851 Mon Sep 17 00:00:00 2001 From: Marko Kangas Date: Thu, 23 Oct 2014 10:27:02 +0300 Subject: Fix tab icon vertical alignment Fixes case if custom icon size is given and height is more than width. Check of minimum valid height was compared wrongly to width and caused invalid vertical alignment. After fix vertical alignment is correct aligned to vertical center with the tab text. Change-Id: I6c4a710b15e91225edeabb629bfea7049ab2f42a Task-number: QTBUG-42143 Reviewed-by: Timur Pocheptsov Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/styles/qcommonstyle.cpp') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 8579308820..1c5dcf5f0a 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1114,7 +1114,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled, (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off ); // High-dpi icons do not need adjustmet; make sure tabIconSize is not larger than iconSize - tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.width())); + tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.height())); *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2, tabIconSize.width(), tabIconSize .height()); -- cgit v1.2.3