wgui: customizable defaults
This commit is contained in:
@@ -170,7 +170,6 @@ fn new_toast(toast: Toast, app: &mut AppState) -> Option<(OverlayState, Box<dyn
|
||||
let mut panel = GuiPanel::new_blank(app, ()).ok()?;
|
||||
|
||||
let globals = panel.layout.state.globals.clone();
|
||||
let mut i18n = globals.i18n();
|
||||
|
||||
let (rect, _) = panel
|
||||
.layout
|
||||
@@ -196,7 +195,7 @@ fn new_toast(toast: Toast, app: &mut AppState) -> Option<(OverlayState, Box<dyn
|
||||
let _ = panel.layout.add_child(
|
||||
rect,
|
||||
WidgetLabel::create(
|
||||
&mut i18n,
|
||||
&mut globals.get(),
|
||||
WidgetLabelParams {
|
||||
content: Translation::from_raw_text(&title),
|
||||
style: TextStyle {
|
||||
@@ -218,7 +217,7 @@ fn new_toast(toast: Toast, app: &mut AppState) -> Option<(OverlayState, Box<dyn
|
||||
let _ = panel.layout.add_child(
|
||||
rect,
|
||||
WidgetLabel::create(
|
||||
&mut i18n,
|
||||
&mut globals.get(),
|
||||
WidgetLabelParams {
|
||||
content: Translation::from_raw_text(&toast.body),
|
||||
style: TextStyle {
|
||||
|
||||
@@ -90,7 +90,12 @@ impl AppState {
|
||||
screens: smallvec![],
|
||||
anchor: Affine3A::IDENTITY,
|
||||
toast_sound: toast_sound_wav,
|
||||
wgui_globals: WguiGlobals::new(Box::new(gui::asset::GuiAsset {}))?,
|
||||
wgui_globals: WguiGlobals::new(
|
||||
Box::new(gui::asset::GuiAsset {}),
|
||||
wgui::globals::Defaults {
|
||||
text_color: wgui::drawing::Color::new(1.0, 1.0, 1.0, 1.0),
|
||||
},
|
||||
)?,
|
||||
|
||||
#[cfg(feature = "osc")]
|
||||
osc_sender,
|
||||
|
||||
Reference in New Issue
Block a user