WIP: settings sections, shortcuts window, depot tweaks

This commit is contained in:
maj00r
2026-09-04 20:40:47 +02:00
parent bcf266a167
commit aef086e9f0
35 changed files with 2945 additions and 1104 deletions

View File

@@ -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>