pub fn overlay<MSG>(
    mut attrs: Vec<Attribute<MSG>>,
    mut children: Vec<Node<MSG>>,
) -> Node<MSG>
where
    MSG: 'static,
{
    let spec_width = find_value(AttribKey::Width, &attrs)
        .map(|w| w.as_f64())
        .flatten();
    let spec_height = find_value(AttribKey::Height, &attrs)
        .map(|w| w.as_f64())
        .flatten();

    children.iter_mut().for_each(|child| {
        child.add_attributes_ref_mut(vec![attr(
            AttribKey::PositionType,
            Value::from(PositionType::Absolute),
        )]);
    });

    attrs.push(style(Style {
        size: Size {
            width: if let Some(width) = spec_width {
                Dimension::Points(width as f32)
            } else {
                Dimension::Percent(1.0)
            },
            height: if let Some(height) = spec_height {
                Dimension::Points(height as f32)
            } else {
                Dimension::Percent(1.0)
            },
        },
        ..Default::default()
    }));
    widget(Widget::Overlay, attrs, children)
}
/// overlay can be on top of other widgets
overlay can be on top of other widgets
overlay can be on top of other widgets
pub fn overlay<MSG>(
    mut attrs: Vec<Attribute<MSG>>,
    mut children: Vec<Node<MSG>>,
) -> Node<MSG>
where
    MSG: 'static,
{
    let spec_width = find_value(AttribKey::Width, &attrs)
        .map(|w| w.as_f64())
        .flatten();
    let spec_height = find_value(AttribKey::Height, &attrs)
        .map(|w| w.as_f64())
        .flatten();
    children.iter_mut().for_each(|child| {
        child.add_attributes_ref_mut(vec![attr(
            AttribKey::PositionType,
            Value::from(PositionType::Absolute),
        )]);
    });
    attrs.push(style(Style {
        size: Size {
            width: if let Some(width) = spec_width {
                Dimension::Points(width as f32)
            } else {
                Dimension::Percent(1.0)
            },
            height: if let Some(height) = spec_height {
                Dimension::Points(height as f32)
            } else {
                Dimension::Percent(1.0)
            },
        },
        ..Default::default()
    }));
    widget(Widget::Overlay, attrs, children)
}
pub fn overlay < MSG > ( mut attrs : Vec < Attribute < MSG > > , mut children : Vec < Node < MSG > > , ) -> Node < MSG > where MSG : ' static , { let spec_width = find_value ( AttribKey :: Width , & attrs ) . map ( | w | w . as_f64 ( ) ) . flatten ( ) ; let spec_height = find_value ( AttribKey :: Height , & attrs ) . map ( | w | w . as_f64 ( ) ) . flatten ( ) ; children . iter_mut ( ) . for_each ( | child | { child . add_attributes_ref_mut ( vec ! [ attr ( AttribKey PositionType Value from ( PositionType Absolute ) ) ] ) ; } ) ; attrs . push ( style ( Style { size : Size { width : if let Some ( width ) = spec_width { Dimension :: Points ( width as f32 ) } else { Dimension :: Percent ( 1.0 ) } , height : if let Some ( height ) = spec_height { Dimension :: Points ( height as f32 ) } else { Dimension :: Percent ( 1.0 ) } , } , .. Default :: default ( ) } ) ) ; widget ( Widget :: Overlay , attrs , children ) }
overlay can be on top of other widgets
overlay can be on top of other widgets
attrs
Vec<Attribute<MSG>>
children
Vec<Node<MSG>>
attrs
Vec<Attribute<MSG>>
children
Vec<Node<MSG>>