optimize<Theme>: rename brushes used by this app and re-design light-theme

This commit is contained in:
leo 2021-01-06 21:08:32 +08:00
parent f944ded171
commit f98b73eaea
52 changed files with 553 additions and 532 deletions

View file

@ -3,7 +3,7 @@
<!-- 无边框按钮(也是默认样式) -->
<Style x:Key="Style.Button" TargetType="{x:Type Button}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="Opacity" Value="0.9"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
@ -48,7 +48,7 @@
</Style>
<Style x:Key="Style.Button.AccentBordered" BasedOn="{StaticResource Style.Button}" TargetType="{x:Type Button}">
<Setter Property="Background" Value="{DynamicResource Brush.Accent1}"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.FG}"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="8,0"/>
</Style>

View file

@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type CheckBox}">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>

View file

@ -37,13 +37,13 @@
<ControlTemplate TargetType="{x:Type ComboBox}">
<Grid>
<ToggleButton x:Name="ToggleButton" BorderThickness="{TemplateBinding BorderThickness}" Template="{StaticResource Template.ComboBox.ToggleButton}" Grid.Column="2" Focusable="false" ClickMode="Press" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
<ContentPresenter x:Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Margin="3,3,23,3" VerticalAlignment="Center" HorizontalAlignment="Left" TextElement.Foreground="{DynamicResource Brush.FG}"/>
<ContentPresenter x:Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Margin="3,3,23,3" VerticalAlignment="Center" HorizontalAlignment="Left" TextElement.Foreground="{DynamicResource Brush.FG1}"/>
<TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" Template="{StaticResource Template.ComboBox.TextBox}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="3,3,23,3" Focusable="True" Background="Transparent" Visibility="Hidden" IsReadOnly="{TemplateBinding IsReadOnly}" />
<Popup x:Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Slide">
<Grid x:Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="DropDownBorder" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}" Background="{DynamicResource Brush.BG2}"/>
<Border x:Name="DropDownBorder" BorderThickness="1" BorderBrush="{DynamicResource Brush.Accent1}" Background="{DynamicResource Brush.Contents}"/>
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" TextElement.Foreground="{DynamicResource Brush.FG}"/>
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" TextElement.Foreground="{DynamicResource Brush.FG1}"/>
</ScrollViewer>
</Grid>
</Popup>

View file

@ -4,7 +4,7 @@
<Style TargetType="{x:Type MenuItem}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="MinHeight" Value="24"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
</Style>
@ -15,7 +15,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border Background="{DynamicResource Brush.BG1}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}">
<Border Background="{DynamicResource Brush.Popup}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}">
<StackPanel IsItemsHost="True" Margin="1" KeyboardNavigation.DirectionalNavigation="Cycle"/>
</Border>
</ControlTemplate>
@ -60,7 +60,7 @@
<ContentPresenter Name="HeadHost" Grid.Column="1" Margin="0,0,8,0" ContentSource="Header" VerticalAlignment="Center"/>
<Path Grid.Column="2" Width="8" Height="8" Style="{DynamicResource Style.Icon}" Data="M 0 0 L 0 7 L 4 3.5 Z"/>
<Popup Name="Popup" Placement="Right" HorizontalOffset="-2" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
<Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{DynamicResource Brush.BG1}" BorderBrush="{DynamicResource Brush.Border1}" BorderThickness="1">
<Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{DynamicResource Brush.Popup}" BorderBrush="{DynamicResource Brush.Border1}" BorderThickness="1">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
</ScrollViewer>

View file

@ -31,7 +31,7 @@
<Setter Property="AllowDrop" Value="False"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="TextElement.FontFamily" Value="Consolas"/>
<Setter Property="EnableColumnVirtualization" Value="True"/>
<Setter Property="EnableRowVirtualization" Value="True"/>

View file

@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Style.Label" TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
</Style>

View file

@ -4,7 +4,7 @@
<Setter Property="Width" Value="16"/>
<Setter Property="Height" Value="16"/>
<Setter Property="Stretch" Value="Uniform"/>
<Setter Property="Fill" Value="{DynamicResource Brush.FG}"/>
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>
@ -12,7 +12,7 @@
<Style x:Key="Style.WindowControlIcon" TargetType="{x:Type Path}">
<Setter Property="Stretch" Value="None"/>
<Setter Property="Fill" Value="{DynamicResource Brush.FG}"/>
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>

View file

@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type RadioButton}">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>

View file

