wgui: use dark mode

This commit is contained in:
Aleksander
2025-09-20 13:32:07 +02:00
parent 0f82fb4144
commit aadf11590e
8 changed files with 23 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<layout>
<elements>
<rectangle
color="#AAAAAA"
color="#888888"
width="1000" height="500" min_width="1000" min_height="500"
gap="4" flex_direction="column"
overflow_y="scroll">
@@ -24,7 +24,7 @@
<CheckBox text="i'm checked by default" checked="1" />
</div>
<label text="custom attrib test, you should see size rectangles below, each of them in R, G and B (if TESTBED is generic)" />
<label text="custom attrib test, you should see size rectangles below, each of them in R, G and B (if TESTBED is not set)" />
<div flex_direction="row" gap="8">
<label text="lighter:" />

View File

@@ -21,7 +21,13 @@ impl TestbedAny {
pub fn new(name: &str, listeners: &mut EventListenerCollection<(), ()>) -> anyhow::Result<Self> {
let path = format!("gui/{name}.xml");
let globals = WguiGlobals::new(Box::new(assets::Asset {}), Default::default())?;
let globals = WguiGlobals::new(
Box::new(assets::Asset {}),
wgui::globals::Defaults {
dark_mode: true,
text_color: wgui::drawing::Color::new(1.0, 1.0, 1.0, 1.0),
},
)?;
let (layout, state) = wgui::parser::new_layout_from_assets(
listeners,

View File

@@ -59,7 +59,13 @@ impl TestbedGeneric {
pub fn new(listeners: &mut EventListenerCollection<(), ()>) -> anyhow::Result<Self> {
const XML_PATH: &str = "gui/various_widgets.xml";
let globals = WguiGlobals::new(Box::new(assets::Asset {}), Default::default())?;
let globals = WguiGlobals::new(
Box::new(assets::Asset {}),
wgui::globals::Defaults {
text_color: wgui::drawing::Color::new(1.0, 1.0, 1.0, 1.0),
dark_mode: true,
},
)?;
let extra = ParseDocumentExtra {
on_custom_attribs: Some(Box::new(move |par| {