summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-05-08 13:02:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-09 02:28:31 +0200
commite996009eb7699cd7caecccd027e39d0eca7f60ab (patch)
tree339a2c1d935a360d45e3ff77aa9187d68431d33e /src/plugins
parent55070e863710d49dd4b09903be9a85ea94dff1fe (diff)
QPA: Add a themeHint for the animations.
Introduce a flag matching the Qt::UI_Effect enumeration and return it as hint. Replace the separate boolean flags in QApplication by a single integer using the flags. Change-Id: I29e33d4d23d13723ddb1b3f62fe781b9c0747572 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 000311a807..63ed20eeef 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -296,6 +296,22 @@ static inline QStringList styleNames()
return result;
}
+static inline int uiEffects()
+{
+ int result = 0;
+ if (booleanSystemParametersInfo(SPI_GETUIEFFECTS, false))
+ result |= QPlatformTheme::GeneralUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETMENUANIMATION, false))
+ result |= QPlatformTheme::AnimateMenuUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETMENUFADE, false))
+ result |= QPlatformTheme::FadeMenuUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETCOMBOBOXANIMATION, false))
+ result |= QPlatformTheme::AnimateComboUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETTOOLTIPANIMATION, false))
+ result |= QPlatformTheme::AnimateTooltipUiEffect;
+ return result;
+}
+
QVariant QWindowsTheme::themeHint(ThemeHint hint) const
{
switch (hint) {
@@ -315,6 +331,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
return QVariant(qRound(qreal(QWindowsContext::instance()->defaultDPI()) * 1.375));
case KeyboardScheme:
return QVariant(int(WindowsKeyboardScheme));
+ case UiEffects:
+ return QVariant(uiEffects());
default:
break;
}