question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: WinUI Win32 apps should use dark titlebar when app is in dark mode

See original GitHub issue

Proposal: WinUI Win32 apps should support dark title bar

Summary

A few versions back, File Explorer got a dark mode makeover, including a dark titlebar. WinUI Win32 apps use the standard white title bar regardless of whether the rest of the app is dark or not. WinUI Win32 apps should use the same API to make themselves have a dark title bar when the main content is in dark mode.

Rationale

  • The dark mode title bar API already exists in Windows, and users are used to it thanks to File Explorer
  • UWP XAML apps do not suffer from this visual clash
  • It looks bad to have a white title bar with black content

Scope

Capability Priority
The titlebar should obey the system theme by becoming dark in dark mode unless the RequestedTheme property is overridden in App.xaml or maybe MainWindow.xaml Must
Provide an API on the Window class to control the title bar dark mode setting—not sure how useful this would be Could

Mockups

With titlebar accent color enabled in personalization settings Titlebar color settings disabled
Dark with Accent Dark without Accent

Open Questions

It is not clear to me how it would determine whether to use light or dark mode title bar if the app’s theme were overridden. It doesn’t look like the Window class has a RequestedTheme property (but it probably should, like Page?), so it might have to depend only on the app-level setting.

I know a lot of others are interested in greater titlebar customization like in UWP, but I think this is a good place to start for the titlebar.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:43
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

16reactions
BreeceWcommented, May 20, 2020

Maybe WinUI 3 should generally use a more modern title bar like in UWP apps

Agreed—thing is, having the normal Win32 title bar dark mode-aware would be a nice stopgap without having to make any new APIs in WinUI until a better title bar could be made. If there were going to be a “modernized” title bar, I would hope it would be exactly identical to the UWP title bar—not a crude imitation like in Windows Terminal.

12reactions
Austin-Lambcommented, Jan 5, 2021

We have implemented this internally and it will be in the next preview release. We’ll also have support for customizing the title bar more (like you could in UWP) for WinUI 3 Desktop apps, so stay tuned for much better title bars.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support Dark and Light themes in Win32 apps
Win32 apps often don't support Dark mode, so Windows gives Win32 apps a light title bar by default. However, for any app that...
Read more >
Dark Title Bar in Dark Theme for Windows Version
Win32 apps often don't support Dark mode, so Windows gives Win32 apps a light title bar by default. However, for any app that...
Read more >
Question - dark mode menu bar
Win32 apps often don't support Dark mode, so Windows gives Win32 apps a light title bar by default. However, for any app that...
Read more >
Support dark theme on Windows - Sublime Forum
Support system wide dark theme on Windows. Right now, when I use dark mode on Windows, the window title border and menu are...
Read more >
Why Doesn't Microsoft Use Win32 To Make Apps?
This is the likely reason why dark mode isn't implemented in msstyles/uxtheme yet, because it could break older applications that hardcode ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found