From 32e0e7656ae038a376fe295c302c3ff4e4643ffc Mon Sep 17 00:00:00 2001 From: Adalyn Black Date: Tue, 23 Jul 2024 22:28:40 -0700 Subject: [PATCH] Moved corner radius property to be separate from the rect struct --- src/gui/canvas/builder.rs | 39 +++++---- src/gui/canvas/control.rs | 5 +- src/gui/canvas/mod.rs | 1 - src/gui/modular/mod.rs | 48 +++++++---- src/res/anchor.yaml | 9 +- src/res/settings.yaml | 168 +++++++++++++++++++++++++------------- src/res/watch.yaml | 42 ++++++---- 7 files changed, 198 insertions(+), 114 deletions(-) diff --git a/src/gui/canvas/builder.rs b/src/gui/canvas/builder.rs index 5e98dc0..66d8114 100644 --- a/src/gui/canvas/builder.rs +++ b/src/gui/canvas/builder.rs @@ -39,10 +39,11 @@ impl CanvasBuilder { } // Creates a panel with bg_color inherited from the canvas - pub fn panel(&mut self, x: f32, y: f32, w: f32, h: f32, r: f32) -> &mut Control { + pub fn panel(&mut self, x: f32, y: f32, w: f32, h: f32, radius: f32) -> &mut Control { let idx = self.canvas.controls.len(); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r }, + rect: Rect { x, y, w, h }, + corner_radius: radius, bg_color: self.bg_color, on_render_bg: Some(Control::render_rounded_rect), ..Control::new() @@ -51,10 +52,11 @@ impl CanvasBuilder { } // Creates a label with fg_color, font_size inherited from the canvas - pub fn label(&mut self, x: f32, y: f32, w: f32, h: f32, r: f32, text: Arc) -> &mut Control { + pub fn label(&mut self, x: f32, y: f32, w: f32, h: f32, radius: f32, text: Arc) -> &mut Control { let idx = self.canvas.controls.len(); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r }, + rect: Rect { x, y, w, h }, + corner_radius: radius, text, fg_color: self.fg_color, size: self.font_size, @@ -72,12 +74,13 @@ impl CanvasBuilder { y: f32, w: f32, h: f32, - r: f32, + radius: f32, text: Arc, ) -> &mut Control { let idx = self.canvas.controls.len(); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r }, + rect: Rect { x, y, w, h }, + corner_radius: radius, text, fg_color: self.fg_color, size: self.font_size, @@ -91,7 +94,8 @@ impl CanvasBuilder { pub fn sprite(&mut self, x: f32, y: f32, w: f32, h: f32) -> &mut Control { let idx = self.canvas.controls.len(); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r: 0. }, + rect: Rect { x, y, w, h }, + corner_radius: 0., on_render_bg: Some(Control::render_sprite_bg), ..Control::new() }); @@ -102,7 +106,8 @@ impl CanvasBuilder { pub fn sprite_interactive(&mut self, x: f32, y: f32, w: f32, h: f32) -> &mut Control { let idx = self.canvas.controls.len(); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r: 0. }, + rect: Rect { x, y, w, h }, + corner_radius: 0., on_render_bg: Some(Control::render_sprite_bg), on_render_hl: Some(Control::render_sprite_hl), ..Control::new() @@ -111,12 +116,13 @@ impl CanvasBuilder { } // Creates a button with fg_color, bg_color, font_size inherited from the canvas - pub fn button(&mut self, x: f32, y: f32, w: f32, h: f32, r: f32, text: Arc) -> &mut Control { + pub fn button(&mut self, x: f32, y: f32, w: f32, h: f32, radius: f32, text: Arc) -> &mut Control { let idx = self.canvas.controls.len(); self.canvas.interactive_set_idx(x, y, w, h, idx); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r }, + rect: Rect { x, y, w, h }, + corner_radius: radius, text, fg_color: self.fg_color, bg_color: self.bg_color, @@ -136,7 +142,7 @@ impl CanvasBuilder { y: f32, w: f32, h: f32, - r: f32, + radius: f32, cap_type: KeyCapType, label: &[String], ) -> &mut Control { @@ -144,7 +150,8 @@ impl CanvasBuilder { self.canvas.interactive_set_idx(x, y, w, h, idx); self.canvas.controls.push(Control { - rect: Rect { x, y, w, h, r }, + rect: Rect { x, y, w, h }, + corner_radius: radius, bg_color: self.bg_color, on_render_bg: Some(Control::render_rounded_rect), on_render_hl: Some(Control::render_highlight), @@ -159,7 +166,6 @@ impl CanvasBuilder { y, w, h: h - self.font_size as f32, - r: 0., }; vec![(render, rect, 1f32)] } @@ -170,14 +176,12 @@ impl CanvasBuilder { y: y + (self.font_size as f32) + 12., w, h, - r: 0., }; let rect1 = Rect { x: x + w * 0.5 + 12., y: y + h - (self.font_size as f32) + 8., w, h, - r: 0., }; vec![(render, rect0, 1.0), (render, rect1, 0.8)] } @@ -188,14 +192,12 @@ impl CanvasBuilder { y: y + 2.0, w, h: h * 0.5, - r: 0., }; let rect1 = Rect { x, y: y + h * 0.5 + 2.0, w, h: h * 0.5, - r: 0., }; vec![(render, rect1, 1.0), (render, rect0, 0.8)] } @@ -206,21 +208,18 @@ impl CanvasBuilder { y: y + (self.font_size as f32) + 8., w, h, - r: 0., }; let rect1 = Rect { x: x + 12., y: y + h - (self.font_size as f32) + 4., w, h, - r: 0., }; let rect2 = Rect { x: x + w * 0.5 + 8., y: y + h - (self.font_size as f32) + 4., w, h, - r: 0., }; vec![ (render, rect1, 1.0), diff --git a/src/gui/canvas/control.rs b/src/gui/canvas/control.rs index 1556966..f351a44 100644 --- a/src/gui/canvas/control.rs +++ b/src/gui/canvas/control.rs @@ -25,6 +25,7 @@ pub type ControlRendererHl = fn( pub(crate) struct Control { pub state: Option, pub rect: Rect, + pub corner_radius: f32, pub fg_color: GuiColor, pub bg_color: GuiColor, pub text: Arc, @@ -52,8 +53,8 @@ impl Control { y: 0., w: 0., h: 0., - r: 0., }, + corner_radius: 0., fg_color: Vec4::ONE, bg_color: Vec4::ZERO, text: Arc::from(""), @@ -113,7 +114,7 @@ impl Control { cmd_buffer: &mut WlxCommandBuffer, ) -> anyhow::Result<()> { let pass = { - let r = self.rect.r.min(self.rect.w / 2.0).min(self.rect.h / 2.0); + let r = self.corner_radius.min(self.rect.w / 2.0).min(self.rect.h / 2.0); let rw = r / canvas.width as f32; let ruw = r / self.rect.w as f32; let rh = r / canvas.height as f32; diff --git a/src/gui/canvas/mod.rs b/src/gui/canvas/mod.rs index 2a2cbfa..00107fa 100644 --- a/src/gui/canvas/mod.rs +++ b/src/gui/canvas/mod.rs @@ -26,7 +26,6 @@ pub struct Rect { y: f32, w: f32, h: f32, - r: f32, } pub struct CanvasData { diff --git a/src/gui/modular/mod.rs b/src/gui/modular/mod.rs index 9c92bf8..879009c 100644 --- a/src/gui/modular/mod.rs +++ b/src/gui/modular/mod.rs @@ -53,18 +53,21 @@ pub struct OverlayListTemplate { #[serde(tag = "type")] pub enum ModularElement { Panel { - rect: [f32; 5], + rect: [f32; 4], + corner_radius: f32, bg_color: Arc, }, Label { - rect: [f32; 5], + rect: [f32; 4], + corner_radius: f32, font_size: isize, fg_color: Arc, #[serde(flatten)] data: LabelContent, }, CenteredLabel { - rect: [f32; 5], + rect: [f32; 4], + corner_radius: f32, font_size: isize, fg_color: Arc, #[serde(flatten)] @@ -76,7 +79,8 @@ pub enum ModularElement { sprite_st: Option<[f32; 4]>, }, Button { - rect: [f32; 5], + rect: [f32; 4], + corner_radius: f32, font_size: isize, fg_color: Arc, bg_color: Arc, @@ -86,7 +90,8 @@ pub enum ModularElement { }, /// Convenience type to save you from having to create a bunch of labels BatteryList { - rect: [f32; 5], + rect: [f32; 4], + corner_radius: f32, font_size: isize, fg_color: Arc, fg_color_low: Arc, @@ -96,7 +101,8 @@ pub enum ModularElement { layout: ListLayout, }, OverlayList { - rect: [f32; 5], + rect: [f32; 4], + corner_radius: f32, font_size: isize, fg_color: Arc, bg_color: Arc, @@ -139,32 +145,35 @@ pub fn modular_canvas( for elem in elements.iter() { match elem { ModularElement::Panel { - rect: [x, y, w, h, r], + rect: [x, y, w, h], + corner_radius, bg_color, } => { canvas.bg_color = color_parse(bg_color).unwrap_or(*FALLBACK_COLOR); - canvas.panel(*x, *y, *w, *h, *r); + canvas.panel(*x, *y, *w, *h, *corner_radius); } ModularElement::Label { - rect: [x, y, w, h, r], + rect: [x, y, w, h], + corner_radius, font_size, fg_color, data, } => { canvas.font_size = *font_size; canvas.fg_color = color_parse(fg_color).unwrap_or(*FALLBACK_COLOR); - let label = canvas.label(*x, *y, *w, *h, *r, empty_str.clone()); + let label = canvas.label(*x, *y, *w, *h, *corner_radius, empty_str.clone()); modular_label_init(label, data); } ModularElement::CenteredLabel { - rect: [x, y, w, h, r], + rect: [x, y, w, h], + corner_radius, font_size, fg_color, data, } => { canvas.font_size = *font_size; canvas.fg_color = color_parse(fg_color).unwrap_or(*FALLBACK_COLOR); - let label = canvas.label_centered(*x, *y, *w, *h, *r, empty_str.clone()); + let label = canvas.label_centered(*x, *y, *w, *h, *corner_radius, empty_str.clone()); modular_label_init(label, data); } ModularElement::Sprite { @@ -187,7 +196,8 @@ pub fn modular_canvas( } }, ModularElement::Button { - rect: [x, y, w, h, r], + rect: [x, y, w, h], + corner_radius, font_size, bg_color, fg_color, @@ -197,11 +207,12 @@ pub fn modular_canvas( canvas.bg_color = color_parse(bg_color).unwrap_or(*FALLBACK_COLOR); canvas.fg_color = color_parse(fg_color).unwrap_or(*FALLBACK_COLOR); canvas.font_size = *font_size; - let button = canvas.button(*x, *y, *w, *h, *r, text.clone()); + let button = canvas.button(*x, *y, *w, *h, *corner_radius, text.clone()); modular_button_init(button, data); } ModularElement::BatteryList { - rect: [x, y, w, h, r], + rect: [x, y, w, h], + corner_radius, font_size, fg_color, fg_color_low, @@ -229,7 +240,7 @@ pub fn modular_canvas( button_y + 2., button_w - 4., button_h - 4., - *r, + *corner_radius, empty_str.clone(), ); modular_label_init( @@ -253,7 +264,8 @@ pub fn modular_canvas( } } ModularElement::OverlayList { - rect: [x, y, w, h, r], + rect: [x, y, w, h], + corner_radius, font_size, fg_color, bg_color, @@ -278,7 +290,7 @@ pub fn modular_canvas( button_y + 2., button_w - 4., button_h - 4., - *r, + *corner_radius, screen.name.clone(), ); diff --git a/src/res/anchor.yaml b/src/res/anchor.yaml index 0fcc652..11a9d1a 100644 --- a/src/res/anchor.yaml +++ b/src/res/anchor.yaml @@ -11,15 +11,18 @@ spawn_pos: [0, 0, -1] elements: - type: Panel - rect: [98, 0, 4, 200, 2] + rect: [98, 0, 4, 200] + corner_radius: 0 bg_color: "#ffff00" - type: Panel - rect: [0, 98, 200, 4, 2] + rect: [0, 98, 200, 4] + corner_radius: 0 bg_color: "#ffff00" - type: Label - rect: [8, 90, 600, 70, 2] + rect: [8, 90, 600, 70] + corner_radius: 0 font_size: 18 fg_color: "#ffff00" source: Static diff --git a/src/res/settings.yaml b/src/res/settings.yaml index 749367f..2885205 100644 --- a/src/res/settings.yaml +++ b/src/res/settings.yaml @@ -11,18 +11,21 @@ spawn_pos: [0, -0.1, -0.5] elements: - type: Panel - rect: [0, 0, 600, 800, 2] + rect: [0, 0, 600, 800] + corner_radius: 2 bg_color: "#102030" - type: Label - rect: [15, 35, 600, 70, 2] + rect: [15, 35, 600, 70] + corner_radius: 2 font_size: 24 fg_color: "#ffffff" source: Static text: Settings - type: Button - rect: [560, 0, 40, 40, 2] + rect: [560, 0, 40, 40] + corner_radius: 2 font_size: 16 bg_color: "#880000" fg_color: "#ffffff" @@ -33,31 +36,36 @@ elements: action: Destroy - type: Panel - rect: [50, 53, 500, 1, 2] + rect: [50, 53, 500, 1] + corner_radius: 2 bg_color: "#c0c0c0" ####### Watch Section ####### - type: Label - rect: [15, 85, 570, 24, 2] + rect: [15, 85, 570, 24] + corner_radius: 2 font_size: 18 fg_color: "#ffffff" source: Static text: Watch - type: Panel - rect: [250, 105, 1, 100, 2] + rect: [250, 105, 1, 100] + corner_radius: 2 bg_color: "#c0c0c0" - type: Label - rect: [288, 105, 100, 24, 2] + rect: [288, 105, 100, 24] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: Visibility - type: Button - rect: [270, 120, 100, 30, 2] + rect: [270, 120, 100, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -67,7 +75,8 @@ elements: action: Hide - type: Button - rect: [270, 170, 100, 30, 2] + rect: [270, 170, 100, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -77,18 +86,21 @@ elements: action: SwitchHands - type: Panel - rect: [390, 105, 1, 100, 2] + rect: [390, 105, 1, 100] + corner_radius: 2 bg_color: "#c0c0c0" - type: Label - rect: [430, 105, 120, 24, 2] + rect: [430, 105, 120, 24] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: Watch Fade - type: Button - rect: [410, 120, 140, 30, 2] + rect: [410, 120, 140, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -106,7 +118,8 @@ elements: ViewAngle: {kind: "MaxOpacity", delta: -0.01} - type: Button - rect: [410, 170, 140, 30, 2] + rect: [410, 170, 140, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -124,14 +137,16 @@ elements: ViewAngle: {kind: "MinOpacity", delta: -0.01} - type: Label - rect: [25, 140, 90, 30, 2] + rect: [25, 140, 90, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: Rotation - type: Button - rect: [108, 120, 30, 30, 2] + rect: [108, 120, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -149,7 +164,8 @@ elements: Rotation: {axis: "X", delta: -0.25} - type: Button - rect: [153, 120, 30, 30, 2] + rect: [153, 120, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -167,7 +183,8 @@ elements: Rotation: {axis: "Y", delta: -0.25} - type: Button - rect: [198, 120, 30, 30, 2] + rect: [198, 120, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -185,14 +202,16 @@ elements: Rotation: {axis: "Z", delta: -0.25} - type: Label - rect: [25, 190, 90, 30, 2] + rect: [25, 190, 90, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: Position - type: Button - rect: [108, 170, 30, 30, 2] + rect: [108, 170, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -210,7 +229,8 @@ elements: Position: {axis: "X", delta: -0.001} - type: Button - rect: [153, 170, 30, 30, 2] + rect: [153, 170, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -228,7 +248,8 @@ elements: Position: {axis: "Y", delta: -0.001} - type: Button - rect: [198, 170, 30, 30, 2] + rect: [198, 170, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#306060" @@ -246,26 +267,30 @@ elements: Position: {axis: "Z", delta: -0.001} - type: Panel - rect: [50, 220, 500, 1, 2] + rect: [50, 220, 500, 1] + corner_radius: 2 bg_color: "#c0c0c0" ####### Mirror Section ####### - type: Label - rect: [15, 255, 570, 24, 2] + rect: [15, 255, 570, 24] + corner_radius: 2 font_size: 18 fg_color: "#ffffff" source: Static text: Mirrors - type: Label - rect: [25, 290, 30, 30, 2] + rect: [25, 290, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: M1 - type: Button - rect: [60, 270, 110, 30, 2] + rect: [60, 270, 110, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -279,7 +304,8 @@ elements: action: ShowMirror # only fires if not exists - type: Button - rect: [185, 270, 60, 30, 2] + rect: [185, 270, 60, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -290,7 +316,8 @@ elements: action: ToggleInteraction - type: Button - rect: [258, 270, 30, 30, 2] + rect: [258, 270, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#880000" @@ -301,14 +328,16 @@ elements: action: Destroy - type: Label - rect: [25, 340, 30, 30, 2] + rect: [25, 340, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: M2 - type: Button - rect: [60, 320, 110, 30, 2] + rect: [60, 320, 110, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -322,7 +351,8 @@ elements: action: ShowMirror - type: Button - rect: [185, 320, 60, 30, 2] + rect: [185, 320, 60, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -333,7 +363,8 @@ elements: action: ToggleInteraction - type: Button - rect: [258, 320, 30, 30, 2] + rect: [258, 320, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#880000" @@ -344,14 +375,16 @@ elements: action: Destroy - type: Label - rect: [25, 390, 30, 30, 2] + rect: [25, 390, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: M3 - type: Button - rect: [60, 370, 110, 30, 2] + rect: [60, 370, 110, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -365,7 +398,8 @@ elements: action: ShowMirror - type: Button - rect: [185, 370, 60, 30, 2] + rect: [185, 370, 60, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -376,7 +410,8 @@ elements: action: ToggleInteraction - type: Button - rect: [258, 370, 30, 30, 2] + rect: [258, 370, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#880000" @@ -387,27 +422,31 @@ elements: action: Destroy - type: Panel - rect: [300, 240, 1, 200, 2] + rect: [300, 240, 1, 200] + corner_radius: 2 bg_color: "#c0c0c0" ####### Color Gain Section ####### - type: Label - rect: [325, 255, 90, 24, 2] + rect: [325, 255, 90, 24] + corner_radius: 2 font_size: 18 fg_color: "#ffffff" source: Static text: Color Gain - type: Label - rect: [470, 255, 90, 30, 2] + rect: [470, 255, 90, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" source: Static text: (SteamVR) - type: Button - rect: [330, 270, 60, 30, 2] + rect: [330, 270, 60, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#707070" @@ -425,7 +464,8 @@ elements: delta: -0.01 - type: Button - rect: [405, 270, 30, 30, 2] + rect: [405, 270, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#701010" @@ -443,7 +483,8 @@ elements: delta: -0.01 - type: Button - rect: [450, 270, 30, 30, 2] + rect: [450, 270, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#107010" @@ -461,7 +502,8 @@ elements: delta: -0.01 - type: Button - rect: [495, 270, 30, 30, 2] + rect: [495, 270, 30, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#101070" @@ -479,20 +521,23 @@ elements: delta: -0.01 - type: Panel - rect: [325, 315, 225, 1, 2] + rect: [325, 315, 225, 1] + corner_radius: 2 bg_color: "#c0c0c0" ####### Playspace Section ####### - type: Label - rect: [325, 345, 90, 24, 2] + rect: [325, 345, 90, 24] + corner_radius: 2 font_size: 18 fg_color: "#ffffff" source: Static text: Playspace - type: Button - rect: [330, 360, 220, 30, 2] + rect: [330, 360, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#206060" @@ -502,7 +547,8 @@ elements: action: PlayspaceFixFloor - type: Button - rect: [330, 410, 220, 30, 2] + rect: [330, 410, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#206060" @@ -514,18 +560,21 @@ elements: ####### Notifications Section ####### - type: Panel - rect: [50, 460, 500, 1, 2] + rect: [50, 460, 500, 1] + corner_radius: 2 bg_color: "#c0c0c0" - type: Label - rect: [325, 490, 90, 24, 2] + rect: [325, 490, 90, 24] + corner_radius: 2 font_size: 18 fg_color: "#ffffff" source: Static text: Notifications - type: Button - rect: [330, 505, 220, 30, 2] + rect: [330, 505, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#401010" @@ -536,7 +585,8 @@ elements: highlight: Notifications - type: Button - rect: [330, 555, 220, 30, 2] + rect: [330, 555, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#401010" @@ -548,14 +598,16 @@ elements: ####### Behavior Section ####### - type: Label - rect: [15, 490, 570, 24, 2] + rect: [15, 490, 570, 24] + corner_radius: 2 font_size: 18 fg_color: "#ffffff" source: Static text: Behavior - type: Button - rect: [30, 505, 220, 30, 2] + rect: [30, 505, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#401010" @@ -566,7 +618,8 @@ elements: highlight: AutoRealign - type: Button - rect: [30, 555, 220, 30, 2] + rect: [30, 555, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#401010" @@ -579,11 +632,13 @@ elements: ####### Footer Section ####### - type: Panel - rect: [50, 605, 500, 1, 2] + rect: [50, 605, 500, 1] + corner_radius: 2 bg_color: "#c0c0c0" - type: Button - rect: [330, 625, 220, 30, 2] + rect: [330, 625, 220, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#206060" @@ -595,7 +650,8 @@ elements: message: Settings saved successfully. - type: Button - rect: [30, 625, 250, 30, 2] + rect: [30, 625, 250, 30] + corner_radius: 2 font_size: 12 fg_color: "#ffffff" bg_color: "#206060" diff --git a/src/res/watch.yaml b/src/res/watch.yaml index 2e24a2a..e41e26a 100644 --- a/src/res/watch.yaml +++ b/src/res/watch.yaml @@ -9,11 +9,13 @@ size: [400, 200] elements: # background panel - type: Panel - rect: [0, 0, 400, 200, 3] + rect: [0, 0, 400, 200] + corner_radius: 3 bg_color: "#353535" - type: Button - rect: [2, 162, 26, 36, 3] + rect: [2, 162, 26, 36] + corner_radius: 3 font_size: 14 bg_color: "#808040" fg_color: "#ffffff" @@ -28,7 +30,8 @@ elements: # Keyboard button - type: Button - rect: [32, 162, 60, 36, 3] + rect: [32, 162, 60, 36] + corner_radius: 3 font_size: 14 fg_color: "#FFFFFF" bg_color: "#406050" @@ -62,7 +65,8 @@ elements: # bottom row, of keyboard + overlays - type: OverlayList - rect: [94, 160, 306, 40, 3] + rect: [94, 160, 306, 40] + corner_radius: 3 font_size: 14 fg_color: "#FFFFFF" bg_color: "#405060" @@ -78,7 +82,8 @@ elements: # local clock - type: Label - rect: [19, 90, 200, 50, 3] + rect: [19, 90, 200, 50] + corner_radius: 3 font_size: 46 # Use 32 for 12-hour time fg_color: "#ffffff" source: Clock @@ -87,7 +92,8 @@ elements: # local date - type: Label - rect: [20, 117, 200, 20, 3] + rect: [20, 117, 200, 20] + corner_radius: 3 font_size: 14 fg_color: "#ffffff" source: Clock @@ -95,7 +101,8 @@ elements: # local day-of-week - type: Label - rect: [20, 137, 200, 50, 3] + rect: [20, 137, 200, 50] + corner_radius: 3 font_size: 14 fg_color: "#ffffff" source: Clock @@ -104,7 +111,8 @@ elements: # alt clock 1 - type: Label - rect: [210, 90, 200, 50, 3] + rect: [210, 90, 200, 50] + corner_radius: 3 font_size: 24 # Use 18 for 12-hour time fg_color: "#99BBAA" source: Clock @@ -112,7 +120,8 @@ elements: format: "%H:%M" # 23:59 #format: "%I:%M %p" # 11:59 PM - type: Label - rect: [210, 60, 200, 50, 3] + rect: [210, 60, 200, 50] + corner_radius: 3 font_size: 14 fg_color: "#99BBAA" source: Static @@ -120,7 +129,8 @@ elements: # alt clock 2 - type: Label - rect: [210, 150, 200, 50, 3] + rect: [210, 150, 200, 50] + corner_radius: 3 font_size: 24 # Use 18 for 12-hour time fg_color: "#AA99BB" source: Clock @@ -128,7 +138,8 @@ elements: format: "%H:%M" # 23:59 #format: "%I:%M %p" # 11:59 PM - type: Label - rect: [210, 120, 200, 50, 3] + rect: [210, 120, 200, 50] + corner_radius: 3 font_size: 14 fg_color: "#AA99BB" source: Static @@ -136,7 +147,8 @@ elements: # batteries - type: BatteryList - rect: [0, 0, 400, 30, 3] + rect: [0, 0, 400, 30] + corner_radius: 3 font_size: 14 fg_color: "#99BBAA" fg_color_low: "#B06060" @@ -147,7 +159,8 @@ elements: # volume buttons - type: Button - rect: [327, 52, 46, 32, 3] + rect: [327, 52, 46, 32] + corner_radius: 3 font_size: 14 fg_color: "#FFFFFF" bg_color: "#505050" @@ -156,7 +169,8 @@ elements: - type: Exec command: [ "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%" ] - type: Button - rect: [327, 116, 46, 32, 3] + rect: [327, 116, 46, 32] + corner_radius: 3 font_size: 14 fg_color: "#FFFFFF" bg_color: "#505050"