Rebuild the settings page

A sticky quality bar, a level and a reset per section, key bindings in their
own tab. UART moves into the page. A log and tools window replaces
AdvancedSettingsWindow, and the developer tab is gone.
This commit is contained in:
maj00r
2026-11-01 16:06:16 +01:00
parent 3b21583b53
commit f152a020e3
19 changed files with 2817 additions and 1570 deletions

View File

@@ -20,6 +20,12 @@
<SolidColorBrush x:Key="CarbonBorderDark" Color="#0E0F12" />
<SolidColorBrush x:Key="CarbonFg" Color="#E6E8EA" />
<SolidColorBrush x:Key="CarbonFgDim" Color="#9098A0" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#9098A0" />
<SolidColorBrush x:Key="TextControlPlaceholderForegroundPointerOver" Color="#9098A0" />
<SolidColorBrush x:Key="TextControlPlaceholderForegroundFocused" Color="#9098A0" />
<SolidColorBrush x:Key="ComboBoxPlaceHolderForeground" Color="#9098A0" />
<SolidColorBrush x:Key="ComboBoxPlaceHolderForegroundPointerOver" Color="#9098A0" />
<SolidColorBrush x:Key="ComboBoxPlaceHolderForegroundFocused" Color="#9098A0" />
<SolidColorBrush x:Key="CarbonAccent" Color="#177f00" />
<SolidColorBrush x:Key="CarbonAccentHover" Color="#41c400" />
<SolidColorBrush x:Key="CarbonAccentBright" Color="#41c400" />
@@ -43,6 +49,7 @@
VerticalAlignment="Center" />
<TextBlock Text="{TemplateBinding Header}"
FontWeight="SemiBold"
TextTrimming="CharacterEllipsis"
VerticalAlignment="Center"
Foreground="{StaticResource CarbonFg}" />
</DockPanel>
@@ -325,9 +332,6 @@
<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="12" />
<Setter Property="Padding" Value="0,2" />
@@ -491,6 +495,11 @@
<Style Selector="CheckBox:focus-visible /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
</Style>
<!-- The condition is what lets this win: the theme sets the half opacity in its template. -->
<Style Selector="TextBox:not(:disabled) /template/ TextBlock#PART_Placeholder">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="TextBox:focus /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{StaticResource CarbonAccentBright}" />
</Style>

View File

@@ -11,7 +11,7 @@
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Template">
<ControlTemplate>
<Grid RowDefinitions="Auto,Auto">
<Grid RowDefinitions="Auto,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
@@ -79,6 +79,18 @@
TextWrapping="Wrap"
Margin="0,3,0,0" />
<!-- Why the chosen simulator would ignore the setting. Under
the explanation, at full strength while the rest dims. -->
<TextBlock Name="PART_IdleNote"
Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
Text="{TemplateBinding IdleNote}"
IsVisible="False"
FontSize="12"
FontStyle="Italic"
Foreground="{StaticResource CarbonFg}"
TextWrapping="Wrap"
Margin="0,3,0,0" />
</Grid>
</ControlTemplate>
</Setter>
@@ -99,6 +111,24 @@
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Grid.ColumnSpan" Value="2" />
</Style>
<Style Selector="^:idle /template/ TextBlock#PART_IdleNote">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:idle /template/ TextBlock#PART_Label">
<Setter Property="Opacity" Value="0.45" />
</Style>
<Style Selector="^:idle /template/ ContentPresenter#PART_Content">
<Setter Property="Opacity" Value="0.45" />
</Style>
<Style Selector="^:idle /template/ TextBlock#PART_Value">
<Setter Property="Opacity" Value="0.45" />
</Style>
<Style Selector="^:idle /template/ TextBlock#PART_Description">
<Setter Property="Opacity" Value="0.45" />
</Style>
<Style Selector="^:idle /template/ SelectableTextBlock#PART_ConfigKey">
<Setter Property="Opacity" Value="0.45" />
</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. -->
@@ -118,6 +148,13 @@
<ContentPresenter DockPanel.Dock="Right"
Content="{TemplateBinding Toggle}"
VerticalAlignment="Center" />
<Button Name="PART_Reset" DockPanel.Dock="Right" Classes="Outline SectionReset"
Content="{TemplateBinding ResetLabel}"
IsVisible="{Binding $parent[ctl:SettingsSection].ResetLabel, Converter={x:Static ObjectConverters.IsNotNull}}"
VerticalAlignment="Center" Margin="0,0,12,0" />
<ContentPresenter DockPanel.Dock="Right"
Content="{TemplateBinding Level}"
VerticalAlignment="Center" />
<TextBlock Text="{TemplateBinding Header}"
FontSize="12"
FontWeight="SemiBold"
@@ -194,8 +231,27 @@
<!-- 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" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Width" Value="360" />
</Style>
<!-- The same width for a list that has a warning under it. -->
<Style Selector="ctl|SettingRow:not(.Compact) > StackPanel.Field">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Width" Value="360" />
</Style>
<!-- The key of the row above holds for this one too. -->
<Style Selector="ctl|SettingRow.KeyAbove /template/ SelectableTextBlock#PART_ConfigKey">
<Setter Property="IsVisible" Value="False" />
</Style>
<!-- Content of several rows: the label and its key stay together at the first. -->
<Style Selector="ctl|SettingRow.TopLabel /template/ TextBlock#PART_Label">
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Margin" Value="0,2,14,0" />
</Style>
<Style Selector="ctl|SettingRow.TopLabel /template/ SelectableTextBlock#PART_ConfigKey">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Margin" Value="0,21,14,0" />
</Style>
<Style Selector="ctl|SettingRow:not(.Compact) > NumericUpDown">
<Setter Property="HorizontalAlignment" Value="Left" />
@@ -276,6 +332,23 @@
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
<!-- The header's "back to defaults": quiet until pointed at. -->
<!-- An Outline button, only smaller: without the frame it read as a caption. -->
<Style Selector="Button.SectionReset">
<Setter Property="Padding" Value="8,2" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="FontSize" Value="11" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="ComboBox.SectionLevel">
<Setter Property="MinHeight" Value="0" />
<Setter Property="MinWidth" Value="118" />
<Setter Property="Padding" Value="8,1" />
<Setter Property="FontSize" Value="11" />
<Setter Property="Margin" Value="0,0,8,0" />
</Style>
<Style Selector="ctl|SettingsSection.Compact">
<Setter Property="Margin" Value="0,0,0,9" />
</Style>