-
-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MenuItem header is visually inconstant when using _ to indicate shortcut keys #589
Labels
Comments
I have the same problem, it seems that the header with an underscore is displayed in AccessText instead of TextBlock. I fixed this in my project by copying the style from the TextBlock (
<!-- This is copied from the Wpf.UI TextBlock style.
If a text contains an underscore ("_"), the TextBlock is replaced with AccessText.
Wpf.Ui doesn't style the AccessText so has another look than text without underscore.
This gives AccessText the same look as TextBlock. -->
<Style TargetType="{x:Type AccessText}">
<!--<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}"/>-->
<!-- The Display option causes a large aliasing effect -->
<!--<Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />-->
<Setter Property="Background" Value="Transparent" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Margin" Value="0" />
<Setter Property="Focusable" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
</Style>``` |
Wow, thanks for the fast fix!👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Within MenuItems you can add an underscore before the letter you want to use as the shortcut key. When using WPF UI adding underscores to the MenuItem makes the text a different style than menu items without an underscore.
To Reproduce
Add underscores to the header item in the MenuItem Header
Expected behavior
Consistent look across all MenuItems
Screenshots
OS version
Windows 11
Version 22H2 (OS Build 22621.1413)
.NET version
.NET 6
WPF-UI NuGet version
3.0.0.preview.1
Additional context
No response
The text was updated successfully, but these errors were encountered: