summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qwindowsvistastyle.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-06-11 10:53:07 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2010-06-11 10:56:55 (GMT)
commit8577353b2a5155600e672955e7c6a61e9e9519ca (patch)
tree8bda3a044fa2cdaf693ca22db19fb16d184e2c9a /src/gui/styles/qwindowsvistastyle.cpp
parentdc80d7886d1fea853a6a0bdd0960d619cb6fff07 (diff)
downloadQt-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/qwindowsvistastyle.cpp')
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 67a7b85..8511592 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -1926,30 +1926,7 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption
return QWindowsStyle::sizeFromContents(type, option, size, widget);
QSize sz(size);
-
- QSize newSize = QWindowsXPStyle::sizeFromContents(type, option, size, widget);
switch (type) {
- case CT_LineEdit:
- case CT_ComboBox:
- {
- HTHEME theme = pOpenThemeData(0, L"Button");
- MARGINS borderSize;
- if (theme) {
- int result = pGetThemeMargins(theme,
- NULL,
- BP_PUSHBUTTON,
- PBS_NORMAL,
- TMT_CONTENTMARGINS,
- NULL,
- &borderSize);
- if (result == S_OK) {
- sz += QSize(borderSize.cxLeftWidth + borderSize.cxRightWidth - 2,
- borderSize.cyBottomHeight + borderSize.cyTopHeight - 2);
- }
- sz += QSize(23, 0); //arrow button
- }
- }
- return sz;
case CT_MenuItem:
sz = QWindowsXPStyle::sizeFromContents(type, option, size, widget);
int minimumHeight;
@@ -1990,7 +1967,7 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption
default:
break;
}
- return newSize;
+ return QWindowsXPStyle::sizeFromContents(type, option, size, widget);
}
/*!