diff options
Diffstat (limited to 'native/src/widget.rs')
-rw-r--r-- | native/src/widget.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/native/src/widget.rs b/native/src/widget.rs index ff765ee6..48605ee3 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -23,6 +23,7 @@ pub mod button; pub mod checkbox; pub mod column; +pub mod container; pub mod image; pub mod radio; pub mod row; @@ -31,8 +32,6 @@ pub mod slider; pub mod text; pub mod text_input; -mod container; - #[doc(no_inline)] pub use button::Button; #[doc(no_inline)] @@ -65,12 +64,18 @@ use crate::{layout, Event, Hasher, Layout, Length, Point}; /// /// [`Widget`]: trait.Widget.html /// [`Element`]: ../struct.Element.html -pub trait Widget<Message, Renderer>: std::fmt::Debug +pub trait Widget<Message, Renderer> where Renderer: crate::Renderer, { + /// Returns the width of the [`Widget`]. + /// + /// [`Widget`]: trait.Widget.html fn width(&self) -> Length; + /// Returns the height of the [`Widget`]. + /// + /// [`Widget`]: trait.Widget.html fn height(&self) -> Length; /// Returns the [`Node`] of the [`Widget`]. |