Organize some style declarations, add MenuItemPopup transparent background

Transparent background is to ensure proper hit registration for menu buttons
This commit is contained in:
Chev 2021-06-04 20:40:32 -07:00
parent d5ebd13f18
commit 5058412367

View file

@ -8,6 +8,7 @@
<SolidColorBrush x:Key="BGTone1" Color="#2C343E"/> <SolidColorBrush x:Key="BGTone1" Color="#2C343E"/>
<SolidColorBrush x:Key="BGTone2" Color="#37424E"/> <SolidColorBrush x:Key="BGTone2" Color="#37424E"/>
<SolidColorBrush x:Key="BGTone3" Color="#3E4B59"/> <SolidColorBrush x:Key="BGTone3" Color="#3E4B59"/>
<SolidColorBrush x:Key="BGTone4" Color="#4E6072"/>
<SolidColorBrush x:Key="ButtonBG" Color="#303944"/> <SolidColorBrush x:Key="ButtonBG" Color="#303944"/>
<SolidColorBrush x:Key="ButtonSelected" Color="#586B7F"/> <SolidColorBrush x:Key="ButtonSelected" Color="#586B7F"/>
@ -19,6 +20,17 @@
<Style TargetType="{x:Type Label}"> <Style TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
</Style> </Style>
<Style TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="{StaticResource BorderGray}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style TargetType="{x:Type Image}">
<!--Smooth edges on transparent images-->
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>
</Style>
<Style TargetType="{x:Type Button}"> <Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="{StaticResource ButtonBG}"/> <Setter Property="Background" Value="{StaticResource ButtonBG}"/>
<Setter Property="Foreground" Value="White"/> <!-- Text color --> <Setter Property="Foreground" Value="White"/> <!-- Text color -->
@ -53,11 +65,17 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style TargetType="{x:Type CheckBox}">
<Setter Property="Foreground" Value="White"/>
</Style>
<Style TargetType="{x:Type TabControl}"> <Style TargetType="{x:Type TabControl}">
<Setter Property="Background" Value="{StaticResource BGTone1}"/> <Setter Property="Background" Value="{StaticResource BGTone1}"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/>
</Style> </Style>
<Style TargetType="{x:Type TabItem}"> <Style TargetType="{x:Type TabItem}">
<Setter Property="Background" Value="{StaticResource BGTone2}"/> <Setter Property="Background" Value="{StaticResource BGTone2}"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
@ -98,40 +116,33 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style TargetType="{x:Type Menu}">
<Setter Property="Background" Value="{StaticResource BGTone2}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
</Style>
<Style TargetType="{x:Type MenuItem}">
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style TargetType="{x:Type TextBox}"> <Style TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderGray}"/> <Setter Property="BorderBrush" Value="{StaticResource BorderGray}"/>
<Setter Property="CaretBrush" Value="White"/> <Setter Property="CaretBrush" Value="White"/>
</Style> </Style>
<Style TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="{StaticResource BorderGray}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style TargetType="{x:Type Image}">
<!--Smooth edges on transparent images-->
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>
</Style>
<Style TargetType="{x:Type Expander}"> <Style TargetType="{x:Type Expander}">
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
</Style> </Style>
<Style TargetType="{x:Type CheckBox}">
<Style TargetType="{x:Type Menu}">
<Setter Property="Background" Value="{StaticResource BGTone2}"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
</Style>
<Style TargetType="{x:Type MenuItem}">
<Setter Property="BorderThickness" Value="0"/>
</Style> </Style>
<Style x:Key="MenuItemPopup" TargetType="{x:Type MenuItem}"> <Style x:Key="MenuItemPopup" TargetType="{x:Type MenuItem}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}"> <ControlTemplate TargetType="{x:Type MenuItem}">
<Grid SnapsToDevicePixels="True"> <Grid SnapsToDevicePixels="True" Background="Transparent">
<DockPanel x:Name="MenuItemDockPanel"> <DockPanel x:Name="MenuItemDockPanel">
<!--<ContentPresenter x:Name="Icon" ContentSource="Icon" Margin="0,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/> <!--<ContentPresenter x:Name="Icon" ContentSource="Icon" Margin="0,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
<Path x:Name="GlyphPanel" Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" Visibility="Collapsed" VerticalAlignment="Center"/>--> <Path x:Name="GlyphPanel" Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" Visibility="Collapsed" VerticalAlignment="Center"/>-->