added interface themes

This commit is contained in:
2026-08-09 00:09:47 +05:00
parent 8a19cb6a9c
commit b581d560b0
16 changed files with 607 additions and 19 deletions
+294
View File
@@ -0,0 +1,294 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- ======================= GroupBox ======================= -->
<Style TargetType="GroupBox">
<Setter Property="Padding" Value="12" />
<Setter Property="Margin" Value="0,0,0,12" />
<Setter Property="Foreground" Value="{DynamicResource Theme.Foreground}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupBox">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter ContentSource="Header"
Margin="2,0,0,6"
TextBlock.FontWeight="SemiBold" />
<Border Grid.Row="1"
Background="{DynamicResource Theme.Surface}"
BorderBrush="{DynamicResource Theme.ControlBorder}"
BorderThickness="1"
CornerRadius="6"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter />
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ======================= ComboBox ======================= -->
<Style x:Key="ComboBoxToggleStyle" TargetType="ToggleButton">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="ClickMode" Value="Press" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Border"
Background="{DynamicResource Theme.ControlBackground}"
BorderBrush="{DynamicResource Theme.ControlBorder}"
BorderThickness="1"
CornerRadius="4"
SnapsToDevicePixels="True">
<Path x:Name="Arrow"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,10,0"
Data="M0,0 L4,4 L8,0"
Stroke="{DynamicResource Theme.SecondaryForeground}"
StrokeThickness="1.4" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background"
Value="{DynamicResource Theme.ControlHoverBackground}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Border" Property="BorderBrush"
Value="{DynamicResource Theme.Accent}" />
<Setter TargetName="Arrow" Property="Stroke"
Value="{DynamicResource Theme.Accent}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Opacity" Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBoxItem">
<Setter Property="Foreground" Value="{DynamicResource Theme.Foreground}" />
<Setter Property="Padding" Value="8,5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Border"
Background="Transparent"
CornerRadius="3"
Margin="3,1"
Padding="{TemplateBinding Padding}">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Border" Property="Background"
Value="{DynamicResource Theme.SelectionBackground}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background"
Value="{DynamicResource Theme.SelectionBackground}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{DynamicResource Theme.Foreground}" />
<!-- Правый отступ оставляет место под стрелку -->
<Setter Property="Padding" Value="9,5,28,5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton Style="{StaticResource ComboBoxToggleStyle}"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay,
RelativeSource={RelativeSource TemplatedParent}}" />
<ContentPresenter Margin="{TemplateBinding Padding}"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
HorizontalAlignment="Left" VerticalAlignment="Center"
IsHitTestVisible="False" />
<Popup x:Name="PART_Popup"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Fade">
<Border Background="{DynamicResource Theme.PopupBackground}"
BorderBrush="{DynamicResource Theme.ControlBorder}"
BorderThickness="1"
CornerRadius="4"
Margin="0,2,0,0"
MinWidth="{Binding ActualWidth,
RelativeSource={RelativeSource TemplatedParent}}"
MaxHeight="{TemplateBinding MaxDropDownHeight}">
<ScrollViewer>
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ======================= Slider ======================= -->
<Style x:Key="SliderThumbStyle" TargetType="Thumb">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Width" Value="14" />
<Setter Property="Height" Value="14" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Ellipse x:Name="Circle"
Fill="{DynamicResource Theme.Accent}"
Stroke="{DynamicResource Theme.ControlBackground}"
StrokeThickness="2" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Circle" Property="StrokeThickness" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Пройденная часть шкалы: закрашивается акцентом -->
<Style x:Key="SliderDecreaseStyle" TargetType="RepeatButton">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Height="4" CornerRadius="2"
VerticalAlignment="Center"
Background="{DynamicResource Theme.Accent}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TransparentRepeatStyle" TargetType="RepeatButton">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Slider">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="IsSnapToTickEnabled" Value="True" />
<Setter Property="MinHeight" Value="24" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Slider">
<Grid Background="Transparent">
<Border Height="4" CornerRadius="2"
VerticalAlignment="Center"
Background="{DynamicResource Theme.SliderTrack}" />
<Track x:Name="PART_Track">
<Track.DecreaseRepeatButton>
<RepeatButton Command="Slider.DecreaseLarge"
Style="{StaticResource SliderDecreaseStyle}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource SliderThumbStyle}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="Slider.IncreaseLarge"
Style="{StaticResource TransparentRepeatStyle}" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ======================= ScrollBar ======================= -->
<Style x:Key="ScrollBarThumbStyle" TargetType="Thumb">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Border Background="{DynamicResource Theme.ScrollBarThumb}"
CornerRadius="3" Margin="3" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ScrollBar">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Width" Value="12" />
<Setter Property="MinWidth" Value="12" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar">
<Grid Background="{TemplateBinding Background}">
<Track x:Name="PART_Track"
Orientation="{TemplateBinding Orientation}"
IsDirectionReversed="True">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageUpCommand"
Style="{StaticResource TransparentRepeatStyle}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollBarThumbStyle}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageDownCommand"
Style="{StaticResource TransparentRepeatStyle}" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
<ControlTemplate.Triggers>
<!-- У горизонтальной полосы направление трека обычное -->
<Trigger Property="Orientation" Value="Horizontal">
<Setter TargetName="PART_Track" Property="IsDirectionReversed" Value="False" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Height" Value="12" />
<Setter Property="MinHeight" Value="12" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
+21
View File
@@ -0,0 +1,21 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Theme.WindowBackground" Color="#1E1E21" />
<SolidColorBrush x:Key="Theme.Foreground" Color="#E8E8EA" />
<SolidColorBrush x:Key="Theme.SecondaryForeground" Color="#9A9AA2" />
<SolidColorBrush x:Key="Theme.Surface" Color="#26262A" />
<SolidColorBrush x:Key="Theme.SurfaceStrong" Color="#303036" />
<SolidColorBrush x:Key="Theme.ControlBackground" Color="#2C2C31" />
<SolidColorBrush x:Key="Theme.ControlHoverBackground" Color="#38383E" />
<SolidColorBrush x:Key="Theme.ControlBorder" Color="#46464C" />
<SolidColorBrush x:Key="Theme.PopupBackground" Color="#2A2A2F" />
<SolidColorBrush x:Key="Theme.SelectionBackground" Color="#3A4665" />
<SolidColorBrush x:Key="Theme.Accent" Color="#5B8CF7" />
<SolidColorBrush x:Key="Theme.SliderTrack" Color="#46464C" />
<SolidColorBrush x:Key="Theme.ScrollBarThumb" Color="#55555C" />
</ResourceDictionary>
+21
View File
@@ -0,0 +1,21 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Theme.WindowBackground" Color="#FFFFFF" />
<SolidColorBrush x:Key="Theme.Foreground" Color="#1B1B1F" />
<SolidColorBrush x:Key="Theme.SecondaryForeground" Color="#6B6B70" />
<SolidColorBrush x:Key="Theme.Surface" Color="#FAFAFB" />
<SolidColorBrush x:Key="Theme.SurfaceStrong" Color="#EFEFF1" />
<SolidColorBrush x:Key="Theme.ControlBackground" Color="#FFFFFF" />
<SolidColorBrush x:Key="Theme.ControlHoverBackground" Color="#F2F2F4" />
<SolidColorBrush x:Key="Theme.ControlBorder" Color="#D0D0D4" />
<SolidColorBrush x:Key="Theme.PopupBackground" Color="#FFFFFF" />
<SolidColorBrush x:Key="Theme.SelectionBackground" Color="#E4EBFB" />
<SolidColorBrush x:Key="Theme.Accent" Color="#2563EB" />
<SolidColorBrush x:Key="Theme.SliderTrack" Color="#DCDCE0" />
<SolidColorBrush x:Key="Theme.ScrollBarThumb" Color="#C2C2C7" />
</ResourceDictionary>