gardesk/gartop / 9077950

Browse files

Fix header descender cutoff and tab text positioning

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
9077950efe968396f39f21ab5c2596e368e71fb9
Parents
22de913
Tree
dbb71a0

2 changed files

StatusFile+-
M gartop/src/gui/header.rs 2 2
M gartop/src/gui/tabs.rs 2 2
gartop/src/gui/header.rsmodified
@@ -43,7 +43,7 @@ impl HeaderBar {
4343
             ..Default::default()
4444
         };
4545
         // Position text in upper portion of header (leave room below for visual separation)
46
-        let text_y = self.bounds.y as f64 + (self.bounds.height as f64 * 0.5) + 4.0;
46
+        let text_y = self.bounds.y as f64 + (self.bounds.height as f64 * 0.4) + 6.0;
4747
         renderer.text("gartop", 16.0, text_y, &title_style)?;
4848
 
4949
         // Stats summary on right side
@@ -74,7 +74,7 @@ impl HeaderBar {
7474
         // Position from right side
7575
         let right_margin = 16.0;
7676
         let spacing = 20.0;
77
-        let y = self.bounds.y as f64 + (self.bounds.height as f64 * 0.5) + 4.0;
77
+        let y = self.bounds.y as f64 + (self.bounds.height as f64 * 0.4) + 6.0;
7878
 
7979
         let uptime_width = renderer.measure_text(&uptime_text, &stats_style)?.width as f64;
8080
         let mem_width = renderer.measure_text(&mem_text, &mem_style)?.width as f64;
gartop/src/gui/tabs.rsmodified
@@ -154,11 +154,11 @@ impl TabBar {
154154
                 ..Default::default()
155155
             };
156156
 
157
-            // Center text in tab
157
+            // Center text in tab (baseline positioned, so add ~1/3 font height to center)
158158
             let text = tab.label();
159159
             let text_size = renderer.measure_text(text, &style)?;
160160
             let text_x = tab_rect.x as f64 + (tab_rect.width as f64 - text_size.width as f64) / 2.0;
161
-            let text_y = tab_rect.y as f64 + (tab_rect.height as f64 + style.font_size) / 2.0;
161
+            let text_y = tab_rect.y as f64 + (tab_rect.height as f64 / 2.0) + (style.font_size / 3.0);
162162
             renderer.text(text, text_x, text_y, &style)?;
163163
 
164164
             // Active indicator line