mirror of https://github.com/wayvr-org/wayvr.git
24 lines
629 B
Rust
24 lines
629 B
Rust
use crate::{
|
|
layout::WidgetID,
|
|
parser::{AttribPair, ParserContext, ParserFile, parse_children, parse_widget_universal, style::parse_style},
|
|
widget::div::WidgetDiv,
|
|
};
|
|
|
|
pub fn parse_widget_div<'a>(
|
|
file: &ParserFile,
|
|
ctx: &mut ParserContext,
|
|
node: roxmltree::Node<'a, 'a>,
|
|
parent_id: WidgetID,
|
|
attribs: &[AttribPair],
|
|
tag_name: &str,
|
|
) -> anyhow::Result<WidgetID> {
|
|
let style = parse_style(ctx, attribs, tag_name);
|
|
|
|
let (widget, _) = ctx.layout.add_child(parent_id, WidgetDiv::create(), style)?;
|
|
|
|
parse_widget_universal(ctx, &widget, attribs, tag_name);
|
|
parse_children(file, ctx, node, widget.id)?;
|
|
|
|
Ok(widget.id)
|
|
}
|