diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-06 11:06:22 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-06 12:50:39 (GMT) |
commit | e3d3973d761248da23343be47e1be6777e9e84f0 (patch) | |
tree | a0a26e2f693bd5386e5fe6c04ed66dce44f4e95c | |
parent | a48ab815b5b6f6a20d4c8a2dba41e6dfc6a54073 (diff) | |
download | Qt-e3d3973d761248da23343be47e1be6777e9e84f0.zip Qt-e3d3973d761248da23343be47e1be6777e9e84f0.tar.gz Qt-e3d3973d761248da23343be47e1be6777e9e84f0.tar.bz2 |
fixes button size for Windows mobile style
The old button sizes were just to big. For example the trivialwizard
example had a minimal width that was much too wide for the screen.
Task-number: QTBUG-3613
Reviewed-by: thartman
-rw-r--r-- | src/gui/styles/qwindowsmobilestyle.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index c543006..86ba947 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -6330,16 +6330,20 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio switch (type) { case CT_PushButton: if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { - newSize = QWindowsStyle::sizeFromContents(type, option, size, widget); + newSize = QCommonStyle::sizeFromContents(type, option, size, widget); int w = newSize.width(), h = newSize.height(); int defwidth = 0; if (button->features & QStyleOptionButton::AutoDefaultButton) defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, button, widget); - if (w < 75 + defwidth && button->icon.isNull()) - w = 75 + defwidth; - if (h < 23 + defwidth) - h = 23 + defwidth; + + int minwidth = int(QStyleHelper::dpiScaled(55.0f)); + int minheight = int(QStyleHelper::dpiScaled(19.0f)); + + if (w < minwidth + defwidth && button->icon.isNull()) + w = minwidth + defwidth; + if (h < minheight + defwidth) + h = minheight + defwidth; newSize = QSize(w + 4, h + 4); } break; |