@ -10,7 +10,7 @@
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="area" Property="Background" Value="{DynamicResource Brush.FG}" />
<Setter TargetName="area" Property="Background" Value="{DynamicResource Brush.FG1}" />
<Setter TargetName="area" Property="Opacity" Value=".08"/>
</Trigger>
</ControlTemplate.Triggers>

View file

@ -35,7 +35,7 @@
<ContentPresenter
x:Name="ContentSite"
VerticalAlignment="Center" HorizontalAlignment="Center"
TextElement.Foreground="{DynamicResource Brush.FG}"
TextElement.Foreground="{DynamicResource Brush.FG1}"
TextElement.FontWeight="Bold"
ContentSource="Header"
Margin="8,6"

View file

@ -78,8 +78,8 @@
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG}"/>
<Setter Property="CaretBrush" Value="{DynamicResource Brush.FG}"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="CaretBrush" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border1}"/>
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource Template.Validation.Error}"/>

View file

@ -1,18 +1,20 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Style.ToggleButton.Expender" TargetType="{x:Type ToggleButton}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent" Margin="4,0">
<Grid Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Path
x:Name="ExpanderIcon"
Grid.Column="0"
x:Name="ExpanderIcon"
Margin="4,0,0,0"
Width="10" Height="10"
Style="{DynamicResource Style.Icon}"
Data="{DynamicResource Icon.Down}"
@ -23,7 +25,7 @@
</Path.RenderTransform>
</Path>
<ContentPresenter Grid.Column="1"/>
<ContentPresenter Grid.Column="1" Margin="0,0,4,0"/>
</Grid>
<ControlTemplate.Triggers>
@ -99,7 +101,7 @@
<Setter TargetName="Icon" Property="Data" Value="{DynamicResource Icon.Vertical}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Icon" Property="Fill" Value="{DynamicResource Brush.Accent1}"/>
<Setter TargetName="Icon" Property="Fill" Value="{DynamicResource Brush.FG1}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@ -122,7 +124,7 @@
Width="12"
Style="{DynamicResource Style.Icon}"
Fill="Transparent"
Stroke="{DynamicResource Brush.FG}"
Stroke="{DynamicResource Brush.FG1}"
StrokeThickness=".4"
Data="{DynamicResource Icon.Tree}"/>
</Grid>
@ -152,7 +154,7 @@
Width="12"
Style="{DynamicResource Style.Icon}"
Fill="Transparent"
Stroke="{DynamicResource Brush.FG}"
Stroke="{DynamicResource Brush.FG1}"
StrokeThickness=".4"
Data="{DynamicResource Icon.SplitVertical}"/>
</Grid>

View file

@ -9,10 +9,10 @@
<Border
BorderThickness="1"
BorderBrush="{DynamicResource Brush.Border1}"
Background="{DynamicResource Brush.BG1}"
Background="{DynamicResource Brush.Popup}"
Width="Auto"
Height="Auto">
<ContentPresenter Margin="6,4" TextElement.Foreground="{DynamicResource Brush.FG}" HorizontalAlignment="Left" VerticalAlignment="Top" />
<ContentPresenter Margin="6,4" TextElement.Foreground="{DynamicResource Brush.FG1}" HorizontalAlignment="Left" VerticalAlignment="Top" />
</Border>
</ControlTemplate>
</Setter.Value>

View file

@ -12,7 +12,7 @@
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid Width="16" Height="16" Margin="1" Background="Transparent">
<Path x:Name="ExpandPath" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="1,1,1,1" Fill="{DynamicResource Brush.FG}" Data="M 4 0 L 8 4 L 4 8 Z"/>
<Path x:Name="ExpandPath" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="1,1,1,1" Fill="{DynamicResource Brush.FG1}" Data="M 4 0 L 8 4 L 4 8 Z"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">

View file

@ -1,18 +1,27 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Brush.BG1" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.BG2" Color="#FF1B1B1B"/>
<SolidColorBrush x:Key="Brush.BG3" Color="#FF202020"/>
<SolidColorBrush x:Key="Brush.BG4" Color="#FF303030"/>
<SolidColorBrush x:Key="Brush.BG5" Color="#FF505050"/>
<SolidColorBrush x:Key="Brush.BG6" Color="#FF404040"/>
<SolidColorBrush x:Key="Brush.BG7" Color="#FFFAFAD2"/>
<SolidColorBrush x:Key="Brush.Logo" Color="#FFF05133"/>
<SolidColorBrush x:Key="Brush.TitleBar" Color="#FF303030"/>
<SolidColorBrush x:Key="Brush.Window" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.NewPageHover" Color="#FF404040"/>
<SolidColorBrush x:Key="Brush.PageTabHover" Color="#80505050"/>
<SolidColorBrush x:Key="Brush.Popup" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.Contents" Color="#FF1B1B1B"/>
<SolidColorBrush x:Key="Brush.Badge" Color="#FF8F8F8F"/>
<SolidColorBrush x:Key="Brush.CommitViewer" Color="#FF222222"/>
<SolidColorBrush x:Key="Brush.GroupBar" Color="#FF303030"/>
<SolidColorBrush x:Key="Brush.GroupContent" Color="#FF202020"/>
<SolidColorBrush x:Key="Brush.Decorator" Color="#FF505050"/>
<SolidColorBrush x:Key="Brush.Conflict" Color="#FFFAFAD2"/>
<SolidColorBrush x:Key="Brush.Border1" Color="#FF7C7C7C"/>
<SolidColorBrush x:Key="Brush.Border2" Color="#FF404040"/>
<SolidColorBrush x:Key="Brush.FG" Color="#FFF1F1F1"/>
<SolidColorBrush x:Key="Brush.Border3" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.FG1" Color="#FFF1F1F1"/>
<SolidColorBrush x:Key="Brush.FG2" Color="#40F1F1F1"/>
<SolidColorBrush x:Key="Brush.Badge" Color="#FF8F8F8F"/>
<SolidColorBrush x:Key="Brush.FG3" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.Accent1" Color="#FF007ACC"/>
<SolidColorBrush x:Key="Brush.Accent2" Color="#4C007ACC"/>
</ResourceDictionary>

View file

@ -1,17 +1,27 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Brush.BG1" Color="#FFEFEFEF"/>
<SolidColorBrush x:Key="Brush.BG2" Color="White"/>
<SolidColorBrush x:Key="Brush.BG3" Color="WhiteSmoke"/>
<SolidColorBrush x:Key="Brush.BG4" Color="#FFE6E7E8"/>
<SolidColorBrush x:Key="Brush.BG5" Color="#FFBDBDBD"/>
<SolidColorBrush x:Key="Brush.BG6" Color="#FFAFAFAF"/>
<SolidColorBrush x:Key="Brush.BG7" Color="#FF836C2E"/>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Brush.Logo" Color="#FFF05133"/>
<SolidColorBrush x:Key="Brush.TitleBar" Color="White"/>
<SolidColorBrush x:Key="Brush.Window" Color="#FFEFEFEF"/>
<SolidColorBrush x:Key="Brush.NewPageHover" Color="#1D000000"/>
<SolidColorBrush x:Key="Brush.PageTabHover" Color="#FFE0E0E0"/>
<SolidColorBrush x:Key="Brush.Popup" Color="White"/>
<SolidColorBrush x:Key="Brush.Contents" Color="White"/>
<SolidColorBrush x:Key="Brush.Badge" Color="#FF8F8F8F"/>
<SolidColorBrush x:Key="Brush.CommitViewer" Color="#FFF2F2F2"/>
<SolidColorBrush x:Key="Brush.GroupBar" Color="#FFE8E8E8"/>
<SolidColorBrush x:Key="Brush.GroupContent" Color="#FFE8E8E8"/>
<SolidColorBrush x:Key="Brush.Decorator" Color="#FFBDBDBD"/>
<SolidColorBrush x:Key="Brush.Conflict" Color="#FF836C2E"/>
<SolidColorBrush x:Key="Brush.Border1" Color="#FF898989"/>
<SolidColorBrush x:Key="Brush.Border2" Color="#FFCFCFCF"/>
<SolidColorBrush x:Key="Brush.FG" Color="#FF1F1F1F"/>
<SolidColorBrush x:Key="Brush.Border3" Color="#FFEFEFEF"/>
<SolidColorBrush x:Key="Brush.FG1" Color="#FF1F1F1F"/>
<SolidColorBrush x:Key="Brush.FG2" Color="#FF6F6F6F"/>
<SolidColorBrush x:Key="Brush.Badge" Color="#FF8F8F8F"/>
<SolidColorBrush x:Key="Brush.FG3" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="Brush.Accent1" Color="#FF4295FF"/>
<SolidColorBrush x:Key="Brush.Accent2" Color="#4C007ACC"/>
</ResourceDictionary>