gardesk/gartop / 6376e35

Browse files

Fix header/tab overlap by removing redundant border and gap

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
6376e355f84f3c8d49463548f741e541e294f8b4
Parents
9d4452b
Tree
c8f542f

2 changed files

StatusFile+-
M gartop/src/gui/app.rs 4 7
M gartop/src/gui/header.rs 0 10
gartop/src/gui/app.rsmodified
@@ -93,8 +93,7 @@ impl App {
9393
 
9494
         // Create components
9595
         let header = HeaderBar::new(Rect::new(0, 0, width, HEADER_HEIGHT));
96
-        let tab_bar_y = HEADER_HEIGHT + 4; // Small gap below header
97
-        let tab_bar = TabBar::new(Rect::new(0, tab_bar_y as i32, width, TAB_BAR_HEIGHT));
96
+        let tab_bar = TabBar::new(Rect::new(0, HEADER_HEIGHT as i32, width, TAB_BAR_HEIGHT));
9897
         let process_list = Self::create_process_list(width, height);
9998
 
10099
         // Check if daemon is available
@@ -124,9 +123,8 @@ impl App {
124123
 
125124
     /// Create process list with correct bounds.
126125
     fn create_process_list(width: u32, height: u32) -> ProcessList {
127
-        // Account for: header + gap + tab bar + section gap + graph label + graph + section gap
128
-        let tab_bar_y = HEADER_HEIGHT + 4;
129
-        let content_start = tab_bar_y + TAB_BAR_HEIGHT + SECTION_GAP + 20 + GRAPH_HEIGHT + SECTION_GAP;
126
+        // Account for: header + tab bar + section gap + graph label + graph + section gap
127
+        let content_start = HEADER_HEIGHT + TAB_BAR_HEIGHT + SECTION_GAP + 20 + GRAPH_HEIGHT + SECTION_GAP;
130128
         let list_height = height.saturating_sub(content_start);
131129
         let list_width = width.saturating_sub(CONTENT_PADDING * 2);
132130
         ProcessList::new(Rect::new(CONTENT_PADDING as i32, content_start as i32, list_width, list_height))
@@ -445,8 +443,7 @@ impl App {
445443
 
446444
         // Update component bounds
447445
         self.header = HeaderBar::new(Rect::new(0, 0, width, HEADER_HEIGHT));
448
-        let tab_bar_y = HEADER_HEIGHT + 4;
449
-        self.tab_bar.set_bounds(Rect::new(0, tab_bar_y as i32, width, TAB_BAR_HEIGHT));
446
+        self.tab_bar.set_bounds(Rect::new(0, HEADER_HEIGHT as i32, width, TAB_BAR_HEIGHT));
450447
         self.process_list = Self::create_process_list(width, height);
451448
         self.process_list.set_processes(self.processes.clone());
452449
 
gartop/src/gui/header.rsmodified
@@ -90,16 +90,6 @@ impl HeaderBar {
9090
         renderer.text(&mem_text, mem_x, y, &mem_style)?;
9191
         renderer.text(&uptime_text, uptime_x, y, &stats_style)?;
9292
 
93
-        // Bottom border
94
-        renderer.line(
95
-            self.bounds.x as f64,
96
-            (self.bounds.y + self.bounds.height as i32) as f64,
97
-            right_edge,
98
-            (self.bounds.y + self.bounds.height as i32) as f64,
99
-            theme.border,
100
-            1.0,
101
-        )?;
102
-
10393
         Ok(())
10494
     }
10595