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

[WinUI3 Reunion 0.5] "ExtendsContentIntoTitleBar" Hides Min/Max/Close Buttons #4835

Closed
eleanorleffler opened this issue Apr 15, 2021 · 15 comments
Assignees
Labels
area-TitleBar Issues related to custom window title bars. area-XamlWindow bug Something isn't working product-winui3 WinUI 3 issues team-Reach Issue for the Reach team v0.5 Issues introduced in the Project Reunion 0.5 prerelease working on it

Comments

@eleanorleffler
Copy link

Describe the bug

In WinUI 3 Reunion 0.5, using "ExtendsContentIntoTitleBar" when the background is set on the
control to be used as the title bar results in the standard action buttons on the window
(minimize, maximize, close) being hidden.

Additionally, the action buttons are a smaller height when "ExtendsContentIntoTitleBar" is used.

In UWP, this was accomplished with code like this:

CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
mainWindow.SetTitleBar(AppTitleBarColor);

Steps to reproduce the bug

  1. Clone the WinUI3Reunion05_Problems.
  2. Go to the WinUI3IssuesReunion05 folder.
  3. Open the WinUI3IssuesReunion05.sln solution in Visual Studio 2019 Preview.
  4. Build and run with Debug x64.
  5. Click on the seventh item on the Navigation View (SetTitleBar).
  6. Click through each of the buttons for demonstration.

Expected behavior

We expect to be able to customize the TitleBar without losing the standard window buttons.

Screenshots

Button1

Current (WinUI3 Desktop) vs. Expected (UWP) - Setting TitleBar to Blue

Button2

Current (WinUI3 Desktop) vs. Expected (UWP) - Setting TitleBar to No Color

Version Info

Targeting:
Target: Universal Windows
Target version: Windows 10, version 2004 (10.0; Build19041)
Min version: Windows 10, version 1809 (10.0; Build 17763)

NuGet package version:
[Microsoft.ProjectReunion 0.5.0]
[Microsoft.ProjectReunion.WinUI 0.5.0]

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763) Yes
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 15, 2021
@StephenLPeters StephenLPeters added area-TitleBar Issues related to custom window title bars. team-Reach Issue for the Reach team needs-triage Issue needs to be triaged by the area owners product-winui3 WinUI 3 issues and removed needs-triage Issue needs to be triaged by the area owners labels Apr 15, 2021
@StephenLPeters
Copy link
Contributor

@pratikone and @Austin-Lamb FYI

@codendone
Copy link
Contributor

Dup of #4209?

@eleanorleffler
Copy link
Author

Hi @codendone ,

Same bug, new issue for more recent release with an updated solution!

We have been updating to each of the releases to test and track changes in bugs and functionality. This issue is for the most recent release of Reunion 0.5 while the other issue is for Preview 4.

Thanks again!

@marb2000
Copy link
Contributor

Thanks @eleanorleffler,
There is a nasty bug in the custom Title bar that depending on the XAML layout, the window caption buttons don't render on the top of the visual tree. We already have bug fixes for it and I'm expecting to fix this for Reunion 0.8 GA.

@marb2000 marb2000 added bug Something isn't working working on it area-XamlWindow and removed needs-triage Issue needs to be triaged by the area owners labels Apr 30, 2021
@marb2000 marb2000 self-assigned this Apr 30, 2021
@marb2000 marb2000 added v0.5 Issues introduced in the Project Reunion 0.5 prerelease and removed product-winui3 WinUI 3 issues labels Apr 30, 2021
@Katherine1
Copy link

I'm glad to hear that a fix will be coming for this. In the meantime, are there any workarounds for this issue?

@luckyluka
Copy link

luckyluka commented Jun 14, 2021

It appears this issue is still not fixed.

Using: 0.8 preview

@HEIC-to-JPEG-Dev
Copy link

HEIC-to-JPEG-Dev commented Jun 25, 2021

Reunion 0.8 released, issues still remains. To be specific, in a window that uses ExtendsContentIntoTitleBar, the content, typically a grid, extends over the top of chrome buttons and titlebar. If the grids background is null, then the buttons still work and respond visually as expected, however, if the grid's background is set (to a color or image) then this covers the chrome buttons; they will no longer respond to mouse input or display (they are basically underneath the grid).

