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 - CommandBar - non consistent background style #10258

Open
mklemarczyk opened this issue Dec 27, 2024 · 7 comments
Open

WinUI3 - CommandBar - non consistent background style #10258

mklemarczyk opened this issue Dec 27, 2024 · 7 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@mklemarczyk
Copy link

mklemarczyk commented Dec 27, 2024

Describe the bug

When using CommandBar on Windows 11 23H2. The style of background changes depending is "See more" button is pressed or not.
I created empty application and added only that control, the background is transparent if button "See more" is not clicked.
Style changes to different background and adds some border to it when button "See more is pressed".

I observed the same behavior in WinUI3 Gallery app. I should highlight that tests were performed in Hyper-V Virtual Machine with Windows, with animations disabled in Windows, and in Enhanced view of Virtual Machine.

I do not know if I should open that ticket in this repository or https://github.com/microsoft/WindowsAppSDK. It would be good that you provide more details in repository itself.

The same behavior I reproduced also on friend laptop to eliminate possibility of Hyper-V interference. So it does not matter if Windows is in VM or not. Problem occurs in both cases.

Steps to reproduce the bug

  1. Open WinUI3 Gallery app from Windows Store.
  2. Go to Menus & toolbars, than select CommandBar.
  3. Click "See More" button and observe change in behavior of background.

Expected behavior

The background should be kept to the style that is when button is not pressed. Pressing See more button should only change state of this button and show the flyout with more commands.

Screenshots

See more not clicked:
Image
See more clicked:
Image

NuGet package version

  • Microsoft.WindowsAppSDK - 1.7.241114004-experimental1

Windows version

Windows 11 (23H2): Build 22631

Additional context

My app is build for net9.0-windows10.0.22621.0
For WinUI3 app version 2.5.1.0.

Reopen from : #10242

@mklemarczyk mklemarczyk added the bug Something isn't working label Dec 27, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 27, 2024
@mklemarczyk mklemarczyk changed the title Bug title WinUI3 - CommandBar - non consistent background style Dec 27, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@mklemarczyk
Copy link
Author

mklemarczyk commented Dec 27, 2024

As I cant reopen my bug. I will post it again. I hope you can help more than close the ticket.

@karkarl your comment did not help as even copilot does not know what is "Fluent Windows Visual Library".
Quote : "This is by design. Please refer to the Fluent Windows Visual Library."

Any link to that ? I would say that your message is not helpful. Either you do not take care about WinUI 3 at all, or your documentation is far from being clear on the subject.

@mdtauk
Copy link
Contributor

mdtauk commented Dec 27, 2024

https://www.figma.com/community/file/1440832812269040007/windows-ui-kit
I think this is the thing being referenced. It is an example showing all the designs for components and common design patterns.

The control's default template has a transparent background until you open the overflow or show the labels.
Image
Image

@mklemarczyk
Copy link
Author

mklemarczyk commented Dec 27, 2024

Any idea how to customize it ? I do not have account at figma to verify internal documentation.
In my product the bar is required to keep color if that is open or not. I can set the color on the bar when overflow is closed, but it gets ignored when overflow is open.

Should I redefine entire style for that control to have consistent behavior ?

@mdtauk
Copy link
Contributor

mdtauk commented Dec 28, 2024

There should be a ThemeResource you can override...

<StaticResource x:Key="CommandBarBackground" ResourceKey="ControlFillColorTransparentBrush" />
<StaticResource x:Key="CommandBarBackgroundOpen" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<StaticResource x:Key="CommandBarBorderBrushOpen" ResourceKey="CardStrokeColorDefaultSolidBrush" />
<Thickness x:Key="CommandBarBorderThicknessOpen">1</Thickness>

CommandBarBackgroundOpen

@mklemarczyk
Copy link
Author

Thanks I will try it this week. How did you pull out those keys ?

@mdtauk
Copy link
Contributor

mdtauk commented Dec 31, 2024

Thanks I will try it this week. How did you pull out those keys ?

I looked at the CommonStyles.xaml ResourceDictionary that is in the Repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

2 participants