gardesk/gartop / 188cf80

Browse files

Fix tab text centering - use measured height for proper vertical alignment

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
188cf80e7e78c1148bf6a3cd10623b9fc64b5c74
Parents
bd005c7
Tree
584a2e0

1 changed file

StatusFile+-
M gartop/src/gui/tabs.rs 2 3
gartop/src/gui/tabs.rsmodified
@@ -154,12 +154,11 @@ impl TabBar {
154154
                 ..Default::default()
155155
             };
156156
 
157
-            // Position text in tab - use top of tab + offset
157
+            // Center text in tab - Pango positions from top-left, not baseline
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
-            // Position baseline at top + 16px (should put text near vertical center of 24px tab)
162
-            let text_y = tab_rect.y as f64 + 16.0;
161
+            let text_y = tab_rect.y as f64 + (tab_rect.height as f64 - text_size.height as f64) / 2.0;
163162
             renderer.text(text, text_x, text_y, &style)?;
164163
 
165164
             // Active indicator line