How to theme menu on hover? #18640
Unanswered
Shadowblitz16
asked this question in
Q&A
Replies: 2 comments 3 replies
-
The font color isn't even changing... <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:v="clr-namespace:Quest.Editor.Views">
<Design.PreviewWith>
<StackPanel Width = "320" Height="240">
<Menu>
<MenuItem Header="File">
<MenuItem Header="New"/>
<MenuItem Header="Open"/>
</MenuItem>
</Menu>
</StackPanel>
</Design.PreviewWith>
<Style Selector="Menu">
<Setter Property="Margin" Value = "0"></Setter>
<Setter Property="Background" Value="{DynamicResource PrimaryBackground}"/>
</Style>
<Style Selector="MenuItem">
<Setter Property="Padding" Value = "1"/>
<Setter Property="Foreground" Value = "{DynamicResource PrimaryForeground}"/>
<Setter Property="Background" Value = "{DynamicResource PrimaryBackground}"/>
</Style>
<!-- <Style Selector="MenuItem:selected"> -->
<!-- <Setter Property="Background" Value="{DynamicResource PrimaryBackground}"/> -->
<!-- </Style> -->
<!-- <Style Selector="MenuItem:hovered"> -->
<!-- <Setter Property="Background" Value="{DynamicResource PrimaryBackground}"/> -->
<!-- </Style> -->
</Styles>
This space around the text isn't either. |
Beta Was this translation helpful? Give feedback.
0 replies
-
MenuItem does not seem to have a hover pseudo selector: So my guess is you can't. As for things not changing, it really depends on what you are using as your base theme. The theme is responsible for setting up the template bindings, EG Avalonia/src/Avalonia.Themes.Fluent/Controls/Menu.xaml Lines 16 to 28 in f42af48 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do I theme a menu and menu item?
Beta Was this translation helpful? Give feedback.
All reactions