dash-frontend: Use native <Button>s, children support

This commit is contained in:
Aleksander
2025-09-13 12:49:36 +02:00
parent c2628c0a15
commit 9efe298f65
13 changed files with 117 additions and 82 deletions

View File

@@ -8,7 +8,7 @@ use wgui::{
MouseButtonIndex, MouseDownEvent, MouseLeaveEvent, MouseMotionEvent, MouseUpEvent,
MouseWheelEvent,
},
layout::Layout,
layout::{Layout, LayoutParams},
parser::ParserState,
renderer_vk::context::Context as WguiContext,
};
@@ -50,6 +50,7 @@ impl<S> GuiPanel<S> {
path,
extra: Default::default(),
},
&LayoutParams::default(),
)?;
let context = WguiContext::new(&mut app.wgui_shared, 1.0)?;
@@ -70,7 +71,7 @@ impl<S> GuiPanel<S> {
}
pub fn new_blank(app: &mut AppState, state: S) -> anyhow::Result<Self> {
let layout = Layout::new(app.wgui_globals.clone())?;
let layout = Layout::new(app.wgui_globals.clone(), &LayoutParams::default())?;
let context = WguiContext::new(&mut app.wgui_shared, 1.0)?;
let mut timestep = Timestep::new();
timestep.set_tps(60.0);

View File

@@ -5,6 +5,7 @@ use wgui::{
animation::{Animation, AnimationEasing},
drawing::Color,
event::{self, CallbackMetadata, EventListenerKind},
layout::LayoutParams,
renderer_vk::util,
taffy::{self, prelude::length},
widget::{
@@ -80,8 +81,11 @@ where
extra: Default::default(),
};
let (_, mut gui_state_key) =
wgui::parser::new_layout_from_assets(&mut panel.listeners, &parse_doc_params)?;
let (_, mut gui_state_key) = wgui::parser::new_layout_from_assets(
&mut panel.listeners,
&parse_doc_params,
&LayoutParams::default(),
)?;
for row in 0..layout.key_sizes.len() {
let (div, _) = panel.layout.add_child(