diff options
author | Jens Bache-Wiig <jens.bache-wiig@nokia.com> | 2009-06-25 14:35:55 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jens.bache-wiig@nokia.com> | 2009-06-25 14:37:04 (GMT) |
commit | db24e82b6b74be303492f186a45d784fcd84fdc6 (patch) | |
tree | 13b3358df74d262a97356c5759a77debec4051bc /src/gui/styles/qwindowsxpstyle.cpp | |
parent | 47c9e7b1b3551ff6dbe71590461a45ae398a9501 (diff) | |
download | Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.zip Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.tar.gz Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.tar.bz2 |
Improved support for DPI on Mac and Vista/7
This significantly improves the support for
higher DPI-values on these platforms by
ensuring that common pixelmetrics are
scaled accordingly. In addition we mark all
Qt apps as DPI-aware on Windows 7 by calling
SetProcessDPIAware. We also changed the
way we draw pixmaps on the mac paintengine
when using dpi scaling > 1 to ensure smooth
pixmap scaling.
Reviewed-by: nrc
Task-id: 242417
Diffstat (limited to 'src/gui/styles/qwindowsxpstyle.cpp')
-rw-r--r-- | src/gui/styles/qwindowsxpstyle.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index b0eae1f..322bfac 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -3235,7 +3235,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con break; case PM_SplitterWidth: - res = qMax(5, QApplication::globalStrut().width()); + res = qMax(int(QStyleHelper::dpiScaled(5.)), QApplication::globalStrut().width()); break; case PM_IndicatorWidth: @@ -3245,7 +3245,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con if (theme.isValid()) { SIZE size; pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size); - res = (pm == PM_IndicatorWidth ? size.cx+2 : res = size.cy+2); + res = (pm == PM_IndicatorWidth ? size.cx : res = size.cy); } } break; @@ -3257,7 +3257,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con if (theme.isValid()) { SIZE size; pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size); - res = (pm == PM_ExclusiveIndicatorWidth ? size.cx+2 : res = size.cy+2); + res = (pm == PM_ExclusiveIndicatorWidth ? size.cx : res = size.cy); } } break; @@ -3329,7 +3329,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con #ifndef QT_NO_TOOLBAR case PM_ToolBarHandleExtent: - res = 8; + res = int(QStyleHelper::dpiScaled(8.)); break; #endif // QT_NO_TOOLBAR @@ -3344,10 +3344,10 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con } break; case PM_DockWidgetSeparatorExtent: - res = 4; + res = int(QStyleHelper::dpiScaled(4.)); break; case PM_DockWidgetTitleMargin: - res = 4; + res = int(QStyleHelper::dpiScaled(4.)); break; case PM_ButtonShiftHorizontal: |