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

fix(shadows): background theming issue #737

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

Xiaoy312
Copy link
Contributor

@Xiaoy312 Xiaoy312 commented Aug 18, 2023

GitHub Issue (If applicable): closes: #707

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

ShadowContainer currently strips its child's background and use it as the background for the image-brush. This is done because the inner shadows need to be drawn on top of the content background. This approach has a few problems where it doesnt subscribes to updates to the background property, nor theme updates from the {ThemeResource} brush.

What is the new behavior?

ShadowContainer now creates two layers of shadows, one for background shadows and one for foreground shadows, that sandwiches the content.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

@Xiaoy312 Xiaoy312 force-pushed the dev/xygu/20230818/shadow-background branch from 20274e1 to 8e547eb Compare August 18, 2023 19:46
@github-actions
Copy link

github-actions bot commented Aug 21, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-737.eastus2.azurestaticapps.net

@Xiaoy312
Copy link
Contributor Author

Xiaoy312 commented Aug 21, 2023

@agneszitte
im unlinking 707, because there are currently multiple issues in that one
and this only addresses one of them
(i explicitly used re instead of closes keyword)

edit: this also fixes the other one too.

@Xiaoy312 Xiaoy312 marked this pull request as ready for review August 21, 2023 15:48
@Xiaoy312
Copy link
Contributor Author

sanity-check done: winui, skia, wasm, ios, droid

@Xiaoy312 Xiaoy312 force-pushed the dev/xygu/20230818/shadow-background branch from 25f1d46 to a003cea Compare August 21, 2023 16:45
@github-actions
Copy link

github-actions bot commented Aug 21, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-737.eastus2.azurestaticapps.net

@Xiaoy312 Xiaoy312 force-pushed the dev/xygu/20230818/shadow-background branch from a003cea to e72a29d Compare August 21, 2023 22:13
@github-actions
Copy link

github-actions bot commented Aug 21, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-737.eastus2.azurestaticapps.net

Copy link
Contributor

@kazo0 kazo0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing some strange behaviors if I add an extra shadow using the ShadowContainerSamplePage here (tested on Skia so far):

Before adding new shadow:
image

After adding new shadow:
image

It seems to also break on main but in a different way:

Before adding new shadow:
image

After adding new shadow:

image

Not sure if it's really related to these changes but something is different

@Xiaoy312
Copy link
Contributor Author

@kazo0 There might be re-layout issue with the SC on skia, that was previously not much noticeable due to background/border breaking on changes on skia. I think this just uncovers it.

@Xiaoy312 Xiaoy312 merged commit 5199415 into main Aug 22, 2023
24 checks passed
@Xiaoy312 Xiaoy312 deleted the dev/xygu/20230818/shadow-background branch August 22, 2023 17:00
@agneszitte
Copy link
Contributor

@Mergifyio backport legacy/3x

@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

backport legacy/3x

✅ Backports have been created

agneszitte pushed a commit that referenced this pull request Aug 23, 2023
Co-authored-by: xiaoy312 <xiaoyao312@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WinUI/ShadowContainer] ThemeResources used inside ShadowContainer are not changing when switching themes
4 participants