sliders (wip), fix wlx build

This commit is contained in:
Aleksander
2025-06-28 19:28:05 +02:00
parent 28d58fef59
commit 9d0c0f015c
15 changed files with 323 additions and 60 deletions

View File

@@ -42,8 +42,13 @@ impl<S> GuiPanel<S> {
path: &str,
state: S,
) -> anyhow::Result<(Self, ParserResult)> {
let (layout, parser_result) =
wgui::parser::new_layout_from_assets(Box::new(gui::asset::GuiAsset {}), path)?;
let mut listeners = EventListenerCollection::<AppState, S>::default();
let (layout, parser_result) = wgui::parser::new_layout_from_assets(
Box::new(gui::asset::GuiAsset {}),
&mut listeners,
path,
)?;
let context = WguiContext::new(&mut app.wgui_shared, 1.0)?;
let mut timestep = Timestep::new();
@@ -56,7 +61,7 @@ impl<S> GuiPanel<S> {
timestep,
state,
timers: vec![],
listeners: EventListenerCollection::default(),
listeners,
},
parser_result,
))

View File

@@ -77,6 +77,7 @@ where
let (_, mut gui_state_key) = wgui::parser::new_layout_from_assets(
Box::new(gui::asset::GuiAsset {}),
&mut panel.listeners,
"gui/keyboard.xml",
)?;
@@ -156,7 +157,13 @@ where
}
let template_key = format!("Key{:?}", key.cap_type);
gui_state_key.process_template(&template_key, &mut panel.layout, div, params)?;
gui_state_key.process_template(
&template_key,
&mut panel.layout,
&mut panel.listeners,
div,
params,
)?;
if let Some(widget_id) = gui_state_key.ids.get(&*my_id) {
let key_state = {