From 4cf0deef73ff2f24a80622ec5f391d10c74ea6c7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 10 Feb 2012 17:17:36 +0100 Subject: Add palette() and further hints to QtGui/QPlatformTheme. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move palette() from deprecated QtWidgets/QGuiPlatformPlugin to QtGui/QPlatformTheme, Make it return a const * since QPalette does not have isNull(). - Initialize QGuiApplication::palette() and QApplication::systemPalette() from it. - Do not initialize QPalette from QGuiApplication::palette() unless app_pal is non-null (default to Qt::black if it is 0). This avoids initialization order crashes/recursions in the QPA plugin. Streamline initialization function. - Remove styleName(), systemIconThemeName() and iconSearchPaths() from QGuiPlatformPlugin and re-add them as QPlatformTheme::themeHint(). - Remove styleHint() from QGuiPlatformPlugin, add it to QPlatformTheme::themeHint(). - Add UNIX themes with factory function (Generic, KDE, Gnome), taking it from Qt 4.8 code (stripping the KDE 3 code). - Implement Windows palettes. Task-number: QTBUG-24204 Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/windows/qtwindowsglobal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qtwindowsglobal.h') diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h index 3445a3c7a8..27cfbdc662 100644 --- a/src/plugins/platforms/windows/qtwindowsglobal.h +++ b/src/plugins/platforms/windows/qtwindowsglobal.h @@ -60,7 +60,8 @@ enum KeyDownEventFlag = 0x200000, TouchEventFlag = 0x400000, ClipboardEventFlag = 0x800000, - ApplicationEventFlag = 0x1000000 + ApplicationEventFlag = 0x1000000, + ThemingEventFlag = 0x2000000 }; enum WindowsEventType // Simplify event types @@ -97,6 +98,7 @@ enum WindowsEventType // Simplify event types InputMethodOpenCandidateWindowEvent = InputMethodEventFlag + 4, InputMethodCloseCandidateWindowEvent = InputMethodEventFlag + 5, InputMethodRequest = InputMethodEventFlag + 6, + ThemeChanged = ThemingEventFlag + 1, DisplayChangedEvent = 437, UnknownEvent = 542 }; @@ -178,6 +180,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI return QtWindows::FocusOutEvent; case WM_DISPLAYCHANGE: return QtWindows::DisplayChangedEvent; + case WM_THEMECHANGED: + return QtWindows::ThemeChanged; default: break; } -- cgit v1.2.3