diff options
author | Tero Ahola <tero.ahola@digia.com> | 2012-02-08 10:26:36 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-14 22:01:52 (GMT) |
commit | 1566021e623fb79c4ff5475d51010765a3074bbb (patch) | |
tree | c7a6ad5d99740c9100ec18a51d9099b6aa39f4e8 /src | |
parent | 717e36037cf246aa201c0aaf15a5dcbd7883f159 (diff) | |
download | Qt-1566021e623fb79c4ff5475d51010765a3074bbb.zip Qt-1566021e623fb79c4ff5475d51010765a3074bbb.tar.gz Qt-1566021e623fb79c4ff5475d51010765a3074bbb.tar.bz2 |
Modified vertical alignments of simple widgets on OSX
Adding QCheckBox, QComboBox, QLineEdit etc. into an HBox layout or grid
layout makes the layout look like a snake's trail. Fixed the positioning
of these widgets to make the layouts visually more appealing.
Updated qmacstyle auto-test accordingly.
Task-number: QTBUG-13635
Ammended-by: Gabriel de Dietrich
Ammended-by: Liang Qi
Change-Id: Ic12346f764d8092292b8388f50d184b37d7cef5f
(cherry picked from qtbase/8b6de4677142cab41790ca50ce6c7f1efbab5de8)
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 77c337b..0cdd077 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -764,7 +764,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg if (!widg || !qobject_cast<QComboBox *>(widg->parentWidget())) { //should I take into account the font dimentions of the lineedit? -Sam if (sz == QAquaSizeLarge) - ret = QSize(-1, 22); + ret = QSize(-1, 21); else ret = QSize(-1, 19); } @@ -1146,7 +1146,7 @@ HIRect QMacStylePrivate::comboboxInnerBounds(const HIRect &outerBounds, int butt switch (buttonKind){ case kThemePopupButton: innerBounds.origin.x += 2; - innerBounds.origin.y += 3; + innerBounds.origin.y += 2; innerBounds.size.width -= 5; innerBounds.size.height -= 6; break; @@ -1164,9 +1164,9 @@ HIRect QMacStylePrivate::comboboxInnerBounds(const HIRect &outerBounds, int butt break; case kThemeComboBox: innerBounds.origin.x += 3; - innerBounds.origin.y += 3; + innerBounds.origin.y += 2; innerBounds.size.width -= 6; - innerBounds.size.height -= 6; + innerBounds.size.height -= 8; break; case kThemeComboBoxSmall: innerBounds.origin.x += 3; @@ -1195,7 +1195,7 @@ QRect QMacStylePrivate::comboboxEditBounds(const QRect &outerBounds, const HIThe QRect ret = outerBounds; switch (bdi.kind){ case kThemeComboBox: - ret.adjust(5, 8, -22, -4); + ret.adjust(5, 5, -22, -5); break; case kThemeComboBoxSmall: ret.adjust(4, 6, -20, 0); @@ -1206,7 +1206,7 @@ QRect QMacStylePrivate::comboboxEditBounds(const QRect &outerBounds, const HIThe ret.setHeight(12); break; case kThemePopupButton: - ret.adjust(10, 3, -23, -3); + ret.adjust(10, 2, -23, -4); break; case kThemePopupButtonSmall: ret.adjust(9, 3, -20, -3); @@ -4403,7 +4403,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, if(widget->parentWidget() && qobject_cast<const QComboBox*>(widget->parentWidget())) rect.adjust(-1, -2, 0, 0); else - rect.adjust(-1, 0, 0, +1); + rect.adjust(-1, -1, 0, +1); break; case SE_CheckBoxLayoutItem: rect = opt->rect; |