I'm assuming to fix this, the buttons (and drag drop area) need to be brought to the top (on top of the grid).

@krschau krschau added the product-winui3 WinUI 3 issues label Jul 14, 2021
@schemburkar
Copy link

Just to chime in with what I want to achieve with WinUI 3 C#/.NET 5 but still haven't got success, even after 0.8 Preview

Expected Target UX similar to UWP app
image

image

So far have below problems in WinUI, most of them related to TitleBar:

  • Title bar has window drag issue. Dragging window does not work on all areas of title bar.
  • Min/max and close window buttons are gone,
  • Title bar controls to right side have hit target problems. Only work if hovered on bottom 5px.
  • Acrylic Brush with host backdrops missing, hoping its back before 1.0/GA

Current UX in WinUI
image

@pratikone
Copy link
Contributor

pratikone commented Aug 2, 2021

Hi all, thanks for bringing this issue out. We found some bugs to fix in this area and some design related restrictions We have catalogued those here : https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.settitlebar?view=winui-3.0#Microsoft_UI_Xaml_Window_SetTitleBar_Microsoft_UI_Xaml_UIElement_ Please follow them and see if they fix anything.

Some of the changes include : not setting background property on custom titlebar uielement as it draws over the min/max/close. By default, the custom titlebar will take the accent colors set in your Windows settings. If you want to customize the theme of custom titlebar, they can be overridden by changing resource values of some brushes. (I will check and post the name of those brushes here)

Edit : we have some more docs which need to be added on the MSDN page.

Second edit : the new documentation is now live. It contains the resources to theme the custom titlebar and a list of restrictions on how to use the custom titlebar feature which you might be hitting https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.settitlebar?view=winui-3.0#Microsoft_UI_Xaml_Window_SetTitleBar_Microsoft_UI_Xaml_UIElement_

@schemburkar
Copy link

schemburkar commented Aug 8, 2021

@pratikone Thanks for the updates. I tried the scenarios with blank app based on your guidance.

I could extend the content on title bar and provide interactive elements (Button "Hey 1" ) on the left area only.

image

Please confirm on below?

  • There is now way to provide interactive elements in the title bar area on the right hand side ? e.g. Button Hey 2
  • In UWP versions we could add margin to left/right to restrict the title bar functionality to the middle on the area. Allowing interactive elements on both sides
    • Something like Visual Studio does? Where space between the Project name and User icon is the draggable title bar area

      image

    • Like something I have done in my UWP app too!
      image

Bug

  • The button "Hey 2" covered by title bar area, is not interactable by mouse/touch but works by using keyboard TAB focus.
    image

Please do let me know if any more data is needed.

@schemburkar
Copy link

Thought of adding scenarios to this thread that are not supported currently within WinUI title Bar but are used in the newly re-designed official Microsoft Store app in Windows 11.
All blank space on the title bar is draggable, while retaining input on other elements.

Overall Title Bar
image

Search in titlebar with Autocomplete
image

User Icon in titlebar with menu
image

Hope all these scenarios are supported when this issue is planned for a fix.

@pratikone
Copy link
Contributor

pratikone commented Sep 1, 2021

Thanks for providing all these scenarios. We are aware of this specific feature request which one can call as non contiguous custom titlebar or having interactable elements within titlebar. Both have the same root. There are discussions ongoing on best ways to support these scenarios

@Wufus
Copy link

Wufus commented Sep 9, 2021

A workaround is described here #4166
But, bugs still exist. As non-draggable area at the top, bottom and right of MinMaxCloseContainer

@pratikone
Copy link
Contributor

@schemburkar can you open another issue with your screenshots ? - it will be helpful to track that issue separately. Closing this one for now as it has been answered

@schemburkar
Copy link

Thanks @pratikone, created #6070. Let me know if you need more details on that thread.

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. area-XamlWindow bug Something isn't working product-winui3 WinUI 3 issues team-Reach Issue for the Reach team v0.5 Issues introduced in the Project Reunion 0.5 prerelease working on it
Projects
None yet
Development

No branches or pull requests