terminal/src/cascadia/TerminalSettingsEditor/SettingContainerStyle.xaml
2021-11-09 14:38:31 -08:00

202 lines
12 KiB
XML

<!--
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="ExpanderBorderBrushExpandedPointerOver"
ResourceKey="SystemControlForegroundTransparentBrush" />
<StaticResource x:Key="ExpanderTextColorExpandedPointerOver"
ResourceKey="SystemControlForegroundBaseHighBrush" />
<Style x:Key="SecondaryTextBlockStyle"
TargetType="TextBlock">
<Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumColor}" />
</Style>
<Color x:Key="CardBackgroundFillColorDefault">#B3FFFFFF</Color>
<Color x:Key="CardStrokeColorDefault">#0F000000</Color>
<SolidColorBrush x:Key="CardBackgroundFillColorDefaultBrush" Color="{StaticResource CardBackgroundFillColorDefault}" />
<SolidColorBrush x:Key="CardStrokeColorDefaultBrush" Color="{StaticResource CardStrokeColorDefault}" />
<SolidColorBrush x:Key="SubgroupHeaderBrush" Color="{StaticResource SystemBaseMediumColor}" />
<StaticResource x:Key="ExpanderHeaderBackground" ResourceKey="CardBackgroundFillColorDefaultBrush" />
<StaticResource x:Key="ExpanderHeaderBorderBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<x:Double x:Key="FlyoutThemeMinWidth">96</x:Double>
<Thickness x:Key="ExpanderHeaderBorderThickness">1</Thickness>
<CornerRadius x:Key="ControlCornerRadius">4</CornerRadius>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<StaticResource x:Key="ExpanderBorderBrushExpandedPointerOver"
ResourceKey="SystemControlHighlightBaseHighBrush" />
<StaticResource x:Key="ExpanderTextColorExpandedPointerOver"
ResourceKey="SystemColorHighlightTextColor" />
<Style x:Key="SecondaryTextBlockStyle"
TargetType="TextBlock" />
<!-- Do not mess with the foreground color for High Contrast. Let it ride as is. -->
<Color x:Key="CardBackgroundFillColorDefault">#FF0000</Color>
<Color x:Key="CardStrokeColorDefault">#FF0000</Color>
<StaticResource x:Key="CardBackgroundFillColorDefaultBrush" ResourceKey="SystemColorButtonFaceColorBrush" />
<StaticResource x:Key="CardStrokeColorDefaultBrush" ResourceKey="SystemColorButtonTextColorBrush" />
<StaticResource x:Key="ExpanderHeaderBackground" ResourceKey="SystemColorButtonFaceColorBrush" />
<StaticResource x:Key="ExpanderHeaderBorderBrush" ResourceKey="SystemColorButtonTextColorBrush" />
<SolidColorBrush x:Key="SubgroupHeaderBrush" Color="{ThemeResource SystemColorWindowTextColor}" />
<x:Double x:Key="FlyoutThemeMinWidth">96</x:Double>
<Thickness x:Key="ExpanderHeaderBorderThickness">2</Thickness>
<CornerRadius x:Key="ControlCornerRadius">4</CornerRadius>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<StaticResource x:Key="ExpanderBorderBrushExpandedPointerOver"
ResourceKey="SystemControlForegroundTransparentBrush" />
<StaticResource x:Key="ExpanderTextColorExpandedPointerOver"
ResourceKey="SystemControlForegroundBaseHighBrush" />
<Style x:Key="SecondaryTextBlockStyle"
TargetType="TextBlock">
<Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumColor}" />
</Style>
<Color x:Key="CardBackgroundFillColorDefault">#0DFFFFFF</Color>
<Color x:Key="CardStrokeColorDefault">#19000000</Color>
<SolidColorBrush x:Key="CardBackgroundFillColorDefaultBrush" Color="{StaticResource CardBackgroundFillColorDefault}" />
<SolidColorBrush x:Key="CardStrokeColorDefaultBrush" Color="{StaticResource CardStrokeColorDefault}" />
<SolidColorBrush x:Key="SubgroupHeaderBrush" Color="{StaticResource SystemBaseMediumColor}" />
<StaticResource x:Key="ExpanderHeaderBackground" ResourceKey="CardBackgroundFillColorDefaultBrush" />
<StaticResource x:Key="ExpanderHeaderBorderBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<x:Double x:Key="FlyoutThemeMinWidth">96</x:Double>
<Thickness x:Key="ExpanderHeaderBorderThickness">1</Thickness>
<CornerRadius x:Key="ControlCornerRadius">4</CornerRadius>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<Style x:Key="SettingContainerHeaderStyle"
TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Margin" Value="0,0,0,4" />
</Style>
<Style x:Key="SettingContainerResetButtonStyle"
TargetType="Button">
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="Height" Value="19" />
<Setter Property="Width" Value="19" />
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="SettingContainerFontIconStyle"
TargetType="FontIcon">
<Setter Property="Foreground" Value="{StaticResource SystemAccentColor}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontFamily" Value="Segoe MDL2 Assets" />
</Style>
<Style x:Key="NonExpanderGrid" TargetType="Grid">
<Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
<Setter Property="MinWidth" Value="{ThemeResource FlyoutThemeMinWidth}" />
<Setter Property="MinHeight" Value="64" />
<Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
<Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
<Setter Property="Padding" Value="16,0,8,0" />
<Setter Property="Margin" Value="0,4,0,0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
<Setter Property="VerticalAlignment" Value="Stretch" />
</Style>
<Style
x:Key="SettingsPageItemHeaderStyle"
BasedOn="{StaticResource BodyTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Margin" Value="0,12,0,0" />
<Setter Property="LineHeight" Value="20" />
<Setter Property="TextWrapping" Value="WrapWholeWords" />
</Style>
<Style
x:Key="SettingsPageItemDescriptionStyle"
BasedOn="{StaticResource CaptionTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Margin" Value="0,0,24,12" />
<Setter Property="LineHeight" Value="16" />
<Setter Property="Foreground" Value="{ThemeResource SubgroupHeaderBrush}" />
<Setter Property="TextWrapping" Value="WrapWholeWords" />
</Style>
<Style TargetType="local:SettingContainer">
<Setter Property="Margin" Value="0,0,8,0" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:SettingContainer">
<StackPanel>
<Grid Style="{StaticResource NonExpanderGrid}"
x:Name="ayy">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock
Text="{TemplateBinding Header}"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<TextBlock Style="{StaticResource SettingsPageItemDescriptionStyle}"
Text="{TemplateBinding HelpText}"/>
</StackPanel>
<ContentPresenter
Grid.Column="1"
MinWidth="0"
HighContrastAdjustment="None"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="{TemplateBinding Content}" />
</Grid>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="local:SettingContainer"
x:Key="ExpanderSettingContainerStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:SettingContainer">
<muxc:Expander Margin="0,4,8,0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<muxc:Expander.Header>
<Grid MinHeight="64">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock
Text="{TemplateBinding Header}"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<TextBlock Text="{TemplateBinding HelpText}"
Style="{StaticResource SettingsPageItemDescriptionStyle}" />
</StackPanel>
<TextBlock Grid.Column="1"
HorizontalAlignment="Right"
Margin="0,0,-16,0"
VerticalAlignment="Center"
Style="{StaticResource SettingsPageItemDescriptionStyle}"
Text="{TemplateBinding CurrentValue}"/>
</Grid>
</muxc:Expander.Header>
<muxc:Expander.Content>
<ContentPresenter Content="{TemplateBinding Content}"/>
</muxc:Expander.Content>
</muxc:Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>