From 5eb2f63acda335aaf06e302ee4564259bc60222a Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 7 Oct 2009 18:29:46 +0200 Subject: Fix a combobox autotest on Vista The subcontrol rect offset was correctly reporting not to work on Vista style. The problem was that we were getting the size of the arrow by subtracting the xoffset. But this would mean that the Reviewed-by: ogoffart --- src/gui/styles/qwindowsvistastyle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 6cb8b40..974bce1 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -2217,14 +2217,15 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt int xpos = x; int margin = cb->frame ? 3 : 0; int bmarg = cb->frame ? 2 : 0; - xpos += wi - bmarg - 16; + int arrowButtonWidth = bmarg + 16; + xpos += wi - arrowButtonWidth; switch (subControl) { case SC_ComboBoxFrame: rect = cb->rect; break; case SC_ComboBoxArrow: - rect.setRect(xpos, y , wi - xpos, he); + rect.setRect(xpos, y , arrowButtonWidth, he); break; case SC_ComboBoxEditField: rect.setRect(x + margin, y + margin, wi - 2 * margin - 16, he - 2 * margin); -- cgit v0.12