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

Changing Mica backdrop in ActualThemeChanged event causes backdrop to render wrong #3230

Open
dotMorten opened this issue Dec 8, 2022 · 3 comments
Labels
area-Composition bug Something isn't working

Comments

@dotMorten
Copy link
Contributor

dotMorten commented Dec 8, 2022

Describe the bug

I want to change my tint opacity of mica when in dark mode. However when I switch darkmode, setting the tint opacity in the ActualThemeChanged event causes the entire backdrop to render completely wrong.

I also notice that if I delay setting the TintOpacity override, or I don't override it at all, things render just fine.

Steps to reproduce the bug

  1. Unzip the repro project: MicaBugRepro.zip
  2. Launch app and use the dropdown to switch to dark-mode. Notice most text is getting unreadable.
  3. Switch back to light mode, and flip one of the two switches.
  4. Switch to dark mode again, and notice there is no issue.

Expected behavior

Dark mode renders correctly, regardless of if/when TintOpacity is applied.

Screenshots

Untitled.Project.mp4

NuGet package version

Windows App SDK 1.2.1: 1.2.221116.1

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

Reproduced with 1.1.5, 1.2 preview, and 1.2.221116.1

@zhuxb711
Copy link

if comment this out, then the theme would not be changed as expected

micaController.ResetProperties()

@zhuxb711
Copy link

zhuxb711 commented Dec 23, 2022

Inclusion:

The code would not works

BackdropConfiguration.Theme = SystemBackdropTheme.Dark //Or SystemBackdropTheme.Light

The code would not works too

BackdropConfiguration.Theme = SystemBackdropTheme.Dark //Or SystemBackdropTheme.Light
micaController.ResetProperties();
micaController.TintColor = //Your Color
micaController.TintOpacity = //Your TintOpacity 
micaController.LuminosityOpacity = //Your LuminosityOpacity

The code would works as expected

BackdropConfiguration.Theme = SystemBackdropTheme.Dark //Or SystemBackdropTheme.Light
micaController.ResetProperties();

@dotMorten I also seem this issue in DesktopAcrylicController not only in MicaController

@zhuxb711
Copy link

For DesktopAcrylicController, those bugs would found.

Set TintOpacity property only would not takes effect

//Change TintOpacity only would not takes effect
acrylicController.TintOpacity = //Your TintOpacity 

Set TintOpacity and LuminosityOpacity property would takes effect

//Change TintOpacity and LuminosityOpacity would takes effect
acrylicController.TintOpacity = //Your TintOpacity 
acrylicController.LuminosityOpacity = //Your LuminosityOpacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Composition bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants