diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-08-25 12:16:31 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-08-25 12:16:31 (GMT) |
commit | caa024e76818ae543897c2f2890cd70212bae23a (patch) | |
tree | 7afcd223b8a49f27d03d7739f85ef4fc25a224e4 /src/gui/styles | |
parent | c9d2f14b2a814fd29c858d9519e82fc5cbc2afdf (diff) | |
download | Qt-caa024e76818ae543897c2f2890cd70212bae23a.zip Qt-caa024e76818ae543897c2f2890cd70212bae23a.tar.gz Qt-caa024e76818ae543897c2f2890cd70212bae23a.tar.bz2 |
Fix subControlRect of the Mac style for the QComboBox
The subControlRect of the arrow and the listBoxPopup where assuming
the widget rect is at the origin.
Reviewed-by: Richard Moe Gustavsen
Reviewed-by: Pierre Rossi
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 389ee85..4696ee1 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -5495,16 +5495,23 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op case SC_ComboBoxArrow:{ ret = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); ret.setX(ret.x() + ret.width()); - ret.setWidth(combo->rect.width() - ret.width() - ret.x()); + ret.setWidth(combo->rect.right() - ret.right()); break; } case SC_ComboBoxListBoxPopup:{ if (combo->editable) { HIRect inner = QMacStylePrivate::comboboxInnerBounds(qt_hirectForQRect(combo->rect), bdi.kind); QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); - ret.adjust(qRound(inner.origin.x), 0, qRound(inner.origin.x + inner.size.width), editRect.y() + editRect.height() + 2); + const int comboTop = combo->rect.top(); + ret = QRect(qRound(inner.origin.x), + comboTop, + qRound(inner.origin.x - combo->rect.left() + inner.size.width), + editRect.bottom() - comboTop + 2); } else { QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); - ret.adjust(4 - 11, 1, editRect.width() + 10 + 11, 1); + ret = QRect(combo->rect.x() + 4 - 11, + combo->rect.y() + 1, + editRect.width() + 10 + 11, + 1); } break; } default: |