Skip to content

Commit

Permalink
Adjustments to menus colors
Browse files Browse the repository at this point in the history
  • Loading branch information
darklinkpower committed Oct 31, 2023
1 parent ec7acfb commit 7a6fe41
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
6 changes: 5 additions & 1 deletion source/Constants.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<sys:Double x:Key="DetailsViewOverviewHeaderButtonsOpacity">1.0</sys:Double>
<FontFamily x:Key="FontFamily">Trebuchet MS</FontFamily>
<FontFamily x:Key="MonospaceFontFamily">Consolas</FontFamily>
<Thickness x:Key="PopupMenuPadding">0</Thickness>
<Thickness x:Key="PopupBorderThickness">0</Thickness>
<Thickness x:Key="ControlBorderThickness">0</Thickness>
<sys:Double x:Key="EllipseBorderThickness">0</sys:Double>
Expand All @@ -62,6 +63,7 @@
TopRight="0"
BottomRight="0"
BottomLeft="{StaticResource ControlCornerRadiusValue}"/>
<CornerRadius x:Key="PopupsHoverBackgroundCornerRadius">0</CornerRadius>
<CornerRadius x:Key="DetailsViewExtraButtonsCornerRadius">4</CornerRadius>
<CornerRadius x:Key="ControlCornerRadiusSmall">3</CornerRadius>
<CornerRadius x:Key="GridViewCoverCornerRadius">5</CornerRadius>
Expand Down Expand Up @@ -241,6 +243,8 @@
<SolidColorBrush x:Key="NormalBrushDark" Color="{DynamicResource ControlBackgroundColor}" />
<SolidColorBrush x:Key="NormalBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="HoverBrush1" Color="{DynamicResource HighlightGlyphColor}" />
<SolidColorBrush x:Key="MenusPopupsHoverBrush" Color="#dcdedf" />
<SolidColorBrush x:Key="MenusPopupMouseOverForegroundBrush" Color="#3d4450" />
<LinearGradientBrush x:Key="HoverBrush" StartPoint="0.0, 0.5" EndPoint="1.0, 0.5" >
<GradientStop Color="#5A6069" Offset="0"/>
<GradientStop Color="#50555D" Offset="0.5"/>
Expand Down Expand Up @@ -368,7 +372,7 @@
<GradientStop Color="#686868" Offset="1"/>
</LinearGradientBrush>

<SolidColorBrush x:Key="GameInfoContainerBackgroundBrush" Color="#000000" Opacity="0.2"/>
<SolidColorBrush x:Key="GameInfoContainerBackgroundBrush" Color="#33000000" />

<!--region Details View Backgrounds brushes-->
<LinearGradientBrush x:Key="DetailsSectionBackgroundBrush" StartPoint="0.5, 1.0" EndPoint="0.5, 0.0" >
Expand Down
24 changes: 15 additions & 9 deletions source/DefaultControls/Menu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

<Style TargetType="{x:Type Menu}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}"/>
<Setter Property="Template">
<Setter.Value>
Expand All @@ -42,7 +41,7 @@
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
<Border x:Name="Border">
<Grid>
<Border x:Name="HoverBorder" Background="{DynamicResource HoverBrush}" Visibility="Collapsed"/>
<Border x:Name="HoverBorder" Background="{DynamicResource MenusPopupsHoverBrush}" Visibility="Collapsed"/>
<TextBlock VerticalAlignment="Center" Padding="5" Style="{DynamicResource BaseTextBlockStyle}"
Foreground="{TemplateBinding Foreground}">
<ContentPresenter ContentSource="Header" RecognizesAccessKey="True" />
Expand Down Expand Up @@ -106,8 +105,8 @@

<!-- SubmenuHeader -->
<ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
<Border x:Name="HoverBorder" Background="{DynamicResource MenusHoverBrush}" Margin="7,0,7,0"
CornerRadius="{DynamicResource ControlCornerRadius}">
<Border x:Name="HoverBorder" Background="{DynamicResource MenusPopupsHoverBrush}" Margin="7,0,7,0"
CornerRadius="{DynamicResource PopupsHoverBackgroundCornerRadius}">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup" />
Expand All @@ -120,17 +119,20 @@
VerticalAlignment="Center" ContentSource="Icon" />
<Grid x:Name="GlyphPanel" Grid.Column="0" Visibility="Collapsed"
Margin="5,0,-5,0" VerticalAlignment="Center">
<TextBlock FontFamily="Marlett" Text="a" VerticalAlignment="Center" Style="{DynamicResource BaseTextBlockStyle}" />
<TextBlock FontFamily="Marlett" Text="a" Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center" Style="{DynamicResource BaseTextBlockStyle}" />
</Grid>
<TextBlock Grid.Column="1" Padding="5" VerticalAlignment="Center" Style="{DynamicResource BaseTextBlockStyle}"
Foreground="{TemplateBinding Foreground}">
<ContentPresenter RecognizesAccessKey="True" Margin="5,0,5,0" ContentSource="Header"/>
</TextBlock>
<TextBlock x:Name="GestureText" Grid.Column="2" Text="{TemplateBinding InputGestureText}"
Foreground="{TemplateBinding Foreground}"
TextAlignment="Left" HorizontalAlignment="Stretch" Margin="20,5,10,5"
VerticalAlignment="Center" Background="Transparent" Opacity="0.6"/>
<Grid Grid.Column="3" Margin="0,0,5,0">
<TextBlock FontFamily="Marlett" Text="4" VerticalAlignment="Center" Style="{DynamicResource BaseTextBlockStyle}" />
<TextBlock FontFamily="Marlett" Text="4" Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center" Style="{DynamicResource BaseTextBlockStyle}" />
</Grid>
<Popup x:Name="Popup" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right"
Focusable="False" AllowsTransparency="True">
Expand Down Expand Up @@ -171,8 +173,8 @@

<!-- SubmenuItem -->
<ControlTemplate x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" TargetType="{x:Type MenuItem}">
<Border x:Name="HoverBorder" Background="{DynamicResource MenusHoverBrush}" Margin="7,0,7,0"
CornerRadius="{DynamicResource ControlCornerRadius}">
<Border x:Name="HoverBorder" Background="{DynamicResource MenusPopupsHoverBrush}" Margin="7,0,7,0"
CornerRadius="{DynamicResource PopupsHoverBackgroundCornerRadius}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup" />
Expand Down Expand Up @@ -212,7 +214,7 @@
</ControlTemplate>

<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter Property="Foreground" Value="{DynamicResource MenusPopupsHoverBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
Expand All @@ -230,6 +232,10 @@
<Trigger Property="Role" Value="SubmenuItem">
<Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.SubmenuItemTemplateKey}}" />
</Trigger>

<Trigger Property="IsHighlighted" Value="True">
<Setter Property="Foreground" Value="{DynamicResource MenusPopupMouseOverForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

0 comments on commit 7a6fe41

Please sign in to comment.