a1a72aae49
The per-CPU cells in the Advanced Affinity Picker were rendered as CheckBoxes while being Mode=OneWay and IsHitTestVisible="False", so users tried to click them and concluded the affinity feature was broken. They are now Border chips with no tick box, no hover and no focus, using the same brushes the Masks tab uses for its editable CPU tiles. The CheckBox carried a CheckBoxAutomationPeer even when non-interactive, so the chip publishes an accessible name and reports selected, not selected, or unavailable through AutomationProperties.ItemStatus rather than losing that state to a bare Border. The system tweaks list used ui:ToggleSwitch, which renders 40x20 with no label and reads as decoration on a dense list. It is replaced by a labelled pill that states ON or OFF inside the track. Thumb and label are docked rather than stacked and the track uses MinWidth, so a longer localized label (ru "ВЫКЛ") widens the pill instead of sliding under the thumb; the thumb rests on a DockPanel.Dock setter rather than a storyboard, so a toggle that starts checked draws correctly instead of waiting for an animation to finish. Also corrects the read-only hint, which still called the chips checkboxes, in all seven locales, and bumps the version to 1.7.1 across the csproj, app manifest, both Inno scripts, the WiX definition, the Chocolatey nuspec, the build scripts, sonar properties, and the packaging metadata test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhS1xyuMPFvxrojERQ4NuY
254 lines
15 KiB
XML
254 lines
15 KiB
XML
<UserControl x:Class="ThreadPilot.Views.SystemTweaksView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="600" d:DesignWidth="800">
|
|
|
|
<UserControl.Resources>
|
|
<!-- Larger, labelled pill toggle. The native ui:ToggleSwitch is 40x20 with no text,
|
|
which reads as a decoration rather than a switch on this dense list. -->
|
|
<Style x:Key="PillToggleButtonStyle" TargetType="ToggleButton">
|
|
<Setter Property="MinWidth" Value="56"/>
|
|
<Setter Property="Height" Value="28"/>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="HorizontalAlignment" Value="Right"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Border x:Name="Track"
|
|
Background="{DynamicResource ControlFillColorSecondaryBrush}"
|
|
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="14"
|
|
Padding="3"
|
|
SnapsToDevicePixels="True">
|
|
<!-- Thumb and label are docked, never stacked, so a long localized
|
|
label (ru "ВЫКЛ") pushes the pill wider instead of colliding with
|
|
the thumb. MinWidth keeps the common case at the intended size. -->
|
|
<DockPanel LastChildFill="True">
|
|
<Ellipse x:Name="Thumb"
|
|
DockPanel.Dock="Left"
|
|
Width="20"
|
|
Height="20"
|
|
Fill="{DynamicResource TextSecondaryBrush}"/>
|
|
<TextBlock x:Name="StateLabel"
|
|
Text="{DynamicResource SystemTweaks_ToggleOff}"
|
|
FontSize="10"
|
|
FontWeight="SemiBold"
|
|
VerticalAlignment="Center"
|
|
TextAlignment="Center"
|
|
Margin="3,0,4,0"
|
|
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
|
</DockPanel>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="Track" Property="Background" Value="{DynamicResource AccentFillColorDefaultBrush}"/>
|
|
<Setter TargetName="Track" Property="BorderBrush" Value="{DynamicResource AccentFillColorDefaultBrush}"/>
|
|
<Setter TargetName="Thumb" Property="DockPanel.Dock" Value="Right"/>
|
|
<Setter TargetName="Thumb" Property="Fill" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}"/>
|
|
<Setter TargetName="StateLabel" Property="Text" Value="{DynamicResource SystemTweaks_ToggleOn}"/>
|
|
<Setter TargetName="StateLabel" Property="Margin" Value="4,0,3,0"/>
|
|
<Setter TargetName="StateLabel" Property="Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}"/>
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Track" Property="BorderBrush" Value="{DynamicResource SoftSelectionBorderBrush}"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter TargetName="Track" Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}"/>
|
|
<Setter TargetName="Track" Property="BorderBrush" Value="{DynamicResource BorderSubtleBrush}"/>
|
|
<Setter TargetName="Track" Property="Opacity" Value="0.6"/>
|
|
<Setter TargetName="Thumb" Property="Fill" Value="{DynamicResource TextSecondaryBrush}"/>
|
|
<Setter TargetName="StateLabel" Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Header and Controls -->
|
|
<Border Grid.Row="0"
|
|
Style="{StaticResource StandardCardStyle}"
|
|
Margin="0,0,0,16">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Description and Refresh Button -->
|
|
<Grid Grid.Row="0" Margin="0,10,0,10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="{DynamicResource SystemTweaksView_Title}"
|
|
Style="{StaticResource PageTitleTextStyle}"
|
|
Margin="0,0,0,4"/>
|
|
<TextBlock Text="{DynamicResource SystemTweaksView_Subtitle}"
|
|
Style="{StaticResource PageSubtitleTextStyle}"/>
|
|
</StackPanel>
|
|
|
|
<Button Grid.Column="1"
|
|
Content="{DynamicResource SystemTweaksView_RefreshAll}"
|
|
Command="{Binding RefreshAllTweaksCommand}"
|
|
Padding="12,6"
|
|
ToolTip="{DynamicResource SystemTweaksView_RefreshAllTooltip}"
|
|
IsEnabled="{Binding IsRefreshing, Converter={StaticResource InverseBooleanConverter}}"/>
|
|
</Grid>
|
|
|
|
<!-- Status Bar -->
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Grid.Column="0"
|
|
Text="{DynamicResource SystemTweaksView_Status}"
|
|
FontWeight="SemiBold"
|
|
VerticalAlignment="Center"/>
|
|
|
|
<TextBlock Grid.Column="1"
|
|
Text="{Binding RefreshStatusText}"
|
|
Foreground="{DynamicResource TextSecondaryBrush}"
|
|
Margin="10,0"
|
|
VerticalAlignment="Center"/>
|
|
|
|
<ProgressBar Grid.Column="2"
|
|
Width="100"
|
|
Height="4"
|
|
IsIndeterminate="{Binding IsRefreshing}"
|
|
Visibility="{Binding IsRefreshing, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- Tweaks List -->
|
|
<ScrollViewer Grid.Row="1"
|
|
VerticalScrollBarVisibility="Auto"
|
|
HorizontalScrollBarVisibility="Disabled">
|
|
<ItemsControl ItemsSource="{Binding TweakItems}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<UniformGrid Columns="2"/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<GroupBox Margin="0,0,12,12" Padding="{DynamicResource CompactCardPadding}">
|
|
<GroupBox.Header>
|
|
<TextBlock Text="{Binding Name}"
|
|
FontSize="14"
|
|
FontWeight="SemiBold"
|
|
Foreground="{DynamicResource TextPrimaryBrush}"/>
|
|
</GroupBox.Header>
|
|
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding Description}"
|
|
FontSize="11"
|
|
Foreground="{DynamicResource TextSecondaryBrush}"
|
|
TextWrapping="Wrap"
|
|
Margin="0,0,0,8"/>
|
|
|
|
<Grid Margin="0,0,0,5">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<Ellipse Width="8" Height="8"
|
|
VerticalAlignment="Center"
|
|
Margin="0,0,8,0">
|
|
<Ellipse.Style>
|
|
<Style TargetType="Ellipse">
|
|
<Setter Property="Fill" Value="{DynamicResource SuccessTextBrush}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsAvailable}" Value="False">
|
|
<Setter Property="Fill" Value="{DynamicResource ErrorTextBrush}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
|
|
<Setter Property="Fill" Value="{DynamicResource TextSecondaryBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
|
|
<TextBlock Text="{Binding StatusText}"
|
|
FontSize="11"
|
|
Foreground="{DynamicResource TextSecondaryBrush}"
|
|
VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<ToggleButton Grid.Column="1"
|
|
IsChecked="{Binding IsEnabled, Mode=OneWay}"
|
|
IsEnabled="{Binding IsAvailable}"
|
|
Command="{Binding ToggleCommand}"
|
|
CommandParameter="{Binding}"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"
|
|
Margin="10,0,0,0"
|
|
AutomationProperties.Name="{Binding Name}"
|
|
ToolTip="{DynamicResource SystemTweaksView_TweakTooltip}">
|
|
<ToggleButton.Style>
|
|
<Style TargetType="ToggleButton" BasedOn="{StaticResource PillToggleButtonStyle}">
|
|
<Setter Property="Visibility" Value="Visible"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsGuidedAction}" Value="True">
|
|
<Setter Property="Visibility" Value="Collapsed"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
|
|
<Button Grid.Column="1"
|
|
Content="{DynamicResource SystemTweaks_OpenSettings}"
|
|
Command="{Binding ActionCommand}"
|
|
CommandParameter="{Binding}"
|
|
IsEnabled="{Binding IsAvailable}"
|
|
Padding="10,4"
|
|
AutomationProperties.Name="{Binding Name}">
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Setter Property="Visibility" Value="Collapsed"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsGuidedAction}" Value="True">
|
|
<Setter Property="Visibility" Value="Visible"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
</Grid>
|
|
|
|
<TextBlock Text="{Binding ErrorMessage}"
|
|
FontSize="11"
|
|
Foreground="{DynamicResource ErrorTextBrush}"
|
|
TextWrapping="Wrap"
|
|
Visibility="{Binding ErrorMessage, Converter={StaticResource StringToVisibilityConverter}}"/>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</UserControl>
|