Skip to content

[Windows] Fixed BarTextColor applied to secondary toolbar items #28932

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

This pull request addresses an issue with the toolbar item text color in the Windows platform and includes the addition of a new test case to ensure the issue is resolved.

Root cause

The BarTextColor is applied to all toolbar items. However, the background is only set for the command bar. The background of the secondary toolbar items container is not customizable and remains white. Consequently, when the text color is white, the secondary toolbar items become invisible.

Description of Change

  • Toolbar text color update:

    • Moved the UpdateTextColor method call for ToolbarItemOrder.Primary items to ensure the correct text color is applied only to primary toolbar items (src/Controls/src/Core/Toolbar/Toolbar.Windows.cs).
  • New test case for issue 20177:

    • Added a new test case to verify that the secondary toolbar items do not use the BarTextColor (src/Controls/tests/TestCases.HostApp/Issues/Issue20177.cs).
    • Implemented a corresponding test to run on Windows, ensuring the issue is reproducible and fixed (src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20177.cs).

Issues Fixed

Fixes #20177

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output

Before After
Before.2.mp4
After.1.mp4

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Apr 11, 2025
@@ -0,0 +1,61 @@
namespace Maui.Controls.Sample.Issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be file-scoped namespace, if you need to touch the PR again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MartyIX Modified

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review April 15, 2025 03:04
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner April 15, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows 🪟
Projects
None yet
3 participants