raui_core/widget/component/containers/
area_box.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{
    unpack_named_slots,
    widget::{context::WidgetContext, node::WidgetNode, unit::area::AreaBoxNode},
};

pub fn area_box(context: WidgetContext) -> WidgetNode {
    let WidgetContext {
        id, named_slots, ..
    } = context;
    unpack_named_slots!(named_slots => content);

    AreaBoxNode {
        id: id.to_owned(),
        slot: Box::new(content),
    }
    .into()
}