-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[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
Merged
PureWeen
merged 6 commits into
dotnet:inflight/current
from
NirmalKumarYuvaraj:fix-20177
Apr 18, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
96e6db0
Fixed bar textcolor used in secondary toolbar
NirmalKumarYuvaraj 9303193
Update MauiToolbar.xaml.cs
NirmalKumarYuvaraj adb1a76
resolved the changes
NirmalKumarYuvaraj df45b59
Update Issue20177.cs
NirmalKumarYuvaraj b1f53fd
modified issue string
NirmalKumarYuvaraj 19d3bae
added windows snapshot
NirmalKumarYuvaraj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.Github, 20177, "Shell TitleColor changes the secondary ToolbarItems TextColor", PlatformAffected.UWP)] | ||
public class Issue20177 : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
Shell.SetTitleColor(this, Colors.White); | ||
AddContentPage(CreateContentPage()); | ||
} | ||
|
||
ContentPage CreateContentPage() | ||
{ | ||
var page = new ContentPage(); | ||
PopulateToolBarItems(page); | ||
page.Content = CreateGrid(); | ||
return page; | ||
} | ||
|
||
Grid CreateGrid() | ||
{ | ||
Grid grid = new Grid() | ||
{ | ||
new Label() | ||
{ | ||
HorizontalOptions = LayoutOptions.Center, | ||
VerticalOptions= LayoutOptions.Center, | ||
Text = "Secondary ToolBar Items should not use BarTextColor", | ||
AutomationId = "DescriptionLabel" | ||
} | ||
}; | ||
return grid; | ||
} | ||
|
||
void PopulateToolBarItems(ContentPage page) | ||
{ | ||
page.ToolbarItems.Add(new() | ||
{ | ||
Text = "Menu item", | ||
Order = ToolbarItemOrder.Primary | ||
}); | ||
page.ToolbarItems.Add(new() | ||
{ | ||
Text = "Menu item 1", | ||
Order = ToolbarItemOrder.Secondary | ||
}); | ||
page.ToolbarItems.Add(new() | ||
{ | ||
Text = "Menu item 2", | ||
Order = ToolbarItemOrder.Secondary | ||
}); | ||
page.ToolbarItems.Add(new() | ||
{ | ||
Text = "Menu item 3", | ||
Order = ToolbarItemOrder.Secondary | ||
}); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20177.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#if WINDOWS // Issue can be repro on windows only | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
internal class Issue20177 : _IssuesUITest | ||
{ | ||
public Issue20177(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "Shell TitleColor changes the secondary ToolbarItems TextColor"; | ||
|
||
[Test] | ||
[Category(UITestCategories.ToolbarItem)] | ||
public void ToolBarSecondayItemsShouldNotUseBarTextColor() | ||
{ | ||
App.ToggleSecondaryToolbarItems(); | ||
VerifyScreenshot(); | ||
jsuarezruiz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
#endif |
Binary file added
BIN
+10.6 KB
....WinUI.Tests/snapshots/windows/ToolBarSecondayItemsShouldNotUseBarTextColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.