status bar
git clone https://git.lucas.co/cce-status-interface.git
refactor: remove the dead separator machinery
Separators only ever meant something in the retired monolithic mode: in
the per-module process model each module is its own surface, so a
surface never contains two modules with a "between" — and the drawing
was hardcoded off (show_separators = false) regardless. Gone: the
Separator buffer and its rebuild/replay/vertical-rotation plumbing, the
push blocks (the spacing arithmetic they wrapped stays), and the
status_separator_color reader. Any future inter-segment divider belongs
to the compositor's arrange pass, which owns the pixels between
segments.
Co-Authored-By: Claude Fable 5 <[email protected]>
CLAUDE.md | 4 ++--
src/config.rs | 3 ---
src/main.rs | 38 +++-----------------------------------
3 files changed, 5 insertions(+), 40 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index bb0bb37..7c4fbfd 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -54,7 +54,7 @@ The app implements `cce_ui::engine::Application` on the **`display_list()` paint
1. `rebuild_layout()` runs the two-pass module layout — for each module first
`StatusModule::width()`, then `StatusModule::render()` — filling retained buffers on
- `StatusApp`: `rects`, `rounded_boxes`, `separators`, `text_prims`
+ `StatusApp`: `rects`, `rounded_boxes`, `text_prims`
(the `TextPrim` tuple type; build them with `draw_label()` from a
`cce_ui::widget::StyledLabel`), plus `input_regions`, `module_bounds`,
`tray_item_bounds`, `viewport_bounds`.
@@ -129,7 +129,7 @@ background_blur tint scaling still applies on top) and `module { text_color }`
which splits snake_case keys across nesting — `status_background_color` matches
`style { status background_color=... }`. Keys used here: `bar_height`, `status_font`
(also via fontconfig alias `status-interface`), `status_font_size`, `status_padding`,
-`status_module_spacing`, `status_normal_color`, `status_separator_color`,
+`status_module_spacing`, `status_normal_color`,
`status_background_color`, `status_background_blur`, `status_box_corner_radius`,
`background_color`/`low_color`/`desktop_gap_color` (bar bg fallback chain),
`light_source_position`, and per-module-name position/side entries.
diff --git a/src/config.rs b/src/config.rs
index 1636aef..c9f2ed9 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -191,9 +191,6 @@ pub(crate) fn read_status_module_spacing_from_config() -> f32 {
.unwrap_or(8.0)
}
-pub(crate) fn read_separator_color_from_config() -> Option<[f32; 4]> {
- cfg_quad_color("/style/status/separator_color", "status_separator_color")
-}
pub(crate) fn parse_font_for_alias(content: &str, alias: &str) -> Option<String> {
let lines: Vec<&str> = content.lines().collect();
diff --git a/src/main.rs b/src/main.rs
index fbd5b34..0eba142 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -21,7 +21,7 @@ use glyphon::{
};
use cce_ui::color;
use cce_ui::widget::{
- Adapted, Separator, WidgetHost,
+ WidgetHost,
MouseButton, ElementState, MouseScrollDelta, KeyEvent,
};
@@ -236,7 +236,6 @@ struct StatusApp {
rects: Vec<RectWidget>,
overlay_rects: Vec<RectWidget>,
rounded_boxes: Vec<RoundedBox>,
- separators: Vec<Adapted<Separator>>,
text_prims: Vec<TextPrim>,
scale_factor: f64,
@@ -308,10 +307,8 @@ impl StatusApp {
let (font_family, _) =
cce_ui::layout::parse_font_string(&read_status_font_from_config());
let font_size = read_status_font_size_from_config();
- let show_separators = false;
let padding = read_status_padding_from_config();
let spacing = read_status_module_spacing_from_config();
- let separator_color = read_separator_color_from_config().unwrap_or(color::STATUS_ACCENT);
let normal_color = read_normal_color_from_config().unwrap_or(color::TEXT_FG);
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() };
@@ -324,7 +321,6 @@ impl StatusApp {
self.rects.clear();
self.overlay_rects.clear();
self.rounded_boxes.clear();
- self.separators.clear();
self.text_prims.clear();
self.input_regions.clear();
self.module_bounds.clear();
@@ -367,15 +363,6 @@ impl StatusApp {
);
if w > 0.0 {
if !is_first_left {
- if show_separators {
- self.separators.push(Separator::new(
- left_x + spacing / 2.0,
- 0.0,
- 1.0,
- bar_h,
- separator_color,
- ));
- }
left_x += spacing;
}
is_first_left = false;
@@ -449,15 +436,6 @@ impl StatusApp {
if w > 0.0 {
if !is_first_right {
right_x -= spacing;
- if show_separators {
- self.separators.push(Separator::new(
- right_x + spacing / 2.0,
- 0.0,
- 1.0,
- bar_h,
- separator_color,
- ));
- }
}
is_first_right = false;
@@ -636,11 +614,6 @@ impl StatusApp {
rb.w = old_h;
rb.h = old_w;
}
- // Rotate separators (rect lives on the Adapted base since the Phase 5 migration)
- for sep in &mut self.separators {
- let (old_x, old_y, old_w, old_h) = sep.rect();
- sep.set_rect(old_y, old_x, old_h, old_w);
- }
// Rotate rects
for r in &mut self.rects {
let old_x = r.x;
@@ -995,7 +968,6 @@ impl cce_ui::engine::Application for StatusApp {
rects: Vec::new(),
overlay_rects: Vec::new(),
rounded_boxes: Vec::new(),
- separators: Vec::new(),
text_prims: Vec::new(),
scale_factor: 1.0,
width: if selected_module.is_some() { 120 } else { 1920 },
@@ -1150,8 +1122,8 @@ impl cce_ui::engine::Application for StatusApp {
}
fn display_list(&mut self, size: cce_ui::engine::LogicalSize, scale: f64) -> Option<cce_ui::scene::paint::DisplayList> {
- // Phase 6ak single paint path: the rounded boxes, the status-bar bg / module rects /
- // separators (the legacy view_rounded_quads then view() bodies, in the wrapper's
+ // Phase 6ak single paint path: the rounded boxes, the status-bar bg / module rects
+ // (the legacy view_rounded_quads then view() bodies, in the wrapper's
// order), and the module text (prims, reshaped by the engine cache). overlay_quads
// stays a separate on-top pass. The status bar's own text is never set in this app,
// so it contributes only its background quad.
@@ -1203,10 +1175,6 @@ impl cce_ui::engine::Application for StatusApp {
for r in &self.rects {
pc.quad(Rect { x: r.x, y: r.y, width: r.w, height: r.h }, r.color);
}
- for sep in &self.separators {
- let (x, y, w, h) = sep.rect();
- pc.quad(Rect { x, y, width: w, height: h }, sep.color());
- }
for (text, tsize, x, y, color, font, bounds, layout) in &self.text_prims {
match layout {