Make width and height required methods

This commit is contained in:
Héctor Ramón Jiménez 2019-11-16 22:08:49 +01:00
parent 2cbd5d60c4
commit 6cdf69e76b
13 changed files with 78 additions and 10 deletions

View file

@ -7,7 +7,7 @@
//! [`Class`]: enum.Class.html
use crate::input::{mouse, ButtonState};
use crate::{layout, Element, Event, Hasher, Layout, Point, Widget};
use crate::{layout, Element, Event, Hasher, Layout, Length, Point, Widget};
use std::hash::Hash;
pub use iced_core::button::State;
@ -21,6 +21,14 @@ where
Renderer: self::Renderer,
Message: Clone + std::fmt::Debug,
{
fn width(&self) -> Length {
self.width
}
fn height(&self) -> Length {
Length::Shrink
}
fn layout(
&self,
renderer: &Renderer,