Make width and height required methods
This commit is contained in:
parent
2cbd5d60c4
commit
6cdf69e76b
13 changed files with 78 additions and 10 deletions
|
|
@ -69,6 +69,10 @@ pub trait Widget<Message, Renderer>: std::fmt::Debug
|
|||
where
|
||||
Renderer: crate::Renderer,
|
||||
{
|
||||
fn width(&self) -> Length;
|
||||
|
||||
fn height(&self) -> Length;
|
||||
|
||||
/// Returns the [`Node`] of the [`Widget`].
|
||||
///
|
||||
/// This [`Node`] is used by the runtime to compute the [`Layout`] of the
|
||||
|
|
@ -83,14 +87,6 @@ where
|
|||
limits: &layout::Limits,
|
||||
) -> layout::Node;
|
||||
|
||||
fn width(&self) -> Length {
|
||||
Length::Shrink
|
||||
}
|
||||
|
||||
fn height(&self) -> Length {
|
||||
Length::Shrink
|
||||
}
|
||||
|
||||
/// Draws the [`Widget`] using the associated `Renderer`.
|
||||
///
|
||||
/// [`Widget`]: trait.Widget.html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue