Add Resize widget

This commit is contained in:
Joscha 2023-02-18 20:24:56 +01:00
parent ba716dd089
commit b27cb81642
3 changed files with 112 additions and 1 deletions

View file

@ -1,6 +1,8 @@
use async_trait::async_trait;
use crate::widgets::{Background, Border, Either, Either3, Float, JoinSegment, Layer, Padding};
use crate::widgets::{
Background, Border, Either, Either3, Float, JoinSegment, Layer, Padding, Resize,
};
use crate::{Frame, Size};
// TODO Feature-gate these traits
@ -76,6 +78,10 @@ pub trait WidgetExt: Sized {
fn padding(self) -> Padding<Self> {
Padding::new(self)
}
fn resize(self) -> Resize<Self> {
Resize::new(self)
}
}
// It would be nice if this could be restricted to types implementing Widget.