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

Make ComboBox dropdown respect scale transform #8042

Merged
merged 5 commits into from
May 5, 2022

Conversation

grokys
Copy link
Member

@grokys grokys commented Apr 25, 2022

What does the pull request do?

Fixes #7147 by making ComboBox's dropdown respect the ComboBox scale transform.

  • Adds a Popup.InheritsTransform property
  • Sets this to true in the ComboBox template(s)
  • Adds a Transform property to PopupRoot and OverlayPopupHost
  • Adds a LayoutTransformControl to PopupRoot and OverlayPopupHost's template, with its transform bound to this Transform property
  • Applies transform from the Popup placement target to the PopupRoot.Transform/OverlayPopupHost.Transformproperty whenInheritsTransform` is set
  • Applies the transform also to the PopupRoot/OverlayPopupHost's min/max/width/height setting
    • In order to do this, the rather hacky BindConstraints method was removed from IPopupHost and the relevant properties were instead added to the interface and set from Popup

Note that only scale transforms are currently handled correctly; rotate transforms are not handled correctly. This is because our popup positioning API (which comes from Wayland) makes applying rotate transforms rather difficult as the popup position is based on a Rect on the parent window. It will probably be possible to correctly handle rotate transforms here, but should probably be done in a separate PR if anyone fancies tackling it - as it may be tricky.

Breaking Changes

Changes the API of the IPopupHost interface.

Fixed issues

Fixes #7147

grokys added 3 commits April 22, 2022 21:59
It was probably not a good idea to test the contents of the template explicitly in unit tests, but here we are...
@grokys grokys requested review from kekekeks and MarchingCube April 25, 2022 08:58
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0020112-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@grokys grokys enabled auto-merge May 5, 2022 14:54
@grokys grokys merged commit 825e0cc into master May 5, 2022
@grokys grokys deleted the fixes/7147-combobox-transform branch May 5, 2022 15:14
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0020232-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComboBox's dropdown menu does not respect visual transform
3 participants