git.lucas.co / cce-status-interface
status bar
git clone https://git.lucas.co/cce-status-interface.git

commitb237c4c50f347cb5af5bd444fd10de3c0486e394
parent528db0a32f
authorLucas Galante <[email protected]>
date2026-08-18 14:50
refactor: remove the dead whole-bar background chain

Every StatusApp is a single --module segment (the no-arg form is the
launcher daemon and never creates a surface), so the branch painting
current_bg_color was unreachable. Deleting it also removes
read_bg_color_from_config, whose legacy keys had no canonical location
and always resolved via the fuzzy fallback — where the depth-first
search for "background_color" landed on unrelated widget colors.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/config.rs | 13 -------------
 src/main.rs   | 17 +++++------------
 2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/src/config.rs b/src/config.rs
index aa5d79a..203d28c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -217,19 +217,6 @@ pub(crate) fn parse_font_for_alias(content: &str, alias: &str) -> Option<String>
     None
 }
 
-/// The whole-bar background, from a chain of legacy desktop-background keys.
-/// None of these has an established canonical location — the top-level
-/// pointers are aspirational, so today these normally resolve via the fuzzy
-/// fallback (and warn). Note the fuzzy search for "background_color" can land
-/// on an unrelated widget color (e.g. style.control.checkbox); that behavior
-/// is preserved here and flagged by the warning.
-pub(crate) fn read_bg_color_from_config() -> Option<[f32; 4]> {
-    let val = get_cached_config();
-    quad_color_from(&val, "/background_color", "background_color")
-        .or_else(|| quad_color_from(&val, "/low_color", "low_color"))
-        .or_else(|| quad_color_from(&val, "/desktop_gap_color", "desktop_gap_color"))
-}
-
 pub(crate) fn read_status_background_blur_from_config() -> f32 {
     cfg_f32("/style/status/background_blur", "status_background_blur").unwrap_or(0.0)
 }
diff --git a/src/main.rs b/src/main.rs
index 858301c..0db839a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -261,7 +261,6 @@ struct StatusApp {
     width: u32,
     height: u32,
     needs_rebuild: bool,
-    current_bg_color: [f32; 4],
     box_bevel: Option<StatusBoxBevel>,
     box_bevel_depth: f32,
     context_menu: Option<ModuleContextMenu>,
@@ -346,11 +345,6 @@ impl StatusApp {
         let sw_logical = if is_vertical { self.height as f32 } else { self.width as f32 };
         let bar_h = if is_vertical { self.width as f32 } else { read_status_height_from_config() };
 
-        self.current_bg_color = read_bg_color_from_config().unwrap_or(color::STATUS_BG);
-        if let Some(opacity) = cce_ui::color::read_opacity_if_configured() {
-            self.current_bg_color[3] = opacity;
-        }
-
         self.rects.clear();
         self.overlay_rects.clear();
         self.rounded_boxes.clear();
@@ -368,11 +362,11 @@ impl StatusApp {
         self.box_bevel_depth = read_status_box_bevel_depth_from_config();
 
         self.status_bar.set_rect(0.0, 0.0, self.width as f32, self.height as f32);
-        if self.selected_module_name.is_some() {
-            self.status_bar.set_bg_color([0.0, 0.0, 0.0, 0.0]);
-        } else {
-            self.status_bar.set_bg_color(self.current_bg_color);
-        }
+        // The surface itself is transparent: every StatusApp is a single
+        // `--module` segment (the no-arg form is the launcher daemon and
+        // never creates a surface), so the only painted background is each
+        // module's own rounded box.
+        self.status_bar.set_bg_color([0.0, 0.0, 0.0, 0.0]);
 
 
         let is_single = self.selected_module_name.is_some();
@@ -1109,7 +1103,6 @@ impl cce_ui::engine::Application for StatusApp {
             width: if selected_module.is_some() { 120 } else { 1920 },
             height: read_status_height_from_config() as u32,
             needs_rebuild: true,
-            current_bg_color: color::STATUS_BG,
             box_bevel: None,
             box_bevel_depth: 3.0,
             context_menu: None,