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

DefaultTitleBarShouldMatchAppModeTheme does not respect RequestedTheme #9711

Open
lolametro opened this issue Jun 8, 2024 · 3 comments
Open
Labels
area-TitleBar Issues related to custom window title bars. bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team

Comments

@lolametro
Copy link

lolametro commented Jun 8, 2024

Describe the bug

AppWindow.DefaultTitleBarShouldMatchAppModeTheme does not respect the Application.RequestedTheme (or ((FrameworkElement)XamlRoot.Content).RequestedTheme) settings.
The title bar color would then still not match the actual theme used in the app.

Steps to reproduce the bug

  1. Switch Windows app mode theme to "Dark"
  2. Set AppWindow.DefaultTitleBarShouldMatchAppModeTheme = true in the MainWindow
  3. Set RequestedTheme = ApplicationTheme.Light in the App ctor OR ((FrameworkElement)Content.XamlRoot.Content).RequestedTheme = ElementTheme.Light in the MainWindow
  4. Start the app
  5. See a dark title bar, while the app is in light mode

Expected behavior

See a light title bar, while the app is in light mode

Screenshots

image

NuGet package version

WinUI 3 - Windows App SDK 1.6 Experimental 1: 1.6.240531000-experimental1

Windows version

Windows 11 (22H2): Build 22621

Additional context

This means it is not possible to dynamically switch the title bar color, based on the selection of the user in the app. Most apps offer this kind of setting (even Microsoft apps like Paint), meaning the DefaultTitleBarShouldMatchAppModeTheme will not fit their needs and still require custom code. An additional annoyance is, that RequestedTheme cannot be set at runtime, only in the App ctor (#4474).

@lolametro lolametro added the bug Something isn't working label Jun 8, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jun 8, 2024
Copy link

github-actions bot commented Jun 8, 2024

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!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@codendone codendone added team-CompInput Issue for IXP (Composition, Input) team area-TitleBar Issues related to custom window title bars. and removed needs-triage Issue needs to be triaged by the area owners labels Jun 17, 2024
@ghost1372
Copy link
Contributor

@codendone i tested with v1.6-exp2 and it seems that this issue fixed. so i think this issue can be closed

@lolametro
Copy link
Author

@ghost1372 I tested as well with v1.6-exp2, and it's not fixed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TitleBar Issues related to custom window title bars. bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

3 participants