microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.27k stars 674 forks source link

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

Open BreeceW opened 4 years ago

BreeceW commented 4 years ago

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

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.

mdtauk commented 4 years ago

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.

adrientetar commented 4 years ago

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?

BreeceW commented 4 years ago

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.

shaheedmalik commented 4 years ago

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

lorisobi commented 4 years ago

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

BreeceW commented 4 years ago

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.

thexamlguy commented 4 years ago

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?

shaheedmalik commented 4 years ago

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.

mdtauk commented 4 years ago

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.

mdtauk commented 4 years ago

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

Austin-Lamb commented 3 years ago

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.

mdtauk commented 3 years ago

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.

I am hoping the oft-reported and coming soon "Sun Valley" visual refresh will result in shared colour values and design aesthetics with the Win32 shell, window controls, etc - and with WinUI and XAML shell and app UI.

shaheedmalik commented 3 years ago

I hate that title bars aren't standard and consistent.

mdtauk commented 3 years ago

I hate that title bars aren't standard and consistent.

Sounds like some improvements to the WinUI Desktop titlebars are coming - hopefully a design which matches the CoreWindow's Titlebar designs.

But apps using the NavigationView, or using Acrylic - should be encouraged to extend into the Titlebar area, as it makes the app feel more modern and more polished.

I am glad that extending will be supported for WinUI Sandboxed and Desktop apps, as will setting the Window Control colours.

sigmarsson commented 3 years ago

@Austin-Lamb , so cool. I will try the new title bar for size with the next preview.

Symbai commented 3 years ago

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.

@Austin-Lamb Your post is from Januar and meanwhile there is a new version of WinUI 3 released couple of days ago. However switching to dark mode the window title is still not dark:

image

Can we get an update when this "next preview release" is going to be released?

tom-huntington commented 2 years ago

@Symbai It's coming https://github.com/microsoft/WindowsAppSDK/issues/41 If you cant wait https://github.com/ysc3839/win32-darkmode

amzon-ex commented 2 years ago

This discussion seems super promising! However, considering I'm on Win11 Dev channel (now in 22H2) and dark mode for Win32 titlebars is still not here yet, is it possible to provide an update on this?

BreeceW commented 1 year ago

There are now public APIs that enable Win32 apps to use the dark system title bar, but I’d like to keep this open (re: #8638) because the default experience is still a light mode title bar with dark mode content.