-
Notifications
You must be signed in to change notification settings - Fork 675
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
TitleBar color customizations don't work if titlebar is added to the UI #9862
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you! Open similar issues:
Closed similar issues:
|
@brunosonnino this is working fine.
|
If you call SetTitleBarColors in the constructor, it doesn't work: public MainWindow()
{
this.InitializeComponent();
ExtendsContentIntoTitleBar = true;
AppWindow.TitleBar.BackgroundColor = Colors.Red;
AppWindow.TitleBar.ForegroundColor = Colors.Yellow;
SetTitleBar(titleBar);
SetTitleBarColors();
} But if you call from a button, like you did, it works: private void Button_Click(object sender, RoutedEventArgs e)
{
SetTitleBarColors();
} |
If you use something like this, it also works: public MainWindow()
{
this.InitializeComponent();
ExtendsContentIntoTitleBar = true;
AppWindow.TitleBar.BackgroundColor = Colors.Red;
AppWindow.TitleBar.ForegroundColor = Colors.Yellow;
SetTitleBar(titleBar);
Activated += MainWindow_Activated;
}
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
{
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Low, () => SetTitleBarColors());
Activated -= MainWindow_Activated;
} |
Describe the bug
When you customize the titlebar button colors with something like this
The custom colors work if you don't add a TitleBar control to the UI. If you add one,the custom colors don't work anymore
The TitleBar doesn't need to have anything on it
Steps to reproduce the bug
This project has a working sample for the bug: https://github.com/brunosonnino/TitleBarBugs/tree/main/1%20-%20AddTitleBar
Expected behavior
The colors of the buttons should be kept
Screenshots
With no TitleBar in the UI
With TitleBar in the UI
NuGet package version
WinUI 3 - Windows App SDK 1.6 Experimental 2: 1.6.240701003-experimental2
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered: