diff options
author | denis <denismaximov98@gmail.com> | 2021-04-24 11:42:40 +0300 |
---|---|---|
committer | denis <denismaximov98@gmail.com> | 2021-04-24 11:42:40 +0300 |
commit | de72d3d2fb785117e599d17525b5043345ffa03c (patch) | |
tree | b727c160d8e09302120476701a0dd243fab9dfad /default-plugins/tab-bar | |
parent | c44de8935014766b205fae82d5378ec0d660d949 (diff) |
wip: tab bar coloring
Diffstat (limited to 'default-plugins/tab-bar')
-rw-r--r-- | default-plugins/tab-bar/src/line.rs | 7 | ||||
-rw-r--r-- | default-plugins/tab-bar/src/main.rs | 2 | ||||
-rw-r--r-- | default-plugins/tab-bar/src/tab.rs | 7 |
3 files changed, 10 insertions, 6 deletions
diff --git a/default-plugins/tab-bar/src/line.rs b/default-plugins/tab-bar/src/line.rs index 17461e9c8..f6ed3c039 100644 --- a/default-plugins/tab-bar/src/line.rs +++ b/default-plugins/tab-bar/src/line.rs @@ -192,7 +192,12 @@ pub fn tab_line( } tab_line.append(&mut tabs_to_render); if !tabs_after_active.is_empty() { - add_next_tabs_msg(&mut tabs_after_active, &mut tab_line, cols - prefix.len, palette); + add_next_tabs_msg( + &mut tabs_after_active, + &mut tab_line, + cols - prefix.len, + palette, + ); } tab_line.insert(0, prefix); tab_line diff --git a/default-plugins/tab-bar/src/main.rs b/default-plugins/tab-bar/src/main.rs index 7083ac597..f522f8f2f 100644 --- a/default-plugins/tab-bar/src/main.rs +++ b/default-plugins/tab-bar/src/main.rs @@ -43,7 +43,7 @@ impl ZellijPlugin for State { fn update(&mut self, event: Event) { match event { - Event::ModeUpdate(mode_info) => self.mode_info.mode = mode_info.mode, + Event::ModeUpdate(mode_info) => self.mode_info = mode_info, Event::TabUpdate(tabs) => self.tabs = tabs, _ => unimplemented!(), // FIXME: This should be unreachable, but this could be cleaner } diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs index f87ea48e8..c9d8d1f06 100644 --- a/default-plugins/tab-bar/src/tab.rs +++ b/default-plugins/tab-bar/src/tab.rs @@ -1,11 +1,10 @@ -use crate::colors::{BLACK, BRIGHT_GRAY, GRAY, GREEN}; use crate::{LinePart, ARROW_SEPARATOR}; use ansi_term::{ANSIStrings, Color::RGB, Style}; use zellij_tile::data::Palette; pub fn active_tab(text: String, palette: Palette) -> LinePart { let left_separator = Style::new() - .fg(RGB(palette.fg.0, palette.fg.1, palette.fg.2)) + .fg(RGB(palette.bg.0, palette.bg.1, palette.bg.2)) .on(RGB(palette.green.0, palette.green.1, palette.green.2)) .paint(ARROW_SEPARATOR); let tab_text_len = text.chars().count() + 4; // 2 for left and right separators, 2 for the text padding @@ -30,7 +29,7 @@ pub fn active_tab(text: String, palette: Palette) -> LinePart { pub fn non_active_tab(text: String, palette: Palette) -> LinePart { let left_separator = Style::new() - .fg(RGB(palette.fg.0, palette.fg.1, palette.fg.2)) + .fg(RGB(palette.bg.0, palette.bg.1, palette.bg.2)) .on(RGB(palette.bg.0, palette.bg.1, palette.bg.2)) .paint(ARROW_SEPARATOR); let tab_text_len = text.chars().count() + 4; // 2 for left and right separators, 2 for the padding @@ -40,7 +39,7 @@ pub fn non_active_tab(text: String, palette: Palette) -> LinePart { .bold() .paint(format!(" {} ", text)); let right_separator = Style::new() - .fg(RGB(palette.fg.0, palette.fg.1, palette.fg.2)) + .fg(RGB(palette.bg.0, palette.bg.1, palette.bg.2)) .on(RGB(palette.bg.0, palette.bg.1, palette.bg.2)) .paint(ARROW_SEPARATOR); let tab_styled_text = format!( |