wgui: customizable defaults
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
|
||||
<!-- Right bottom side -->
|
||||
<div margin_right="16">
|
||||
<label text="12:34" color="#FFFFFF" size="16" />
|
||||
<label text="12:34" size="16" />
|
||||
</div>
|
||||
</rectangle>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
justify_content="center"
|
||||
flex_direction="column">
|
||||
<sprite src="${icon}" width="32" height="32" />
|
||||
<label weight="bold" color="#FFFFFF" size="18" text="${text}" />
|
||||
<label weight="bold" size="18" text="${text}" />
|
||||
</div>
|
||||
</Button>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<layout>
|
||||
|
||||
<elements>
|
||||
<label text="Apps" size="64" weight="bold" color="#FFFFFF" />
|
||||
<label text="Apps" size="64" weight="bold" />
|
||||
<label text="bottom text" size="16" weight="bold" color="#FFFFFF88" />
|
||||
</elements>
|
||||
</layout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<layout>
|
||||
<elements>
|
||||
<label text="Games" size="32" weight="bold" color="#FFFFFF" />
|
||||
<label text="Games" size="32" weight="bold" />
|
||||
</elements>
|
||||
</layout>
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<elements>
|
||||
<sprite src="dashboard/wayvr_dashboard.svg" min_width="96" min_height="96" />
|
||||
<label text="Hello, user!" size="32" weight="bold" color="#FFFFFF" />
|
||||
<label text="Hello, user!" size="32" weight="bold" />
|
||||
<label text="Connected to wlx-overlay-s" size="16" weight="bold" color="#bbffbb" />
|
||||
|
||||
<!-- main button list -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<layout>
|
||||
<elements>
|
||||
<label text="Monado" size="32" weight="bold" color="#FFFFFF" />
|
||||
<label text="Monado" size="32" weight="bold" />
|
||||
</elements>
|
||||
</layout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<layout>
|
||||
<elements>
|
||||
<label text="Processes" size="32" weight="bold" color="#FFFFFF" />
|
||||
<label text="Processes" size="32" weight="bold" />
|
||||
</elements>
|
||||
</layout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<layout>
|
||||
<elements>
|
||||
<label text="Settings" size="32" weight="bold" color="#FFFFFF" />
|
||||
<label text="Settings" size="32" weight="bold" />
|
||||
</elements>
|
||||
</layout>
|
||||
@@ -3,6 +3,7 @@ use std::{cell::RefCell, collections::VecDeque, rc::Rc};
|
||||
use glam::Vec2;
|
||||
use wgui::{
|
||||
components::button::ComponentButton,
|
||||
drawing,
|
||||
event::EventListenerCollection,
|
||||
globals::WguiGlobals,
|
||||
layout::{LayoutParams, RcLayout},
|
||||
@@ -41,7 +42,12 @@ pub struct FrontendParams<'a> {
|
||||
|
||||
impl Frontend {
|
||||
pub fn new(params: FrontendParams) -> anyhow::Result<(RcFrontend, RcLayout)> {
|
||||
let globals = WguiGlobals::new(Box::new(assets::Asset {}))?;
|
||||
let globals = WguiGlobals::new(
|
||||
Box::new(assets::Asset {}),
|
||||
wgui::globals::Defaults {
|
||||
text_color: drawing::Color::new(1.0, 1.0, 1.0, 1.0),
|
||||
},
|
||||
)?;
|
||||
|
||||
let (layout, state) = wgui::parser::new_layout_from_assets(
|
||||
params.listeners,
|
||||
|
||||
Reference in New Issue
Block a user