Skip to content
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

Missing TextColor in MenuBar #5554

Closed
jsuarezruiz opened this issue Mar 24, 2022 · 3 comments · Fixed by #6964
Closed

Missing TextColor in MenuBar #5554

jsuarezruiz opened this issue Mar 24, 2022 · 3 comments · Fixed by #6964
Assignees
Labels
area-controls-menubar Desktop MenuBarItems good first issue Good for newcomers p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Milestone

Comments

@jsuarezruiz
Copy link
Contributor

Description

Setting the NavigationBar colors is not changing the colors of the MenuBar but the worst thing is that it can make using the menu very complex, because you can't see it!

bug-menu

Steps to Reproduce

  1. Download the sample MenuPlayground.zip
  2. Launch the sample in any platform, for example, Windows.
  3. Try to tap in any menu item.

Version with bug

Preview 14 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows, macOS

Affected platform versions

Windows SDK 10.0.17134.0

Did you find any workaround?

No response

Relevant log output

No response

@jsuarezruiz jsuarezruiz added t/bug Something isn't working s/needs-verification Indicates that this issue needs initial verification before further triage will happen legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) area-controls-menubar Desktop MenuBarItems labels Mar 24, 2022
@v-longmin v-longmin added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Mar 25, 2022
@v-longmin
Copy link

Verified the issue on windows, it's repro. thanks. repro project:
MenuPlayground.zip

@Redth Redth added this to the 6.0.300-rc.3 milestone Mar 31, 2022
@Redth Redth modified the milestones: 6.0.300-rc.3, 6.0.300 Apr 27, 2022
@davidortinau davidortinau added the p/0 Work that we can't release without label Apr 29, 2022
@Redth Redth added good first issue Good for newcomers p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint and removed p/0 Work that we can't release without labels May 3, 2022
@eerhardt eerhardt self-assigned this May 4, 2022
@eerhardt
Copy link
Member

eerhardt commented May 6, 2022

Unfortunately, WinUI's MenuBarItem doesn't allow the foreground color to be set. See microsoft/microsoft-ui-xaml#7070.

We will need to workaround this issue ourselves in order to get the text color of the Menu to be set correctly.

@kristinx0211
Copy link

repro on windows and android with vs 17.3.0 Preview 2.0 [32506.368.main].

eerhardt added a commit to eerhardt/maui that referenced this issue May 9, 2022
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
PureWeen pushed a commit that referenced this issue May 9, 2022
* 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.
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2022
@Eilon Eilon added t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) and removed legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) labels May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-menubar Desktop MenuBarItems good first issue Good for newcomers p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants