d9c93430a0
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).
(cherry picked from commit 43d5713a02
)
172 lines
9.2 KiB
XML
172 lines
9.2 KiB
XML
<!--
|
|
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
|
the MIT License. See LICENSE in the project root for license information.
|
|
-->
|
|
<Page x:Class="Microsoft.Terminal.Settings.Editor.Launch"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:SettingsModel="using:Microsoft.Terminal.Settings.Model"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
|
mc:Ignorable="d">
|
|
|
|
<Page.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="CommonResources.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<DataTemplate x:Key="EnumRadioButtonTemplate"
|
|
x:DataType="local:EnumEntry">
|
|
<RadioButton Content="{x:Bind EnumName, Mode=OneWay}" />
|
|
</DataTemplate>
|
|
<SettingsModel:IconPathConverter x:Key="IconSourceConverter" />
|
|
<Style x:Key="LaunchSizeNumberBoxStyle"
|
|
BasedOn="{StaticResource NumberBoxSettingStyle}"
|
|
TargetType="muxc:NumberBox">
|
|
<Setter Property="SmallChange" Value="1" />
|
|
<Setter Property="LargeChange" Value="10" />
|
|
<Setter Property="Minimum" Value="1" />
|
|
</Style>
|
|
</ResourceDictionary>
|
|
</Page.Resources>
|
|
|
|
<ScrollViewer>
|
|
<StackPanel>
|
|
<StackPanel Style="{StaticResource SettingsStackStyle}">
|
|
<!-- Default Profile -->
|
|
<local:SettingContainer x:Uid="Globals_DefaultProfile"
|
|
Margin="0">
|
|
<ComboBox x:Name="DefaultProfile"
|
|
ItemsSource="{x:Bind State.Settings.AllProfiles, Mode=OneWay}"
|
|
SelectedItem="{x:Bind CurrentDefaultProfile, Mode=TwoWay}"
|
|
Style="{StaticResource ComboBoxSettingStyle}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="SettingsModel:Profile">
|
|
<Grid HorizontalAlignment="Stretch"
|
|
ColumnSpacing="8">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<!-- icon -->
|
|
<ColumnDefinition Width="16" />
|
|
<!-- profile name -->
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<IconSourceElement Grid.Column="0"
|
|
Width="16"
|
|
Height="16"
|
|
IconSource="{x:Bind Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
|
|
|
|
<TextBlock Grid.Column="1"
|
|
Text="{x:Bind Name}" />
|
|
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</local:SettingContainer>
|
|
|
|
<!-- Default Terminal -->
|
|
<local:SettingContainer x:Name="DefaultTerminalDropdown"
|
|
x:Uid="Globals_DefaultTerminal"
|
|
x:Load="false">
|
|
<ComboBox x:Name="DefaultTerminal"
|
|
ItemsSource="{x:Bind State.Settings.DefaultTerminals, Mode=OneWay}"
|
|
SelectedItem="{x:Bind State.Settings.CurrentDefaultTerminal, Mode=TwoWay}"
|
|
Style="{StaticResource ComboBoxSettingStyle}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="SettingsModel:DefaultTerminal">
|
|
<Grid HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
ColumnSpacing="8">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<!-- icon -->
|
|
<ColumnDefinition Width="24" />
|
|
<!-- profile name and author -->
|
|
<ColumnDefinition Width="*" />
|
|
<!-- version -->
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<!-- profile name -->
|
|
<RowDefinition Height="*" />
|
|
<!-- author and version -->
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<IconSourceElement Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="0"
|
|
Width="24"
|
|
Height="24"
|
|
VerticalAlignment="Center"
|
|
IconSource="{x:Bind Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
|
|
|
|
<TextBlock Grid.Row="0"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="2"
|
|
Text="{x:Bind Name}" />
|
|
|
|
<TextBlock Grid.Row="1"
|
|
Grid.Column="1"
|
|
Style="{ThemeResource SecondaryTextBlockStyle}"
|
|
Text="{x:Bind Author}" />
|
|
|
|
<TextBlock Grid.Row="1"
|
|
Grid.Column="2"
|
|
Style="{ThemeResource SecondaryTextBlockStyle}"
|
|
Text="{x:Bind Version}" />
|
|
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</local:SettingContainer>
|
|
|
|
<!-- Start on User Login -->
|
|
<local:SettingContainer x:Uid="Globals_StartOnUserLogin">
|
|
<ToggleSwitch IsOn="{x:Bind State.Settings.GlobalSettings.StartOnUserLogin, Mode=TwoWay}" />
|
|
</local:SettingContainer>
|
|
|
|
<!-- Launch Mode -->
|
|
<local:SettingContainer x:Uid="Globals_LaunchMode">
|
|
<muxc:RadioButtons ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
|
ItemsSource="{x:Bind LaunchModeList}"
|
|
SelectedItem="{x:Bind CurrentLaunchMode, Mode=TwoWay}" />
|
|
</local:SettingContainer>
|
|
|
|
<!-- Launch Mode -->
|
|
<local:SettingContainer x:Uid="Globals_WindowingBehavior">
|
|
<muxc:RadioButtons ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
|
ItemsSource="{x:Bind WindowingBehaviorList}"
|
|
SelectedItem="{x:Bind CurrentWindowingBehavior, Mode=TwoWay}" />
|
|
</local:SettingContainer>
|
|
</StackPanel>
|
|
|
|
<!-- Launch Size -->
|
|
<StackPanel Style="{StaticResource SettingsStackStyle}">
|
|
<!-- Header -->
|
|
<TextBlock x:Uid="Globals_LaunchSize"
|
|
Style="{StaticResource SubtitleTextBlockStyle}" />
|
|
|
|
<!-- Columns -->
|
|
<local:SettingContainer x:Uid="Globals_InitialCols"
|
|
Margin="0">
|
|
<muxc:NumberBox Style="{StaticResource LaunchSizeNumberBoxStyle}"
|
|
Value="{x:Bind State.Settings.GlobalSettings.InitialCols, Mode=TwoWay}" />
|
|
</local:SettingContainer>
|
|
<!-- Rows -->
|
|
<local:SettingContainer x:Uid="Globals_InitialRows">
|
|
<muxc:NumberBox Style="{StaticResource LaunchSizeNumberBoxStyle}"
|
|
Value="{x:Bind State.Settings.GlobalSettings.InitialRows, Mode=TwoWay}" />
|
|
</local:SettingContainer>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Page>
|