From 39c8082a47d391070783a60b9b5ae87e1b5d4d7c Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sat, 23 Mar 2019 00:12:30 +0200 Subject: [PATCH] Distinguish far right selected tab from background --- ui/src/components/utilities.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/src/components/utilities.rs b/ui/src/components/utilities.rs index e097514fd..4d6be604b 100644 --- a/ui/src/components/utilities.rs +++ b/ui/src/components/utilities.rs @@ -808,6 +808,11 @@ impl Tabbed { } } fn draw_tabs(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { + if self.children.is_empty() { + clear_area(grid, area); + return; + } + let mut x = get_x(upper_left!(area)); let mut y: usize = get_y(upper_left!(area)); for (idx, c) in self.children.iter().enumerate() { @@ -828,7 +833,6 @@ impl Tabbed { if y != _y_ { break; } - y = _y_; } let (cols, _) = grid.size(); let cslice: &mut [Cell] = grid; @@ -842,6 +846,12 @@ impl Tabbed { c.set_ch(' '); } + if self.cursor_pos == self.children.len() - 1 { + cslice[(y * cols) + x].set_ch('▍'); + cslice[(y * cols) + x].set_fg(Color::Byte(8)); + cslice[(y * cols) + x].set_bg(Color::Default); + } + context.dirty_areas.push_back(area); } pub fn add_component(&mut self, new: Box) {