diff --git a/src/widgets/float.rs b/src/widgets/float.rs index 6c35504..602c793 100644 --- a/src/widgets/float.rs +++ b/src/widgets/float.rs @@ -31,6 +31,34 @@ impl Float { self.horizontal(position).vertical(position) } + pub fn left(self) -> Self { + self.horizontal(0.0) + } + + pub fn right(self) -> Self { + self.horizontal(1.0) + } + + pub fn top(self) -> Self { + self.vertical(0.0) + } + + pub fn bottom(self) -> Self { + self.vertical(1.0) + } + + pub fn center_h(self) -> Self { + self.horizontal(0.5) + } + + pub fn center_v(self) -> Self { + self.vertical(0.5) + } + + pub fn center(self) -> Self { + self.all(0.5) + } + fn push_inner(&self, frame: &mut Frame, size: Size, mut inner_size: Size) { let mut inner_pos = Pos::ZERO;