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

commit2eff84a87b9a1f9aa8e5594af9c9f94208aedfd3
parent74ff66891d
authorLucas Galante <[email protected]>
date2026-08-24 14:44
feat: module { text_raise } — lift module text above vertical center

All module text funnels through centered_text_y, which now subtracts
the configured raise (negative lowers). Pairs with the droplet style,
where lifting the text toward the attach line leaves the drop's belly
clean.

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

 CLAUDE.md      | 4 +++-
 src/config.rs  | 7 +++++++
 src/modules.rs | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CLAUDE.md b/CLAUDE.md
index ac9e2b0..7a20b4e 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -145,7 +145,9 @@ sheet_r 0.58 fill the height so there is NO straight side; bow arcs the
 bottom; curve 2.6 = superellipse joins, so everything but the flat top is one
 continuous curve), belly>0 brings back the pendant-pool look —
 warn-and-skip on unknown keys; the expanded menu box becomes the drop growing,
-and drops inset 1px from the surface bottom for the silhouette's AA feather). Everything is read through
+and drops inset 1px from the surface bottom for the silhouette's AA feather)
+and `module { text_raise }` (lifts module text above vertical center, logical
+px, bar-side only — every module funnels through `centered_text_y`). Everything is read through
 `cce_ui::config::cached_config()`; KDL is converted to JSON
 (`cce_ui::config::parse_kdl_to_json`) and looked up by **explicit JSON
 pointer only**: every key names its canonical nesting
diff --git a/src/config.rs b/src/config.rs
index db27b08..df69ca4 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -211,6 +211,13 @@ pub(crate) fn read_droplet_from_config() -> Option<cce_ui::scene::paint::Droplet
     Some(spec)
 }
 
+/// `module { text_raise }` — lifts module text above vertical center by this
+/// many logical px (negative lowers it). Bar-side only; every module's text
+/// baseline funnels through `centered_text_y`, which subtracts this.
+pub(crate) fn read_text_raise_from_config() -> f32 {
+    cfg_f32("/module/text_raise").unwrap_or(0.0)
+}
+
 pub(crate) fn read_status_box_corner_radius_from_config() -> f32 {
     // App-native ONLY (~/.config/cce/cce-status-interface/config.kdl,
     // merged over the shared config by cce-ui): `module { corner_radius }`.
diff --git a/src/modules.rs b/src/modules.rs
index 04a1280..55bc235 100644
--- a/src/modules.rs
+++ b/src/modules.rs
@@ -13,7 +13,7 @@ use crate::{
 /// window_runner uses line_height = physical_size * 1.0), so centering must
 /// use that height — not a CSS-ish 1.4em line box.
 pub(crate) fn centered_text_y(box_h: f32, font_size: f32) -> f32 {
-    (box_h - font_size) / 2.0
+    (box_h - font_size) / 2.0 - crate::config::read_text_raise_from_config()
 }
 
 pub trait StatusModule {