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

MenuFlyout does not update correctly on theme change #8077

Closed
bogdan-patraucean opened this issue Jan 8, 2023 · 5 comments
Closed

MenuFlyout does not update correctly on theme change #8077

bogdan-patraucean opened this issue Jan 8, 2023 · 5 comments
Labels
area-Flyouts area-Menus bug Something isn't working fix-released The fix has been in a release (experimental, preview, stable, or servicing). team-Rendering Issue for the Rendering team
Milestone

Comments

@bogdan-patraucean
Copy link

Describe the bug

Changing the system theme from Light to Dark or from Dark to Light will not update the Theme of a MenuFlyout on runtime like the rest of the controls.
This happens also in WinUI 3 Gallery app, but randomly, as I can't reproduce it everytime. On my app, on the otherhand, I can reproduce it everytime.

The only way it will display the correct theme is to reopen the app.

It might also be related to #3373 which was for WinUI 2.

Steps to reproduce the bug

  1. Create a blank WASDK app, packaged.
  2. Add a MenuFlyout on the MainWindow.
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
    <AppBarButton Icon="Sort" IsCompact="True">
        <AppBarButton.Flyout>
            <MenuFlyout>
                <MenuFlyoutItem Text="By rating" Tag="rating"/>
                <MenuFlyoutItem Text="By match" Tag="match"/>
                <MenuFlyoutItem Text="By distance" Tag="distance"/>
            </MenuFlyout>
        </AppBarButton.Flyout>
    </AppBarButton>
</StackPanel>
  1. Open the MenuFlyout.

    Step 3 is important, because if you don't open it first, and you change the theme, then open, the correct theme will be applied.

  2. Change the system theme from the Settings App > Personalization > Colors : Chose Color Mode - Light or Dark

  3. Open the MenuFlyout.

  4. Observe the strange color state of the Flyout, it's not Light or Dark theme, more of a broken dimmed or washed out state.

Expected behavior

The Flyout should display the correct theme based on what theme was selected by the OS at runtime, without the need to reopen the app or to not open the MenuFlyout first.

Screenshots

image

Light Theme normal state

image

Light Theme switched state

image

Dark Theme normal state

image

Dark Theme switched state

NuGet package version

WinUI 3 - Windows App SDK 1.2.2: 1.2.221209.1

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@bogdan-patraucean bogdan-patraucean added the bug Something isn't working label Jan 8, 2023
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jan 8, 2023
@gabbybilka gabbybilka added area-TabView product-winui2 bug Something isn't working area-Menus area-Flyouts team-Controls Issue for the Controls team and removed bug Something isn't working area-TabView product-winui2 needs-triage Issue needs to be triaged by the area owners labels Jan 26, 2023
@gabbybilka
Copy link
Member

We were able to repro this simple case, looks like a theming issue on the background, thanks for filing.

@gabbybilka gabbybilka added team-Rendering Issue for the Rendering team and removed team-Controls Issue for the Controls team labels Jan 26, 2023
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jan 26, 2023
@ThreeSevenths
Copy link

@gabbybilka I'm also hitting this with a Flyout with custom content. It seems that if the flyout isn't shown prior to the theme change it works correctly, but after, the style seems to be cached. Is there a workaround until this is fixed to notify the flyout to recreate the content or update its style references?

@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Jul 7, 2023
@mikernet
Copy link

This also affects content dialogs.

@bogdan-patraucean
Copy link
Author

Based on my testing this issue seems to be fixed with latest 1.4.3 version of Windows App SDK.

@codendone
Copy link
Contributor

A fix for this was checked in for WinAppSDK 1.6, and was included in 1.6-experimental1.

@codendone codendone added the fix-released The fix has been in a release (experimental, preview, stable, or servicing). label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Flyouts area-Menus bug Something isn't working fix-released The fix has been in a release (experimental, preview, stable, or servicing). team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

6 participants