diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2010-06-11 10:53:07 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2010-06-11 10:56:55 (GMT) |
commit | 8577353b2a5155600e672955e7c6a61e9e9519ca (patch) | |
tree | 8bda3a044fa2cdaf693ca22db19fb16d184e2c9a /src/gui/styles/qwindowsxpstyle.cpp | |
parent | dc80d7886d1fea853a6a0bdd0960d619cb6fff07 (diff) | |
download | Qt-8577353b2a5155600e672955e7c6a61e9e9519ca.zip Qt-8577353b2a5155600e672955e7c6a61e9e9519ca.tar.gz Qt-8577353b2a5155600e672955e7c6a61e9e9519ca.tar.bz2 |
Fixed size hint for combo box on windows
When you use larger fonts or DPI on windows, the combobox can
calculate a size hint that results of text eliding on items.
This fix removes some duplicate code in Vista style and adds
a dpi dependant size hint for XP style.
Task-number: QTBUG-7552
Reviewed-by: richard
Diffstat (limited to 'src/gui/styles/qwindowsxpstyle.cpp')
-rw-r--r-- | src/gui/styles/qwindowsxpstyle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index efb1224..8743807 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -3678,7 +3678,9 @@ QSize QWindowsXPStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt sz += QSize(borderSize.cxLeftWidth + borderSize.cxRightWidth - 2, borderSize.cyBottomHeight + borderSize.cyTopHeight - 2); } - sz += QSize(23, 0); //arrow button + const int textMargins = 2*(proxy()->pixelMetric(PM_FocusFrameHMargin) + 1); + sz += QSize(qMax(pixelMetric(QStyle::PM_ScrollBarExtent, option, widget) + + textMargins, 23), 0); //arrow button } } break; |