From 45862976b7566d416aff887b74eb60cb039a3dd6 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 7 Apr 2017 11:00:54 +0200 Subject: [PATCH] winrt: Fix build for Windows 10 Creators Update Phone specific UI colors have been removed from the windows headers. Continue to use the enum values does not gain anything as the native calls return errors for those. Actually they did that already with 14393. Change-Id: I4b04d3af319766216ae7c550af704aab488c1d15 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrttheme.cpp | 3 +++ src/plugins/platforms/winrt/winrt.pro | 1 + 2 files changed, 4 insertions(+) diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp index 6b35bde83ef..5696ae7a10a 100644 --- a/src/plugins/platforms/winrt/qwinrttheme.cpp +++ b/src/plugins/platforms/winrt/qwinrttheme.cpp @@ -146,6 +146,8 @@ static void nativeColorSettings(QPalette &p) if (uiColorSettings(L"Hotlight", UIElementType_Hotlight, &color)) p.setColor(QPalette::BrightText, fromColor(color)); + // Starting with SDK 15063 those have been removed. +#ifndef QT_WINRT_DISABLE_PHONE_COLORS //Phone related if (uiColorSettings(L"PopupBackground", UIElementType_PopupBackground, &color)) { p.setColor(QPalette::ToolTipBase, fromColor(color)); @@ -186,6 +188,7 @@ static void nativeColorSettings(QPalette &p) if (uiColorSettings(L"TextContrastWithHigh", UIElementType_TextContrastWithHigh, &color)) p.setColor(QPalette::BrightText, fromColor(color)); +#endif // QT_WINRT_DISABLE_PHONE_COLORS } QWinRTTheme::QWinRTTheme() diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro index 35801fdacca..02a848b03f6 100644 --- a/src/plugins/platforms/winrt/winrt.pro +++ b/src/plugins/platforms/winrt/winrt.pro @@ -51,6 +51,7 @@ OTHER_FILES += winrt.json WINRT_SDK_VERSION_STRING = $$(UCRTVersion) WINRT_SDK_VERSION = $$member($$list($$split(WINRT_SDK_VERSION_STRING, .)), 2) lessThan(WINRT_SDK_VERSION, 14322): DEFINES += QT_WINRT_LIMITED_DRAGANDDROP +greaterThan(WINRT_SDK_VERSION, 14393): DEFINES += QT_WINRT_DISABLE_PHONE_COLORS contains(DEFINES, QT_NO_DRAGANDDROP) { SOURCES -= qwinrtdrag.cpp