From 43d5713a02ff1c208ee65db81a1e4bea2519b456 Mon Sep 17 00:00:00 2001 From: Michael Niksa Date: Tue, 25 May 2021 22:39:26 -0700 Subject: [PATCH] Correct Default Application Selector styles for high contrast and to change with OS theme dark/light toggle (#10185) Correct Default Application Selector styles for high contrast and to change with OS theme dark/light toggle ## References - https://docs.microsoft.com/windows/uwp/design/controls-and-patterns/xaml-theme-resources ## PR Checklist * [x] Closes #10181 * [x] I work here * [x] Manual tests passed ## Detailed Description of the Pull Request / Additional comments 1. If I'm going to override colors, I need to define styles in a resource dictionary with Light, Dark, and HighContrast variants so it can be appropriate for each of those. 2. For HighContrast, I need to not mess with text colors and let them follow the default settings. 3. For using System Brushes, I need to use a `ThemeResource` binding not a `StaticResource` binding. The former lets it change when you flip the OS toggle Light/Dark. The latter is stuck to whatever it was when the page loaded. ## Validation Steps Performed - Loaded in light mode. Flipped to dark. Watched it change live. Checked both unselected and rollover/selected to ensure it was fine. - Loaded in dark mode. Flipped to light. Watched it change live. Checked both unselected and rollover/selected to ensure it was fine. - Flipped to HC. Watched it change live. Confirmed that unselected is black/white contrast and the roll over has the cyan/black. (No longer uses special second-line brush for HC, matches the controls I modeled this one on from OS Settings). --- .../CommonResources.xaml | 20 +++++++++++++++++++ .../TerminalSettingsEditor/Launch.xaml | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/CommonResources.xaml b/src/cascadia/TerminalSettingsEditor/CommonResources.xaml index eed98eaa17a..39eabb0b65c 100644 --- a/src/cascadia/TerminalSettingsEditor/CommonResources.xaml +++ b/src/cascadia/TerminalSettingsEditor/CommonResources.xaml @@ -11,6 +11,26 @@ + + + + + + + + +