diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-01-27 13:56:24 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-01-27 13:56:24 (GMT) |
commit | 78bb23107d9fcde431cd2ba83c1a9e9886b6d51a (patch) | |
tree | 159c7a124cebe557990abc5c56ecb2debf5e16a8 /src/gui/styles | |
parent | ac1a7e4469050aa70d065e3c7def9b3fe7aca4a8 (diff) | |
download | Qt-78bb23107d9fcde431cd2ba83c1a9e9886b6d51a.zip Qt-78bb23107d9fcde431cd2ba83c1a9e9886b6d51a.tar.gz Qt-78bb23107d9fcde431cd2ba83c1a9e9886b6d51a.tar.bz2 |
QComboBox drawn incorrectly in RightToLeft mode
QS60Style does not regard layout orientation when calculating subrects
for QComboBox. This leads to a situation where button is not visible
on UI with RightToLeft orientation.
Task-number: QTBUG-7584
Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 47ba088..78279d1 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2620,29 +2620,31 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple // lets use spinbox frame here as well, as no combobox specific value available. const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0; const int buttonWidth = qMax(cmb->rect.height(), buttonIconSize); - const int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth; - const int ypos = cmb->rect.y(); QSize buttonSize; buttonSize.setWidth(buttonWidth + 2 * buttonMargin); buttonSize.setHeight(qMax(8, (cmb->rect.height() >> 1) - frameThickness)); //buttons should be squares buttonSize = buttonSize.expandedTo(QApplication::globalStrut()); switch (scontrol) { - case SC_ComboBoxArrow: + case SC_ComboBoxArrow: { + const int xposMod = cmb->rect.x() + width - buttonMargin - buttonWidth; + const int ypos = cmb->rect.y(); ret.setRect(xposMod, ypos + buttonMargin, buttonWidth, height - 2 * buttonMargin); + } break; case SC_ComboBoxEditField: { - const int withFrameX = cmb->rect.x() + cmb->rect.width() - frameThickness - buttonSize.width(); + const int withFrameX = cmb->rect.x() + width - frameThickness - buttonSize.width(); ret = QRect( frameThickness, frameThickness, withFrameX - frameThickness, - cmb->rect.height() - 2 * frameThickness); + height - 2 * frameThickness); } break; default: break; } + ret = visualRect(cmb->direction, cmb->rect, ret); } break; case CC_GroupBox: |