mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-27 17:09:37 +01:00
WIP: settings sections, shortcuts window, depot tweaks
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
<SolidColorBrush x:Key="CarbonPanelBg" Color="#1E2327" />
|
||||
<SolidColorBrush x:Key="CarbonHeaderBg" Color="#2A3036" />
|
||||
<SolidColorBrush x:Key="CarbonHoverBg" Color="#2A3036" />
|
||||
<!-- Control metrics live here, not in the views. -->
|
||||
<x:Double x:Key="CarbonControlHeight">24</x:Double>
|
||||
<x:Double x:Key="CarbonCheckSize">16</x:Double>
|
||||
|
||||
<SolidColorBrush x:Key="CarbonInputBg" Color="#262C31" />
|
||||
<SolidColorBrush x:Key="CarbonBorderLight" Color="#3A424A" />
|
||||
<SolidColorBrush x:Key="CarbonBorderDark" Color="#0E0F12" />
|
||||
@@ -32,7 +36,7 @@
|
||||
Background="{StaticResource CarbonHeaderBg}"
|
||||
BorderBrush="{StaticResource CarbonBorderLight}"
|
||||
BorderThickness="0,0,0,1"
|
||||
Padding="8,4">
|
||||
Padding="8,3">
|
||||
<DockPanel LastChildFill="True">
|
||||
<ContentPresenter DockPanel.Dock="Right"
|
||||
Content="{TemplateBinding Tag}"
|
||||
@@ -44,19 +48,171 @@
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<ContentPresenter Content="{TemplateBinding Content}"
|
||||
Margin="8" />
|
||||
Margin="6" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFg}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Padding" Value="8,0,0,0" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid ColumnDefinitions="Auto,*" Background="Transparent">
|
||||
<Border Name="box"
|
||||
Width="{StaticResource CarbonCheckSize}"
|
||||
Height="{StaticResource CarbonCheckSize}"
|
||||
VerticalAlignment="Center"
|
||||
Background="{StaticResource CarbonInputBg}"
|
||||
BorderBrush="{StaticResource CarbonBorderLight}"
|
||||
BorderThickness="1" CornerRadius="2">
|
||||
<Path Name="glyph" Margin="3" Stretch="Uniform"
|
||||
Data="M 0,4 L 3,7 L 9,0"
|
||||
Stroke="White" StrokeThickness="2"
|
||||
StrokeLineCap="Round" StrokeJoin="Round"
|
||||
IsVisible="False" />
|
||||
</Border>
|
||||
<ContentPresenter Name="PART_ContentPresenter" Grid.Column="1"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ Border#box">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentHover}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked /template/ Border#box">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonAccent}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccent}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked /template/ Path#glyph">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^:indeterminate /template/ Border#box">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonAccent}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccent}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Opacity" Value="0.45" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="SpinnerButton" TargetType="RepeatButton">
|
||||
<Setter Property="Width" Value="20" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Name="root" Background="Transparent">
|
||||
<ContentPresenter Content="{TemplateBinding Content}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ Border#root">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonBorderLight}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- The spinner frame, so the field and its two buttons read as one control
|
||||
the same shape and height as a combo box. -->
|
||||
<ControlTheme x:Key="{x:Type ButtonSpinner}" TargetType="ButtonSpinner">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonInputBg}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonBorderLight}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
<Setter Property="MinHeight" Value="{StaticResource CarbonControlHeight}" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
MinHeight="{TemplateBinding MinHeight}">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||||
<ContentPresenter Name="PART_ContentPresenter" Grid.Column="0"
|
||||
Content="{TemplateBinding Content}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Stretch" />
|
||||
<RepeatButton Name="PART_IncreaseButton" Grid.Column="1"
|
||||
Theme="{StaticResource SpinnerButton}"
|
||||
IsVisible="{TemplateBinding ShowButtonSpinner}">
|
||||
<Path Data="M 0,4 L 4,0 L 8,4" Stroke="{StaticResource CarbonFgDim}"
|
||||
StrokeThickness="1.4" />
|
||||
</RepeatButton>
|
||||
<RepeatButton Name="PART_DecreaseButton" Grid.Column="2"
|
||||
Theme="{StaticResource SpinnerButton}"
|
||||
IsVisible="{TemplateBinding ShowButtonSpinner}">
|
||||
<Path Data="M 0,0 L 4,4 L 8,0" Stroke="{StaticResource CarbonFgDim}"
|
||||
StrokeThickness="1.4" />
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DataValidationErrors>
|
||||
<!-- The spinner draws the frame, the text box sits inside it
|
||||
borderless - same shape as a combo box. -->
|
||||
<ButtonSpinner Name="PART_Spinner"
|
||||
MinHeight="{StaticResource CarbonControlHeight}"
|
||||
Padding="0"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{StaticResource CarbonBorderLight}"
|
||||
Background="{StaticResource CarbonInputBg}"
|
||||
CornerRadius="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
AllowSpin="{TemplateBinding AllowSpin}"
|
||||
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
|
||||
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}">
|
||||
<TextBox Name="PART_TextBox"
|
||||
MinHeight="0"
|
||||
Padding="6,0"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||
Watermark="{TemplateBinding Watermark}"
|
||||
IsReadOnly="{TemplateBinding IsReadOnly}"
|
||||
AcceptsReturn="False"
|
||||
TextWrapping="NoWrap" />
|
||||
</ButtonSpinner>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="NavTab" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFgDim}" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="MinWidth" Value="150" />
|
||||
<Setter Property="MinHeight" Value="50" />
|
||||
<Setter Property="MinHeight" Value="44" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
@@ -80,9 +236,9 @@
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
<ControlTheme x:Key="{x:Type TabItem}" TargetType="TabItem">
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="MinHeight" Value="26" />
|
||||
<Setter Property="Padding" Value="14,4" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="MinHeight" Value="22" />
|
||||
<Setter Property="Padding" Value="14,2" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFgDim}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
@@ -128,7 +284,7 @@
|
||||
<Setter Property="Background" Value="{StaticResource CarbonAppBg}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFg}" />
|
||||
<Setter Property="FontFamily" Value="Tahoma, Segoe UI, Inter" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="TabControl">
|
||||
@@ -137,50 +293,43 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="MinHeight" Value="24" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="MinHeight" Value="{StaticResource CarbonControlHeight}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Padding" Value="8,1" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="MinHeight" Value="24" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="MinHeight" Value="{StaticResource CarbonControlHeight}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Padding" Value="6,1" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
</Style>
|
||||
<Style Selector="NumericUpDown">
|
||||
<Setter Property="MinHeight" Value="26" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
</Style>
|
||||
<!-- Fluent gives the spinner and the check controls a 32 px floor of their own,
|
||||
inside the template, so setting MinHeight on the control alone does nothing. -->
|
||||
<!-- Height comes from the templated TextBox, like every other input. -->
|
||||
<Style Selector="Button">
|
||||
<Setter Property="MinHeight" Value="25" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Padding" Value="10,2" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
</Style>
|
||||
<Style Selector="CheckBox">
|
||||
<Setter Property="MinHeight" Value="17" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
</Style>
|
||||
|
||||
<!-- Checklist rows only sit tighter; the size comes from the theme above. -->
|
||||
<Style Selector="CheckBox.Checklist">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Height" Value="26" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Padding" Value="6,0,0,0" />
|
||||
</Style>
|
||||
<Style Selector="CheckBox.Checklist /template/ Grid">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Margin" Value="0,1" />
|
||||
</Style>
|
||||
<Style Selector="CheckBox /template/ ContentPresenter">
|
||||
<Setter Property="TextBlock.TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="MinHeight" Value="17" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Style>
|
||||
<Style Selector="RadioButton /template/ Grid:not(#RootGrid)">
|
||||
<Setter Property="Height" Value="20" />
|
||||
</Style>
|
||||
<Style Selector="Label">
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Padding" Value="0,2" />
|
||||
</Style>
|
||||
|
||||
@@ -235,6 +384,33 @@
|
||||
<Setter Property="TextBlock.Foreground" Value="{StaticResource CarbonFg}" />
|
||||
</Style>
|
||||
|
||||
<!-- Secondary button: says "this is here, but it is not the main move". Used for
|
||||
actions whose scope is wider than the thing you have selected. The state rules
|
||||
have to target the presenter, not the button - Fluent paints PART_ContentPresenter
|
||||
on hover/press/disable and would otherwise fill an outline button solid. That is
|
||||
why Accent and Basic are written this way too, while Flat gets away with setting
|
||||
Background on the control itself. -->
|
||||
<Style Selector="Button.Outline">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonBorderLight}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="2" />
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFgDim}" />
|
||||
</Style>
|
||||
<Style Selector="Button.Outline /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="Button.Outline:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonHoverBg}" />
|
||||
<Setter Property="TextBlock.Foreground" Value="{StaticResource CarbonFg}" />
|
||||
</Style>
|
||||
<Style Selector="Button.Outline:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonInputBg}" />
|
||||
</Style>
|
||||
<Style Selector="Button.Outline:disabled /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="StackPanel.Field">
|
||||
<Setter Property="Spacing" Value="2" />
|
||||
</Style>
|
||||
@@ -244,8 +420,10 @@
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<!-- Accent is reserved for interactive state (checked box, slider fill,
|
||||
selected category, primary button). Read-outs are plain foreground. -->
|
||||
<Style Selector="TextBlock.FieldValue">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonAccentBright}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFg}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
@@ -254,7 +432,7 @@
|
||||
</Style>
|
||||
<Style Selector="TextBlock.FieldHint">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFgDim}" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="FontStyle" Value="Italic" />
|
||||
</Style>
|
||||
<Style Selector="Separator">
|
||||
@@ -290,15 +468,47 @@
|
||||
<Style Selector="ListBox.Compact ListBoxItem">
|
||||
<Setter Property="Padding" Value="4,0" />
|
||||
<Setter Property="MinHeight" Value="17" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="TreeView.Compact TreeViewItem">
|
||||
<Setter Property="MinHeight" Value="19" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Style>
|
||||
<Style Selector="TreeView.Compact TreeViewItem /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="MinHeight" Value="19" />
|
||||
<Setter Property="Padding" Value="3,0" />
|
||||
</Style>
|
||||
|
||||
<!-- Keyboard focus. The default theme leaves the ring almost invisible on this
|
||||
palette, so everything that can take focus gets the same bright outline; the
|
||||
consist cards paint it as a box shadow because their border already carries
|
||||
the selection colour. -->
|
||||
<Style Selector=":is(Button):focus-visible /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
</Style>
|
||||
<Style Selector="CheckBox:focus-visible /template/ Border#NormalRectangle">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
</Style>
|
||||
<Style Selector="TextBox:focus /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
</Style>
|
||||
<Style Selector="ComboBox:focus-visible /template/ Border#Background">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
</Style>
|
||||
<Style Selector="TabItem:focus-visible">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonAccentBright}" />
|
||||
</Style>
|
||||
<Style Selector="ListBoxItem:focus-visible /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
</Style>
|
||||
<Style Selector="TreeViewItem:focus-visible /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
</Style>
|
||||
<Style Selector="Border.ConsistCard:focus">
|
||||
<Setter Property="BoxShadow" Value="0 0 0 2 #41c400" />
|
||||
</Style>
|
||||
</Styles>
|
||||
|
||||
262
StarterNG/Styles/Settings.axaml
Normal file
262
StarterNG/Styles/Settings.axaml
Normal file
@@ -0,0 +1,262 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ctl="clr-namespace:StarterNG.Controls">
|
||||
<Styles.Resources>
|
||||
|
||||
<!-- One setting: [ label | control | value ] with the description on a
|
||||
second line spanning the whole row. Empty parts collapse, driven by
|
||||
the pseudo-classes SettingRow sets. -->
|
||||
<ControlTheme x:Key="{x:Type ctl:SettingRow}" TargetType="ctl:SettingRow">
|
||||
<Setter Property="Margin" Value="0,0,0,11" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid RowDefinitions="Auto,Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<!-- Every row is its own Grid, so the label column only
|
||||
lines up across rows when a shared-size scope makes
|
||||
them negotiate one width. The group is inert unless
|
||||
an ancestor declares Grid.IsSharedSizeScope, which is
|
||||
why this is safe to leave on for the settings page:
|
||||
there the pin on PART_Label below fixes the width
|
||||
instead. -->
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="SettingRowLabel" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="PART_Label"
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
Text="{TemplateBinding Label}"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource CarbonFg}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Center"
|
||||
MinWidth="286" MaxWidth="286"
|
||||
Margin="0,0,14,0" />
|
||||
|
||||
<ContentPresenter Name="PART_Content"
|
||||
Grid.Row="0" Grid.Column="1"
|
||||
Content="{TemplateBinding Content}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<TextBlock Name="PART_Value"
|
||||
Grid.Row="0" Grid.Column="2"
|
||||
Text="{TemplateBinding ValueText}"
|
||||
FontSize="12"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource CarbonFg}"
|
||||
MinWidth="72"
|
||||
TextAlignment="Right"
|
||||
TextWrapping="NoWrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,0,0" />
|
||||
|
||||
<TextBlock Name="PART_Description"
|
||||
Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Text="{TemplateBinding Description}"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource CarbonFgDim}"
|
||||
TextWrapping="Wrap"
|
||||
Margin="0,3,0,0" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:no-description /template/ TextBlock#PART_Description">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:no-value /template/ TextBlock#PART_Value">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:no-label /template/ TextBlock#PART_Label">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:no-content /template/ TextBlock#PART_Value">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
</Style>
|
||||
<!-- A checkbox is its own label, so let it take the label column too.
|
||||
Alignment stays Stretch: a bare slider in a labelless row still
|
||||
wants the full width. -->
|
||||
<Style Selector="^:no-label /template/ ContentPresenter#PART_Content">
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- Flat section: title, accent rule, content. No border, no filled header. -->
|
||||
<ControlTheme x:Key="{x:Type ctl:SettingsSection}" TargetType="ctl:SettingsSection">
|
||||
<Setter Property="Margin" Value="0,0,0,24" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<StackPanel>
|
||||
<DockPanel LastChildFill="True">
|
||||
<ContentPresenter DockPanel.Dock="Right"
|
||||
Content="{TemplateBinding Toggle}"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Text="{TemplateBinding Header}"
|
||||
FontSize="12"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource CarbonFg}"
|
||||
VerticalAlignment="Center" />
|
||||
</DockPanel>
|
||||
|
||||
<Grid Name="PART_Rule" ColumnDefinitions="28,*" Height="1" Margin="0,6,0,0">
|
||||
<Border Grid.Column="0" Background="{StaticResource CarbonAccentBright}" />
|
||||
<Border Grid.Column="1" Background="{StaticResource CarbonBorderLight}" />
|
||||
</Grid>
|
||||
|
||||
<ContentPresenter Name="PART_Content"
|
||||
Content="{TemplateBinding Content}"
|
||||
Margin="0,14,0,0" />
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- Category list on the left of the settings panel. -->
|
||||
<ControlTheme x:Key="SettingsNavItem" TargetType="ListBoxItem">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFgDim}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Padding" Value="12,7" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Name="root"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="3,0,0,0">
|
||||
<ContentPresenter Content="{TemplateBinding Content}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ Border#root">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonHoverBg}" />
|
||||
</Style>
|
||||
<Style Selector="^:selected /template/ Border#root">
|
||||
<Setter Property="Background" Value="{StaticResource CarbonHoverBg}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
|
||||
</Style>
|
||||
<Style Selector="^:selected">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonFg}" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
</Styles.Resources>
|
||||
|
||||
<!-- Dimmed while a search finds nothing in this category. Still clickable:
|
||||
selecting it clears the search and opens the category. -->
|
||||
<Style Selector="ListBoxItem.NoHits">
|
||||
<Setter Property="Opacity" Value="0.3" />
|
||||
</Style>
|
||||
|
||||
<!-- Names the category above stacked search results. -->
|
||||
<Style Selector="TextBlock.CategoryCaption">
|
||||
<Setter Property="Foreground" Value="{StaticResource CarbonAccentBright}" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="Margin" Value="0,0,0,8" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="ListBox.SettingsNav">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
</Style>
|
||||
|
||||
<!-- Controls inside a row: keep them from stretching to absurd widths in the
|
||||
single-column layout, and give the row a predictable height. -->
|
||||
<Style Selector="ctl|SettingRow:not(.Compact) > ComboBox">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MaxWidth" Value="360" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow:not(.Compact) > NumericUpDown">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="Width" Value="140" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow:not(.Compact) > Slider">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow:not(.Compact) > CheckBox">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow:not(.Compact) > Button">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="MinWidth" Value="180" />
|
||||
</Style>
|
||||
|
||||
<!-- Compact variant. The depot's detail panels are 250-390 px wide, where the
|
||||
settings page's rigid 300 px label column and 72 px value slot do not fit.
|
||||
Releasing the pin lets the shared-size group do its job: the column hugs the
|
||||
longest label in whichever panel it lands in, so no pixel count is picked
|
||||
here and it follows the translation. -->
|
||||
<Style Selector="ctl|SettingRow.Compact">
|
||||
<Setter Property="Margin" Value="0,0,0,5" />
|
||||
</Style>
|
||||
<!-- Right-aligned: an Auto column hugs the longest label, so anything shorter
|
||||
would otherwise hang in space away from its own control. MaxWidth stops one
|
||||
long translation from eating the panel - the label already wraps. -->
|
||||
<Style Selector="ctl|SettingRow.Compact /template/ TextBlock#PART_Label">
|
||||
<Setter Property="MinWidth" Value="96" />
|
||||
<Setter Property="MaxWidth" Value="170" />
|
||||
<Setter Property="TextAlignment" Value="Right" />
|
||||
<Setter Property="Margin" Value="0,0,10,0" />
|
||||
</Style>
|
||||
<!-- Reserved, not collapsed: keeping the unit gutter on every row means the
|
||||
controls share one right edge, and nothing shifts sideways when the unit
|
||||
disappears in pantograph mode. IsVisible deliberately overrides the theme's
|
||||
:no-value setter, which a file-level style is allowed to do. -->
|
||||
<Style Selector="ctl|SettingRow.Compact /template/ TextBlock#PART_Value">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
<Setter Property="MinWidth" Value="26" />
|
||||
<Setter Property="Margin" Value="6,0,0,0" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow.Compact /template/ TextBlock#PART_Description">
|
||||
<Setter Property="Margin" Value="0,2,0,0" />
|
||||
</Style>
|
||||
<!-- A checkbox lines up with the other controls here rather than escaping to the
|
||||
left edge the way it does on the wide settings page: in a narrow column the
|
||||
label edge reads as a rule, and a stray checkbox breaks it. Keeping the
|
||||
content out of column 0 also keeps a spanning child away from the
|
||||
shared-size column, which spares us the question of how the two interact. -->
|
||||
<Style Selector="ctl|SettingRow.Compact:no-label /template/ ContentPresenter#PART_Content">
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="ctl|SettingRow.Compact > ComboBox">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow.Compact > NumericUpDown">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow.Compact > CheckBox">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow.Compact > Button">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow.Compact > StackPanel">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingRow.Compact > Grid">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="ctl|SettingsSection.Compact">
|
||||
<Setter Property="Margin" Value="0,0,0,9" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingsSection.Compact /template/ ContentPresenter#PART_Content">
|
||||
<Setter Property="Margin" Value="0,6,0,0" />
|
||||
</Style>
|
||||
<Style Selector="ctl|SettingsSection.Compact /template/ Grid#PART_Rule">
|
||||
<Setter Property="Margin" Value="0,4,0,0" />
|
||||
</Style>
|
||||
</Styles>
|
||||
Reference in New Issue
Block a user