style<Dashboard>: change style for Workspace switcher

This commit is contained in:
leo 2021-08-13 11:15:30 +08:00
parent aed3c10aa4
commit 5c892a96e6
4 changed files with 47 additions and 3 deletions

View file

@ -31,6 +31,44 @@
</Setter>
</Style>
<Style x:Key="Style.ListViewItem.Switcher" TargetType="{x:Type ListViewItem}">
<Setter Property="Opacity" Value=".9"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
<Setter Property="TextElement.FontFamily" Value="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Grid>
<Border x:Name="BG" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" Background="Transparent">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<Border x:Name="Border" BorderBrush="{DynamicResource Brush.FG2}" BorderThickness="0"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="BorderThickness" Value="4,0,0,0"/>
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Brush.SwitcherBG}"/>
<Setter Property="Opacity" Value="1"/>
<Setter Property="TextElement.FontWeight" Value="Bold"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Brush.SwitcherHover}"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ListView}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />

View file

@ -25,4 +25,7 @@
<SolidColorBrush x:Key="Brush.FG3" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.Accent1" Color="#FF007ACC"/>
<SolidColorBrush x:Key="Brush.Accent2" Color="#4C007ACC"/>
<SolidColorBrush x:Key="Brush.SwitcherHover" Color="#FF323232"/>
<SolidColorBrush x:Key="Brush.SwitcherBG" Color="#FF3F3F3F"/>
</ResourceDictionary>

View file

@ -25,4 +25,7 @@
<SolidColorBrush x:Key="Brush.FG3" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="Brush.Accent1" Color="#FF4295FF"/>
<SolidColorBrush x:Key="Brush.Accent2" Color="#4C007ACC"/>
<SolidColorBrush x:Key="Brush.SwitcherHover" Color="#FFDFDFDF"/>
<SolidColorBrush x:Key="Brush.SwitcherBG" Color="#FFCFCFCF"/>
</ResourceDictionary>