diff options
Diffstat (limited to 'native/src/widget.rs')
-rw-r--r-- | native/src/widget.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/native/src/widget.rs b/native/src/widget.rs index 01f5c92e..9010b06f 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -31,6 +31,8 @@ pub mod slider; pub mod text; pub mod text_input; +mod container; + #[doc(no_inline)] pub use button::Button; #[doc(no_inline)] @@ -38,6 +40,8 @@ pub use checkbox::Checkbox; #[doc(no_inline)] pub use column::Column; #[doc(no_inline)] +pub use container::Container; +#[doc(no_inline)] pub use image::Image; #[doc(no_inline)] pub use radio::Radio; @@ -52,7 +56,7 @@ pub use text::Text; #[doc(no_inline)] pub use text_input::TextInput; -use crate::{Event, Hasher, Layout, Node, Point}; +use crate::{layout, Event, Hasher, Layout, Length, Point}; /// A component that displays information and allows interaction. /// @@ -73,7 +77,19 @@ where /// [`Node`]: ../struct.Node.html /// [`Widget`]: trait.Widget.html /// [`Layout`]: ../struct.Layout.html - fn node(&self, renderer: &Renderer) -> Node; + fn layout( + &self, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node; + + fn width(&self) -> Length { + Length::Shrink + } + + fn height(&self) -> Length { + Length::Shrink + } /// Draws the [`Widget`] using the associated `Renderer`. /// |