Skip to content

[2025/05/19] Candidate - In Flight Branch #29473

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
merged 15 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Windows] Fixed the color not being applied to the Expand/Collapse Ch…
…evron icon (#29140)

* Fixed Chevron icon color issue

* Test sample changes

* Test script changes

* test sample changes

* Added Windows snapshot
  • Loading branch information
Tamilarasan-Paranthaman authored and PureWeen committed May 14, 2025
commit 4b14e76f58f4ee1ce07a2c58b3ade01317deb4b9
37 changes: 37 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue25115.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 25115, "[Windows] The color was not applied properly to the Tab Chevron icon", PlatformAffected.UWP)]
public class Issue25115 : TestShell
{
protected override void Init()
{
SetValue(Shell.TabBarUnselectedColorProperty, Colors.Blue);
SetValue(Shell.TabBarTitleColorProperty, Colors.Red);

var tabBar = new TabBar();
var tab1 = new Tab();
var tab2 = new Tab();
tab1.Title = "Tab 1";
tab2.Title = "Tab 2";

tab1.Items.Add(GetShellContent("Page 1", "Page 1 Content"));
tab1.Items.Add(GetShellContent("Page 2", "Page 2 Content"));
tab2.Items.Add(GetShellContent("Tab 2", "Tab 2 Content"));

tabBar.Items.Add(tab1);
tabBar.Items.Add(tab2);
Items.Add(tabBar);
}
ShellContent GetShellContent(string title, string content)
{
return new ShellContent
{
Title = title,
Content = new ContentPage
{
Title = title,
Content = new Label { Text = content, AutomationId = "label" },
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#if WINDOWS // Chevron icon color is only applicable to Windows
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue25115 : _IssuesUITest
{
public override string Issue => "[Windows] The color was not applied properly to the Tab Chevron icon";

public Issue25115(TestDevice device)
: base(device)
{ }

[Test]
[Category(UITestCategories.Shell)]
public void VerifyTabChevronIconColor()
{
App.WaitForElement("label");

VerifyScreenshot();
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/Core/src/Platform/Windows/NavigationViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,22 @@ public static void UpdateTopNavigationViewItemTextColor(this MauiNavigationView
navigationView.TopNavArea.Resources.Remove("TopNavigationViewItemForegroundPointerOver");
navigationView.TopNavArea.Resources.Remove("TopNavigationViewItemForegroundPressed");
navigationView.TopNavArea.Resources.Remove("TopNavigationViewItemForegroundDisabled");

navigationView.TopNavArea.Resources.Remove("NavigationViewItemForeground");
navigationView.TopNavArea.Resources.Remove("NavigationViewItemForegroundPointerOver");
navigationView.TopNavArea.Resources.Remove("NavigationViewItemForegroundPressed");
}
else
{
navigationView.TopNavArea.Resources["TopNavigationViewItemForeground"] = brush;
navigationView.TopNavArea.Resources["TopNavigationViewItemForegroundPointerOver"] = brush;
navigationView.TopNavArea.Resources["TopNavigationViewItemForegroundPressed"] = brush;
navigationView.TopNavArea.Resources["TopNavigationViewItemForegroundDisabled"] = brush;

//The NavigationViewItemForeground color is applied to the Expand/Collapse Chevron icon
navigationView.TopNavArea.Resources["NavigationViewItemForeground"] = brush;
navigationView.TopNavArea.Resources["NavigationViewItemForegroundPointerOver"] = brush;
navigationView.TopNavArea.Resources["NavigationViewItemForegroundPressed"] = brush;
}

navigationView.TopNavArea.RefreshThemeResources();
Expand Down