summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2012-05-07 17:40:20 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2012-05-07 17:40:20 (GMT)
commitfcc12b02f685ed860f6187571b6e14fd3b61285a (patch)
treedc2d78437db805b873ef02a1bd8303ad433f86b6
parent8ce926715a540b179738402c9cc13278be762c5e (diff)
Adjust combobox label position according to padding values.
BUG: 299260 FIXED-IN: 4.8.4
-rw-r--r--khtml/rendering/render_form.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp
index 586bbd8..cd0836f 100644
--- a/khtml/rendering/render_form.cpp
+++ b/khtml/rendering/render_form.cpp
@@ -119,7 +119,19 @@ using namespace DOM;
}
return;
}
- style()->drawControl(element,option,painter,widget);
+
+ if (element == QStyle::CE_ComboBoxLabel) {
+ const QStyleOptionComboBox *o = qstyleoption_cast<const QStyleOptionComboBox*>(option);
+ if (o) {
+ QStyleOptionComboBox comboOpt = *o;
+ // by default combobox label is drawn left justified, vertical centered
+ // translate it to reflect padding values
+ comboOpt.rect = comboOpt.rect.translated(left, (top - bottom) / 2);
+ return style()->drawControl(element, &comboOpt, painter, widget);
+ }
+ }
+
+ style()->drawControl(element, option, painter, widget);
}
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex* opt, SubControl sc, const QWidget* widget) const
@@ -1991,8 +2003,7 @@ void RenderSelect::setOptionsChanged(bool _optionsChanged)
void RenderSelect::setPadding()
{
- if (m_size > 1 || m_multiple)
- RenderFormElement::setPadding();
+ RenderFormElement::setPadding();
}
ListBoxWidget* RenderSelect::createListBox()