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

commit7c96c96663d80da027dd22cdff789c6be5b7eac4
parent276239a0c0
authorLucas Galante <[email protected]>
date2026-08-29 22:52
fix: tray icons ride the text_raise lift like every text run

The icon rect sat at geometric center while every neighboring module's
text goes through centered_text_y, which lifts it by
module { text_raise } — so with a nonzero raise the tray read as
sitting low. The icon box now subtracts the same raise, and the
fallback glyph centers plainly within it rather than applying the lift
a second time through centered_text_y.

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

 src/modules.rs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/modules.rs b/src/modules.rs
index 0a65560..ec121ce 100644
--- a/src/modules.rs
+++ b/src/modules.rs
@@ -717,7 +717,11 @@ impl StatusModule for TrayModule {
         for (i, item) in sorted_tray.iter().enumerate() {
             let icon_size = 16.0;
             let icon_x = x + padding + (i as f32) * (icon_size + 8.0);
-            let icon_y = (bar_h - icon_size) / 2.0;
+            // The same `module { text_raise }` lift every text run gets via
+            // `centered_text_y` — without it the icons sit at geometric
+            // center while neighboring modules' text rides `text_raise`
+            // higher, and the tray reads as low.
+            let icon_y = (bar_h - icon_size) / 2.0 - crate::config::read_text_raise_from_config();
 
             tray_item_bounds.push(TrayIconBounds {
                 id: item.id.clone(),
@@ -836,7 +840,10 @@ impl StatusModule for TrayModule {
                 let scale = cce_ui::scale::scale_factor();
                 let tw = buf.layout_runs().next().map(|r| r.line_w).unwrap_or(0.0) / scale;
                 let tx = icon_x + (icon_size - tw) / 2.0;
-                let ty = icon_y + centered_text_y(icon_size, font_size);
+                // Plain centering within the icon box: the box itself already
+                // carries the `text_raise` lift, and `centered_text_y` here
+                // would apply it a second time.
+                let ty = icon_y + (icon_size - font_size) / 2.0;
                 text_prims.push((
                     symbol.to_string(),
                     font_size,