1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::*;

#[derive(Clone)]
pub struct Spacer {}

impl View for Spacer {
    fn draw(&self, _id: ViewId, _args: &mut DrawArgs) {}
    fn layout(&self, _id: ViewId, _args: &mut LayoutArgs) -> LocalSize {
        [0.0, 0.0].into()
    }

    fn is_flexible(&self) -> bool {
        true
    }
}

impl private::Sealed for Spacer {}

/// Inserts a flexible space in a stack.
pub fn spacer() -> Spacer {
    Spacer {}
}