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

Added WindowManagerAddShadowHint to PopupRoot. #15238

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

grokys
Copy link
Member

@grokys grokys commented Apr 4, 2024

What does the pull request do?

Previously, the WindowManagerAddShadowHint property was defined on Popup and ContextMenu but not PopupRoot: instead various controls such as the aforementioned two and ToolTip used the PopupRoot.PlatformImpl.SetWindowManagerAddShadowHint internal method to set the "add shadow" hint. This had the downside that 3rd parties could not set this property when using PopupRoot directly.

This PR adds a WindowManagerAddShadowHint property to PopupRoot and makes the controls that previously used the internal interface use that property instead.

@@ -50,6 +56,7 @@ public PopupRoot(TopLevel parent, IPopupImpl impl, IAvaloniaDependencyResolver?
: base(impl, dependencyResolver)
{
ParentTopLevel = parent;
impl.SetWindowManagerAddShadowHint(WindowManagerAddShadowHint);
Copy link
Member Author

@grokys grokys Apr 4, 2024

Choose a reason for hiding this comment

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

This isn't ideal but the default value of false for this property appears to be different to the default value implemented in the win32 backend (true), so this is needed to communicate the actual default. I could change the backend but didn't really want to mess with that here quite honestly.

@grokys grokys added the customer-priority Issue reported by a customer with a support agreement. label Apr 4, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0046957-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6
Copy link
Member

maxkatz6 commented Apr 4, 2024

I would argue that third parties should not use PopupRoot ever. And we should make Popup api better (as well as rebase Tooltips on top of Popups).

But this PR is reasonable by itself.

@maxkatz6 maxkatz6 added this pull request to the merge queue Apr 4, 2024
@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label Apr 4, 2024
Merged via the queue into master with commit 7431e16 Apr 5, 2024
11 checks passed
@maxkatz6 maxkatz6 deleted the feature/popuproot-windowmanageraddshadowhint branch April 5, 2024 00:00
@grokys
Copy link
Member Author

grokys commented Apr 5, 2024

I would argue that third parties should not use PopupRoot ever. And we should make Popup api better (as well as rebase Tooltips on top of Popups).

Yeah, probably. But at least with 11.x PopupRoot is a public API so this PR makes sense I think. We should start by migrating our internal usage of PopupRoot to Popup I guess.

@grokys grokys added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Apr 5, 2024
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch backported-11.1.x customer-priority Issue reported by a customer with a support agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants