-
Notifications
You must be signed in to change notification settings - Fork 693
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
Setting Foreground on MenuBarItem doesn't work #7070
Comments
Windows MauiToolbar is not respecting the BarTextColor in the MenuBar. Currently, BarTextColor is only setting the Title's Foreground. If someone sets the BarBackgroundColor, and the BarTextColor is ignored, you can get a menu bar that is not readable. The fix is to propagate the BarTextColor to the MenuBar. However, the fix isn't as simple due to microsoft/microsoft-ui-xaml#7070. Working around that issue by setting the Button's Foreground colors in the MenuBar's ResourceDictionary. Fix dotnet#5554
* Respect BarTextColor in Windows MenuBar Windows MauiToolbar is not respecting the BarTextColor in the MenuBar. Currently, BarTextColor is only setting the Title's Foreground. If someone sets the BarBackgroundColor, and the BarTextColor is ignored, you can get a menu bar that is not readable. The fix is to propagate the BarTextColor to the MenuBar. However, the fix isn't as simple due to microsoft/microsoft-ui-xaml#7070. Working around that issue by setting the Button's Foreground colors in the MenuBar's ResourceDictionary. Fix #5554 * Respond to PR feedback - Allow for clearing the MenuBar Foreground property. - Ensure that we only set the foreground if someone actually set the BarTextColor. * Don't set the Title.Foreground to null.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
I don't believe this has been fixed has it? Can it be re-opened? |
This is still a problem, in-fact the same issue was reported against the WinUI-Gallery application #9241 If the theme of the application changes from light to dark, or dark to light, the flyout style doesn't appropriately change. This is a bug and should be marked for triage. Seems to me as though this has been present for at least 12 months maybe longer. |
Any known workaround? |
Fixed in internal PR: 10250839 |
Describe the bug
Setting the Foreground property on a MenuBarItem or a MenuBar doesn't affect the text color of the menu.
Steps to reproduce the bug
Expected behavior
I expect to be able to read the Menu items because I set the Background to black and the Foreground to White.
I'm not sure whether setting the MenuBar Foreground should affect all the MenuBarItems inside of it or not. I can see advantages to both.
Interesting is that MenuFlyoutItem and MenuFlyoutSubItem Foreground appears to work. It is just MenuBarItem that doesn't.
Screenshots
Notice that
File
andEdit
aren't readable in the MenuBar.NuGet package version
WinUI 3 - Windows App SDK 1.0.3
Windows app type
Device form factor
Desktop
Windows version
Windows 10 (21H2): Build 19044
Additional context
No response
The text was updated successfully, but these errors were encountered: