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

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

Open
BreeceW opened this issue May 19, 2020 · 19 comments
Open
Labels
area-TitleBar Issues related to custom window title bars. feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Reach Issue for the Reach team

Comments

@BreeceW
Copy link
Contributor

BreeceW commented May 19, 2020

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.

@BreeceW BreeceW added the feature proposal New feature proposal label May 19, 2020
@msft-github-bot msft-github-bot added this to Freezer in Feature tracking May 19, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label May 19, 2020
@BreeceW BreeceW changed the title Proposal: WinUI Win32 apps should use dark title bar when app is in dark mode Proposal: WinUI Win32 apps should use dark titlebar when app is in dark mode May 19, 2020
@mdtauk
Copy link
Contributor

mdtauk commented May 19, 2020

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
Copy link

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
Copy link
Contributor Author

BreeceW commented May 19, 2020

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
Copy link

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

@lorisobi
Copy link

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

@BreeceW
Copy link
Contributor Author

BreeceW commented 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.

@thexamlguy
Copy link

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
Copy link

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
Copy link
Contributor

mdtauk commented May 20, 2020

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
Copy link
Contributor

mdtauk commented May 20, 2020

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

@StephenLPeters StephenLPeters added team-CompInput Issue for IXP (Composition, Input) team needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Reach Issue for the Reach team and removed team-CompInput Issue for IXP (Composition, Input) team labels May 20, 2020
@Austin-Lamb
Copy link

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 Austin-Lamb removed the needs-triage Issue needs to be triaged by the area owners label Jan 5, 2021
@mdtauk
Copy link
Contributor

mdtauk commented 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.

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
Copy link

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

@mdtauk
Copy link
Contributor

mdtauk commented Jan 5, 2021

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
Copy link

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

@Symbai
Copy link

Symbai commented Jul 1, 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.

@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
Copy link

@amzon-ex
Copy link

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
Copy link
Contributor Author

BreeceW commented Jul 13, 2023

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.

@bpulliam bpulliam added the area-TitleBar Issues related to custom window title bars. label Aug 23, 2023
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. feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Reach Issue for the Reach team
Projects
Development

No branches or pull requests