From e996009eb7699cd7caecccd027e39d0eca7f60ab Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 8 May 2012 13:02:44 +0200 Subject: QPA: Add a themeHint for the animations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qplatformtheme.h | 14 +++++++++++++- src/gui/kernel/qplatformtheme_qpa.cpp | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 8d936e8267..f4406ffabc 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -86,7 +86,8 @@ public: DialogButtonBoxLayout, DialogButtonBoxButtonsHaveIcons, UseFullScreenForPopupMenu, - KeyboardScheme + KeyboardScheme, + UiEffects }; enum DialogType { @@ -149,6 +150,17 @@ public: CdeKeyboardScheme }; + enum UiEffect + { + GeneralUiEffect = 0x1, + AnimateMenuUiEffect = 0x2, + FadeMenuUiEffect = 0x4, + AnimateComboUiEffect = 0x8, + AnimateTooltipUiEffect = 0x10, + FadeTooltipUiEffect = 0x20, + AnimateToolBoxUiEffect = 0x40 + }; + virtual ~QPlatformTheme(); virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const; diff --git a/src/gui/kernel/qplatformtheme_qpa.cpp b/src/gui/kernel/qplatformtheme_qpa.cpp index 07a1d7f365..c9ffbe248f 100644 --- a/src/gui/kernel/qplatformtheme_qpa.cpp +++ b/src/gui/kernel/qplatformtheme_qpa.cpp @@ -99,6 +99,8 @@ QT_BEGIN_NAMESPACE \value KeyboardScheme (int) An integer value (enum KeyboardSchemes) specifying the keyboard scheme. + \value UiEffects (int) A flag value consisting of UiEffect values specifying the enabled UI animations. + \sa themeHint(), QStyle::pixelMetric() */ @@ -175,6 +177,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const return QVariant(-1); case KeyboardScheme: return QVariant(int(WindowsKeyboardScheme)); + case UiEffects: + return QVariant(int(0)); } return QVariant(); } -- cgit v1.2.3