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

ZIndex proof-of-concept #3635

Merged
merged 4 commits into from
Dec 4, 2021
Merged

ZIndex proof-of-concept #3635

merged 4 commits into from
Dec 4, 2021

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Dec 3, 2021

Adds an int ZIndex property to IView.

The Controls implementation defaults it to zero. The z-index is honored in the layout handlers - items with a higher z-index are drawn above items with a lower z-index. The ordering happens in the handler/native view layer - the order of items in the Core layouts is preserved.

If the z-index is unused, the original behavior (items are drawn in the order they are added to the layout) is preserved.

Z-indexes can be negative, and will behave accordingly (lower values will be draw below higher values). When z-indexes of elements are equal, they will be drawn in the order they were added to the layout.

This only affects the ordering of the elements in the layouts; this implementation does not map to any native properties (e.g., Elevation on Android or CALayer.zorder on iOS). Alternate handler mappings can use those properties if desired.

@hartez hartez marked this pull request as draft December 3, 2021 00:26
@hartez hartez added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter proposal/open labels Dec 3, 2021
@hartez hartez marked this pull request as ready for review December 3, 2021 20:02
@hartez hartez enabled auto-merge (squash) December 3, 2021 20:16
@hartez hartez merged commit 18f8fd7 into main Dec 4, 2021
@hartez hartez deleted the z-index-poc branch December 4, 2021 15:31
Redth pushed a commit to jamesmontemagno/maui that referenced this pull request Dec 5, 2021
* Proof-of-concept for Windows

* Android and iOS
Fixes dotnet#3285

* Keep xplat layout up-to-date for insert tests

* Fix update test
Redth added a commit that referenced this pull request Dec 5, 2021
* WinUI3 Interop for share and file picker

* update share code

* Fix ImageButton Background on Windows (#3642)

* ZIndex proof-of-concept (#3635)

* Proof-of-concept for Windows

* Android and iOS
Fixes #3285

* Keep xplat layout up-to-date for insert tests

* Fix update test

* Call OnActivated in sample so current window gets set

* Add helper to get window handle for current window

* Use platform helper for hwnd

Co-authored-by: redth <jondick@gmail.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2023
@samhouts samhouts added the fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12! proposal/open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants