From fedfa897b9de5139ac895d6ad9f857702a6048b3 Mon Sep 17 00:00:00 2001 From: ste Date: Fri, 27 Jul 2018 00:06:54 +0100 Subject: [PATCH 1/6] GPII-3220: Setting the high-contrast themes via their DisplayName. --- testData/solutions/win32.json5 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index b30d95130..40c6b8592 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -2012,6 +2012,14 @@ } } }, + "configure": [ + "settings.configureTheme", + { + "type": "gpii.windows.setHighContrastTheme", + "filename": "${{registry}HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\LastHighContrastTheme}" + }, + "settings.configure" + ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" From 6ca4b3bd43495f7901c23f5f708b1544cf59846b Mon Sep 17 00:00:00 2001 From: ste Date: Fri, 27 Jul 2018 00:18:02 +0100 Subject: [PATCH 2/6] GPII-3220: Tests for setHighContrastTheme --- testData/solutions/win32.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 40c6b8592..225190cf1 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -2015,7 +2015,7 @@ "configure": [ "settings.configureTheme", { - "type": "gpii.windows.setHighContrastTheme", + "type": "gpii.windows.spiSettingsHandler.setHighContrastTheme", "filename": "${{registry}HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\LastHighContrastTheme}" }, "settings.configure" From ece3e231bbeeba727e47bd34e7a901abe6aea83f Mon Sep 17 00:00:00 2001 From: ste Date: Sun, 29 Jul 2018 12:15:22 +0100 Subject: [PATCH 3/6] GPII-3187: Added custom pre-defined themes --- testData/solutions/win32.json5 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 225190cf1..7563f4332 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1928,7 +1928,7 @@ ] }, "settingsHandlers": { - "configure": { + "configure-spi": { "type": "gpii.windows.spiSettingsHandler", "liveness": "live", "options": { @@ -1970,7 +1970,7 @@ "http://registry\\.gpii\\.net/common/highContrast/enabled": "HighContrastOn.value" } }, - "configureTheme": { + "configure-registry": { "type": "gpii.windows.registrySettingsHandler", "liveness": "live", "options": { @@ -2001,11 +2001,14 @@ "type": "fluid.transforms.valueMapper", "defaultInputPath": "http://registry\\.gpii\\.net/common/highContrastTheme", "match": { - "black-white": "%SystemRoot%\\resources\\Ease of Access Themes\\hcwhite.theme", - "white-black": "%SystemRoot%\\resources\\Ease of Access Themes\\hcblack.theme", - "black-yellow": "%SystemRoot%\\resources\\Ease of Access Themes\\hc1.theme", - "yellow-black": "%SystemRoot%\\resources\\Ease of Access Themes\\hc1.theme", - "lime-black": "%SystemRoot%\\resources\\Ease of Access Themes\\hc2.theme" + "black-white": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hcwhite.theme", + "white-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hcblack.theme", + "black-yellow": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hc1.theme", + "yellow-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\yellowOnBlack.theme", + "lime-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hc2.theme", + "black-brown": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\blackOnBrown.theme", + "gray-dark": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnDark.theme", + "gray-white": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnWhite.theme" } } } @@ -2013,12 +2016,12 @@ } }, "configure": [ - "settings.configureTheme", + "settings.configure-registry", { "type": "gpii.windows.spiSettingsHandler.setHighContrastTheme", "filename": "${{registry}HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\LastHighContrastTheme}" }, - "settings.configure" + "settings.configure-spi" ], "isInstalled": [ { From 587f23a1b49ee3e15d24ca4069f110913c2a0a1c Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 6 Aug 2018 22:32:14 +0100 Subject: [PATCH 4/6] GPII-3220: Implied highContrast/enabled from highContrastTheme, so QSS can set highContrastTheme without explicitly turning H/C on. --- testData/solutions/win32.json5 | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 7563f4332..eb016841f 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1953,9 +1953,34 @@ }, "capabilitiesTransformations": { "HighContrastOn": { + // (highContrast.enabled || highContrastTheme) && (highContrastTheme != "regular-contrast") "transform": { - "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", + "type": "fluid.transforms.binaryOp", + "left": { + "transform": { + "type": "fluid.transforms.binaryOp", + "leftPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", + "operator": "||", + "right": { + "transform": { + "type": "fluid.transforms.stringToBoolean", + "inputPath": "http://registry\\.gpii\\.net/common/highContrastTheme", + "outputPath": "value" + } + }, + "outputPath": "value" + } + }, + "operator": "&&", + "right": { + "transform": { + "type": "fluid.transforms.binaryOp", + "leftPath": "http://registry\\.gpii\\.net/common/highContrastTheme", + "operator": "!==", + "right": "regular-contrast", + "outputPath": "value" + } + }, "outputPath": "value" }, "path": { From 7ede6a523909d7b82779245167cd46ccf0102c52 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 7 Aug 2018 13:12:24 +0100 Subject: [PATCH 5/6] GPII-3220: Fixed high-contrast transformations. --- testData/solutions/win32.json5 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 497652a12..eb6ef9678 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1960,25 +1960,20 @@ "transform": { "type": "fluid.transforms.binaryOp", "leftPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", + "left": false, "operator": "||", - "right": { - "transform": { - "type": "fluid.transforms.stringToBoolean", - "inputPath": "http://registry\\.gpii\\.net/common/highContrastTheme", - "outputPath": "value" - } - }, - "outputPath": "value" + "rightPath": "http://registry\\.gpii\\.net/common/highContrastTheme", + "right": false } }, "operator": "&&", "right": { "transform": { "type": "fluid.transforms.binaryOp", + "left": "", "leftPath": "http://registry\\.gpii\\.net/common/highContrastTheme", "operator": "!==", - "right": "regular-contrast", - "outputPath": "value" + "right": "regular-contrast" } }, "outputPath": "value" From 74ee7cc17b55a5734388a0c58d9425773be3c4c5 Mon Sep 17 00:00:00 2001 From: ste Date: Fri, 10 Aug 2018 22:43:22 +0100 Subject: [PATCH 6/6] GPII-3220: Made high-contrast theme names point to the correct files. --- testData/solutions/win32.json5 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index eb6ef9678..7f0873540 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -2023,12 +2023,14 @@ "match": { "black-white": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hcwhite.theme", "white-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hcblack.theme", - "black-yellow": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hc1.theme", - "yellow-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\yellowOnBlack.theme", + "yellow-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hc1.theme", + "black-yellow": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\yellowOnBlack.theme", "lime-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\hc2.theme", "black-brown": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\blackOnBrown.theme", - "gray-dark": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnDark.theme", - "gray-white": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnWhite.theme" + "gray-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnDark.theme", + "grey-black": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnDark.theme", + "gray-white": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnWhite.theme", + "grey-white": "${{environment}.SystemRoot}\\resources\\Ease of Access Themes\\grayOnWhite.theme" } } }