Add Layer widget
This commit is contained in:
parent
72b44fb3fc
commit
7c3277a822
3 changed files with 76 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use crate::widgets::{Background, Border, Float, Padding};
|
||||
use crate::widgets::{Background, Border, Float, Padding, Layer};
|
||||
use crate::{Frame, Size};
|
||||
|
||||
// TODO Feature-gate these traits
|
||||
|
|
@ -41,6 +41,14 @@ pub trait WidgetExt: Sized {
|
|||
Float::new(self)
|
||||
}
|
||||
|
||||
fn below<W>(self, top: W) -> Layer<Self, W> {
|
||||
Layer::new(self, top)
|
||||
}
|
||||
|
||||
fn above<W>(self, bottom: W) -> Layer<W, Self> {
|
||||
Layer::new(bottom, self)
|
||||
}
|
||||
|
||||
fn padding(self) -> Padding<Self> {
|
||||
Padding::new(self)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue