wgui: interactable components, rename TextLabel -> WidgetLabel

This commit is contained in:
Aleksander
2025-08-10 11:46:01 +02:00
parent 91e584383f
commit 93a3fee349
26 changed files with 294 additions and 174 deletions

View File

@@ -5,7 +5,7 @@ use crate::{
ParserContext, ParserFile, iter_attribs, parse_children, parse_widget_universal,
style::{parse_style, parse_text_style},
},
widget::text::{TextLabel, TextParams},
widget::label::{WidgetLabelParams, WidgetLabel},
};
pub fn parse_widget_label<'a, U1, U2>(
@@ -14,7 +14,7 @@ pub fn parse_widget_label<'a, U1, U2>(
node: roxmltree::Node<'a, 'a>,
parent_id: WidgetID,
) -> anyhow::Result<()> {
let mut params = TextParams::default();
let mut params = WidgetLabelParams::default();
let attribs: Vec<_> = iter_attribs(file, ctx, &node, false).collect();
let style = parse_style(&attribs);
@@ -36,7 +36,7 @@ pub fn parse_widget_label<'a, U1, U2>(
let (new_id, _) =
ctx
.layout
.add_child(parent_id, TextLabel::create(&mut i18n, params)?, style)?;
.add_child(parent_id, WidgetLabel::create(&mut i18n, params)?, style)?;
parse_widget_universal(file, ctx, node, new_id)?;
parse_children(file, ctx, node, new_id)?;