diff --git a/showbits-common/src/lib.rs b/showbits-common/src/lib.rs index 4b1f0b5..82ec1ab 100644 --- a/showbits-common/src/lib.rs +++ b/showbits-common/src/lib.rs @@ -5,3 +5,4 @@ mod rect; mod vec2; mod view; mod widget; +pub mod widgets; diff --git a/showbits-common/src/widgets.rs b/showbits-common/src/widgets.rs new file mode 100644 index 0000000..43725cc --- /dev/null +++ b/showbits-common/src/widgets.rs @@ -0,0 +1,3 @@ +pub use empty::Empty; + +mod empty; diff --git a/showbits-common/src/widgets/empty.rs b/showbits-common/src/widgets/empty.rs new file mode 100644 index 0000000..d397c65 --- /dev/null +++ b/showbits-common/src/widgets/empty.rs @@ -0,0 +1,23 @@ +use crate::{Vec2, View, Widget}; + +pub struct Empty {} + +impl Empty { + pub fn new() -> Self { + Self {} + } +} + +impl Default for Empty { + fn default() -> Self { + Self::new() + } +} + +impl Widget for Empty { + fn size(&self, _max_width: Option, _max_height: Option) -> Vec2 { + Vec2::ZERO + } + + fn draw(self, _view: &mut View<'_, C>) {} +}