Microsoft-ui-xaml: Proposal: WinUI Win32 apps should use dark titlebar when app is in dark mode

Created on 19 May 2020  Â·  10Comments  Â·  Source: microsoft/microsoft-ui-xaml

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.

feature proposal needs-triage needs-winui-3 team-Reach

Most helpful comment

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.

All 10 comments

This should be supported when the theme setting is changed whilst the app is open.

It should also support the App being set to a theme, as well as the Window element having it's theme set.

The dark mode title bar API already exists in Windows

I'm not sure such API exists in win32, isn't explorer handling theme change events and drawing a custom title bar rather?

The dark mode title bar API already exists in Windows

I'm not sure such API exists in win32, isn't explorer handling theme change events and drawing a custom title bar rather?

I should have been more clear. Officially, no, there is no dark mode title bar. Unofficially, some people have already figured it out. I was just using that for a mockup. Either way, I think WinUI Win32 apps should look like that in dark mode.

UWP lacks this as well. There should be a dark mode title bar.

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

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.

Probably relevant to this discussion. I am assuming the TitleBar API is currently non-functional? I did attempted to extend the view into the TitleBar by setting ExtendViewIntoTitleBar to true with a Desktop WinUI project and it did not work as expected.

Any plans to support the TitleBar API within desktop WinUI?

Personally, I think the title bar should be locked off for consistency purposes. There should be one maintained title bar instead of every app having their own implentmentation.

Personally, I think the title bar should be locked off for consistency purposes. There should be one maintained title bar instead of every app having their own implentmentation.

By default the titlebar should use the system design, and match the theme set in the App.xaml or WinUI Window element.

The titlebar being customisable in appearance, but consistent in behaviour and the Window Control placement is a good thing.

Controls like the NavigationView extending into the TitleBar area are important for giving apps a modern and clean appearance. If a developer does something with the look of a titlebar you don't like, that should be sent as feedback to that developer - not making it impossible for good app designers to do the right thing.

UWP lacks this as well. There should be a dark mode title bar.

The UWP app window matches the app's RequestedTheme by default, and WinUI windows should do the same.

Probably relevant to this discussion. I am assuming the TitleBar API is currently non-functional? I did attempted to extend the view into the TitleBar by setting ExtendViewIntoTitleBar to true with a Desktop WinUI project and it did not work as expected.

Any plans to support the TitleBar API within desktop WinUI?

I think this is on the roadmap, but WinUI Desktop apps using Win32, has the ability to access the HWND for the window, to do things - but I agree that customising that window, should be possible with a modern and clean API, as is the case with UWP apps and their CoreWindow

Was this page helpful?
0 / 5 - 0 ratings