gardesk/gartop / d6be65e

Browse files

Increase header height and fix tab bar layout

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
d6be65e760cf30b9374e16774fd8c6253de23cd6
Parents
6376e35
Tree
31859e4

2 changed files

StatusFile+-
M gartop/src/gui/app.rs 1 1
M gartop/src/gui/tabs.rs 2 12
gartop/src/gui/app.rsmodified
@@ -18,7 +18,7 @@ use std::time::Instant;
18
 use x11rb::protocol::xproto::{ConnectionExt, ImageFormat};
18
 use x11rb::protocol::xproto::{ConnectionExt, ImageFormat};
19
 
19
 
20
 /// Header bar height.
20
 /// Header bar height.
21
-const HEADER_HEIGHT: u32 = 40;
21
+const HEADER_HEIGHT: u32 = 48;
22
 
22
 
23
 /// Graph height.
23
 /// Graph height.
24
 const GRAPH_HEIGHT: u32 = 150;
24
 const GRAPH_HEIGHT: u32 = 150;
gartop/src/gui/tabs.rsmodified
@@ -54,12 +54,12 @@ impl TabBar {
54
     fn calculate_tab_bounds(bounds: Rect) -> Vec<Rect> {
54
     fn calculate_tab_bounds(bounds: Rect) -> Vec<Rect> {
55
         let tabs = Tab::all();
55
         let tabs = Tab::all();
56
         let tab_width = 100u32;
56
         let tab_width = 100u32;
57
-        let tab_height = bounds.height - 4;
57
+        let tab_height = bounds.height - 8; // Leave room for padding
58
         let mut result = Vec::with_capacity(tabs.len());
58
         let mut result = Vec::with_capacity(tabs.len());
59
 
59
 
60
         for (i, _) in tabs.iter().enumerate() {
60
         for (i, _) in tabs.iter().enumerate() {
61
             let x = bounds.x + 8 + (i as i32 * (tab_width as i32 + 4));
61
             let x = bounds.x + 8 + (i as i32 * (tab_width as i32 + 4));
62
-            let y = bounds.y + 2;
62
+            let y = bounds.y + 4; // More top padding
63
             result.push(Rect::new(x, y, tab_width, tab_height));
63
             result.push(Rect::new(x, y, tab_width, tab_height));
64
         }
64
         }
65
 
65
 
@@ -121,16 +121,6 @@ impl TabBar {
121
         // Background
121
         // Background
122
         renderer.fill_rect(self.bounds, theme.panel_bg)?;
122
         renderer.fill_rect(self.bounds, theme.panel_bg)?;
123
 
123
 
124
-        // Bottom border
125
-        renderer.line(
126
-            self.bounds.x as f64,
127
-            (self.bounds.y + self.bounds.height as i32) as f64,
128
-            (self.bounds.x + self.bounds.width as i32) as f64,
129
-            (self.bounds.y + self.bounds.height as i32) as f64,
130
-            theme.border,
131
-            1.0,
132
-        )?;
133
-
134
         let tabs = Tab::all();
124
         let tabs = Tab::all();
135
         for (i, tab_rect) in self.tab_bounds.iter().enumerate() {
125
         for (i, tab_rect) in self.tab_bounds.iter().enumerate() {
136
             let tab = tabs[i];
126
             let tab = tabs[i];