From 6cdf69e76b8052fb726d5c2bf6c9746182e04d05 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 16 Nov 2019 22:08:49 +0100 Subject: Make `width` and `height` required methods --- native/src/widget.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'native/src/widget.rs') diff --git a/native/src/widget.rs b/native/src/widget.rs index 9010b06f..ff765ee6 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -69,6 +69,10 @@ pub trait Widget: 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 -- cgit