Skip to content

Commit

Permalink
Add zstack view to compose views on top of each other (#737)
Browse files Browse the repository at this point in the history
Adds a new `zstack` Xilem view (along with an accompanied Masonry
widget).
The view is inspired by the [ZStack view in
SwiftUI](https://developer.apple.com/documentation/swiftui/zstack),
which composes the child view on top of each other.

This pull-request is still work-in-progress.

- [x] It doesn't allow for changing the layout when BoxConstraints of
the children are different.
(top-left, top-right, bottom-left, bottom-right, center).
- [x] I want to update `http_cat` to put copyright on top of image like
seen below.
<img width="500" alt="Screenshot 2024-11-10 at 17 46 45"
src="https://github.com/user-attachments/assets/004d5779-142e-45a2-92d2-bdd5ddd9e2d1">
  • Loading branch information
viktorstrate authored Jan 8, 2025
1 parent cb58d7b commit 84dce88
Show file tree
Hide file tree
Showing 16 changed files with 872 additions and 8 deletions.
2 changes: 2 additions & 0 deletions masonry/src/widget/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mod text_area;
mod textbox;
mod variable_label;
mod widget_arena;
mod zstack;

pub use self::image::Image;
pub use align::Align;
Expand All @@ -54,6 +55,7 @@ pub use variable_label::VariableLabel;
pub use widget_mut::WidgetMut;
pub use widget_pod::WidgetPod;
pub use widget_ref::WidgetRef;
pub use zstack::{Alignment, ChildAlignment, HorizontalAlignment, VerticalAlignment, ZStack};

pub(crate) use widget_arena::WidgetArena;
pub(crate) use widget_state::WidgetState;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 84dce88

Please sign in to comment.