From 204eb95fa50aa4e680ed44fef77d68724359a842 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 12 Jul 2022 21:42:21 +0200 Subject: [PATCH] Add Empty widget --- src/ui/widgets.rs | 1 + src/ui/widgets/empty.rs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/ui/widgets/empty.rs diff --git a/src/ui/widgets.rs b/src/ui/widgets.rs index 3a2d948..7b406f2 100644 --- a/src/ui/widgets.rs +++ b/src/ui/widgets.rs @@ -1,4 +1,5 @@ pub mod background; +pub mod empty; pub mod list; pub mod text; diff --git a/src/ui/widgets/empty.rs b/src/ui/widgets/empty.rs new file mode 100644 index 0000000..2ef28d9 --- /dev/null +++ b/src/ui/widgets/empty.rs @@ -0,0 +1,15 @@ +use async_trait::async_trait; +use toss::frame::{Frame, Pos, Size}; + +use super::Widget; + +pub struct Empty; + +#[async_trait] +impl Widget for Empty { + fn size(&self, _frame: &mut Frame, _max_width: Option, _max_height: Option) -> Size { + Size::ZERO + } + + async fn render(self: Box, _frame: &mut Frame, _pos: Pos, _size: Size) {} +}