custom panel to have a state different from ()
This commit is contained in:
@@ -12,15 +12,18 @@ use crate::{
|
|||||||
windowing::window::{OverlayCategory, OverlayWindowConfig},
|
windowing::window::{OverlayCategory, OverlayWindowConfig},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CustomPanelState {}
|
||||||
|
|
||||||
pub fn create_custom(app: &mut AppState, name: Arc<str>) -> Option<OverlayWindowConfig> {
|
pub fn create_custom(app: &mut AppState, name: Arc<str>) -> Option<OverlayWindowConfig> {
|
||||||
let params = NewGuiPanelParams {
|
let params = NewGuiPanelParams {
|
||||||
external_xml: true,
|
external_xml: true,
|
||||||
..NewGuiPanelParams::default()
|
..NewGuiPanelParams::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut panel = GuiPanel::new_from_template(app, &format!("gui/{name}.xml"), (), params)
|
let mut panel =
|
||||||
.inspect_err(|e| log::warn!("Error creating '{name}': {e:?}"))
|
GuiPanel::new_from_template(app, &format!("gui/{name}.xml"), CustomPanelState {}, params)
|
||||||
.ok()?;
|
.inspect_err(|e| log::warn!("Error creating '{name}': {e:?}"))
|
||||||
|
.ok()?;
|
||||||
|
|
||||||
panel
|
panel
|
||||||
.update_layout()
|
.update_layout()
|
||||||
|
|||||||
Reference in New Issue
Block a user