summaryrefslogtreecommitdiffstats
path: root/default-plugins
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2021-11-25 16:21:59 +0100
committerGitHub <noreply@github.com>2021-11-25 16:21:59 +0100
commit6c6a4393f403359838ea9b32b09520de4f50c019 (patch)
treed1b553cab1a22c271be99bbc35a5e608bc96676d /default-plugins
parent9fb2c7ca168679905d79dcdaf686d40f4a6dc958 (diff)
This adds a UI for multiple users in panes (behind a feature flag) (#897)
* feat(ui): multiple users in panes * style(fmt): make rustfmt happy * style(fmt): make clippy happy
Diffstat (limited to 'default-plugins')
-rw-r--r--default-plugins/status-bar/src/main.rs64
-rw-r--r--default-plugins/tab-bar/src/line.rs12
-rw-r--r--default-plugins/tab-bar/src/main.rs2
-rw-r--r--default-plugins/tab-bar/src/tab.rs8
4 files changed, 40 insertions, 46 deletions
diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs
index f1b2197e4..1ecd87ab1 100644
--- a/default-plugins/status-bar/src/main.rs
+++ b/default-plugins/status-bar/src/main.rs
@@ -76,61 +76,55 @@ pub struct ColoredElements {
// that can be defined in the config perhaps
fn color_elements(palette: Palette) -> ColoredElements {
match palette.source {
- // "cyan" here is used as a background as a dirty hack
- // this is because the Palette struct doesn't have a "gray" section
- // and we can't use its "bg" because that is now dynamically taken from the terminal
- // and might often not actually fit the rest of the colorscheme
- //
- // to fix this, we need to restructure the Palette struct
PaletteSource::Default => ColoredElements {
- selected_prefix_separator: style!(palette.cyan, palette.green),
+ selected_prefix_separator: style!(palette.gray, palette.green),
selected_char_left_separator: style!(palette.black, palette.green).bold(),
selected_char_shortcut: style!(palette.red, palette.green).bold(),
selected_char_right_separator: style!(palette.black, palette.green).bold(),
selected_styled_text: style!(palette.black, palette.green).bold(),
- selected_suffix_separator: style!(palette.green, palette.cyan).bold(),
- unselected_prefix_separator: style!(palette.cyan, palette.fg),
+ selected_suffix_separator: style!(palette.green, palette.gray).bold(),
+ unselected_prefix_separator: style!(palette.gray, palette.fg),
unselected_char_left_separator: style!(palette.black, palette.fg).bold(),
unselected_char_shortcut: style!(palette.red, palette.fg).bold(),
unselected_char_right_separator: style!(palette.black, palette.fg).bold(),
unselected_styled_text: style!(palette.black, palette.fg).bold(),
- unselected_suffix_separator: style!(palette.fg, palette.cyan),
- disabled_prefix_separator: style!(palette.cyan, palette.fg),
- disabled_styled_text: style!(palette.cyan, palette.fg).dimmed(),
- disabled_suffix_separator: style!(palette.fg, palette.cyan),
- selected_single_letter_prefix_separator: style!(palette.cyan, palette.green),
+ unselected_suffix_separator: style!(palette.fg, palette.gray),
+ disabled_prefix_separator: style!(palette.gray, palette.fg),
+ disabled_styled_text: style!(palette.gray, palette.fg).dimmed(),
+ disabled_suffix_separator: style!(palette.fg, palette.gray),
+ selected_single_letter_prefix_separator: style!(palette.gray, palette.green),
selected_single_letter_char_shortcut: style!(palette.red, palette.green).bold(),
- selected_single_letter_suffix_separator: style!(palette.green, palette.cyan),
- unselected_single_letter_prefix_separator: style!(palette.cyan, palette.fg),
+ selected_single_letter_suffix_separator: style!(palette.green, palette.gray),
+ unselected_single_letter_prefix_separator: style!(palette.gray, palette.fg),
unselected_single_letter_char_shortcut: style!(palette.red, palette.fg).bold(),
- unselected_single_letter_suffix_separator: style!(palette.fg, palette.cyan),
- superkey_prefix: style!(palette.white, palette.cyan).bold(),
- superkey_suffix_separator: style!(palette.cyan, palette.cyan),
+ unselected_single_letter_suffix_separator: style!(palette.fg, palette.gray),
+ superkey_prefix: style!(palette.white, palette.gray).bold(),
+ superkey_suffix_separator: style!(palette.gray, palette.gray),
},
PaletteSource::Xresources => ColoredElements {
- selected_prefix_separator: style!(palette.cyan, palette.green),
+ selected_prefix_separator: style!(palette.gray, palette.green),
selected_char_left_separator: style!(palette.fg, palette.green).bold(),
selected_char_shortcut: style!(palette.red, palette.green).bold(),
selected_char_right_separator: style!(palette.fg, palette.green).bold(),
- selected_styled_text: style!(palette.cyan, palette.green).bold(),
- selected_suffix_separator: style!(palette.green, palette.cyan).bold(),
- unselected_prefix_separator: style!(palette.cyan, palette.fg),
- unselected_char_left_separator: style!(palette.cyan, palette.fg).bold(),
+ selected_styled_text: style!(palette.gray, palette.green).bold(),
+ selected_suffix_separator: style!(palette.green, palette.gray).bold(),
+ unselected_prefix_separator: style!(palette.gray, palette.fg),
+ unselected_char_left_separator: style!(palette.gray, palette.fg).bold(),
unselected_char_shortcut: style!(palette.red, palette.fg).bold(),
- unselected_char_right_separator: style!(palette.cyan, palette.fg).bold(),
- unselected_styled_text: style!(palette.cyan, palette.fg).bold(),
- unselected_suffix_separator: style!(palette.fg, palette.cyan),
- disabled_prefix_separator: style!(palette.cyan, palette.fg),
- disabled_styled_text: style!(palette.cyan, palette.fg).dimmed(),
- disabled_suffix_separator: style!(palette.fg, palette.cyan),
+ unselected_char_right_separator: style!(palette.gray, palette.fg).bold(),
+ unselected_styled_text: style!(palette.gray, palette.fg).bold(),
+ unselected_suffix_separator: style!(palette.fg, palette.gray),
+ disabled_prefix_separator: style!(palette.gray, palette.fg),
+ disabled_styled_text: style!(palette.gray, palette.fg).dimmed(),
+ disabled_suffix_separator: style!(palette.fg, palette.gray),
selected_single_letter_prefix_separator: style!(palette.fg, palette.green),
selected_single_letter_char_shortcut: style!(palette.red, palette.green).bold(),
selected_single_letter_suffix_separator: style!(palette.green, palette.fg),
- unselected_single_letter_prefix_separator: style!(palette.fg, palette.cyan),
+ unselected_single_letter_prefix_separator: style!(palette.fg, palette.gray),
unselected_single_letter_char_shortcut: style!(palette.red, palette.fg).bold(),
- unselected_single_letter_suffix_separator: style!(palette.fg, palette.cyan),
- superkey_prefix: style!(palette.cyan, palette.fg).bold(),
- superkey_suffix_separator: style!(palette.fg, palette.cyan),
+ unselected_single_letter_suffix_separator: style!(palette.fg, palette.gray),
+ superkey_prefix: style!(palette.gray, palette.fg).bold(),
+ superkey_suffix_separator: style!(palette.fg, palette.gray),
},
}
}
@@ -231,7 +225,7 @@ impl ZellijPlugin for State {
// [48;5;238m is gray background, [0K is so that it fills the rest of the line
// [m is background reset, [0K is so that it clears the rest of the line
- match self.mode_info.palette.cyan {
+ match self.mode_info.palette.gray {
PaletteColor::Rgb((r, g, b)) => {
println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b);
}
diff --git a/default-plugins/tab-bar/src/line.rs b/default-plugins/tab-bar/src/line.rs
index af78b0fcf..2e180845b 100644
--- a/default-plugins/tab-bar/src/line.rs
+++ b/default-plugins/tab-bar/src/line.rs
@@ -102,11 +102,11 @@ fn left_more_message(tab_count_to_the_left: usize, palette: Palette, separator:
// 238
// chars length plus separator length on both sides
let more_text_len = more_text.width() + 2 * separator.width();
- let left_separator = style!(palette.cyan, palette.orange).paint(separator);
+ let left_separator = style!(palette.gray, palette.orange).paint(separator);
let more_styled_text = style!(palette.black, palette.orange)
.bold()
.paint(more_text);
- let right_separator = style!(palette.orange, palette.cyan).paint(separator);
+ let right_separator = style!(palette.orange, palette.gray).paint(separator);
let more_styled_text = format!(
"{}",
ANSIStrings(&[left_separator, more_styled_text, right_separator,])
@@ -132,11 +132,11 @@ fn right_more_message(
};
// chars length plus separator length on both sides
let more_text_len = more_text.width() + 2 * separator.width();
- let left_separator = style!(palette.cyan, palette.orange).paint(separator);
+ let left_separator = style!(palette.gray, palette.orange).paint(separator);
let more_styled_text = style!(palette.black, palette.orange)
.bold()
.paint(more_text);
- let right_separator = style!(palette.orange, palette.cyan).paint(separator);
+ let right_separator = style!(palette.orange, palette.gray).paint(separator);
let more_styled_text = format!(
"{}",
ANSIStrings(&[left_separator, more_styled_text, right_separator,])
@@ -151,7 +151,7 @@ fn tab_line_prefix(session_name: Option<&str>, palette: Palette, cols: usize) ->
let prefix_text = " Zellij ".to_string();
let prefix_text_len = prefix_text.chars().count();
- let prefix_styled_text = style!(palette.white, palette.cyan)
+ let prefix_styled_text = style!(palette.white, palette.gray)
.bold()
.paint(prefix_text);
let mut parts = vec![LinePart {
@@ -161,7 +161,7 @@ fn tab_line_prefix(session_name: Option<&str>, palette: Palette, cols: usize) ->
if let Some(name) = session_name {
let name_part = format!("({}) ", name);
let name_part_len = name_part.width();
- let name_part_styled_text = style!(palette.white, palette.cyan).bold().paint(name_part);
+ let name_part_styled_text = style!(palette.white, palette.gray).bold().paint(name_part);
if cols.saturating_sub(prefix_text_len) >= name_part_len {
parts.push(LinePart {
part: format!("{}", name_part_styled_text),
diff --git a/default-plugins/tab-bar/src/main.rs b/default-plugins/tab-bar/src/main.rs
index 936c18e48..5902050ae 100644
--- a/default-plugins/tab-bar/src/main.rs
+++ b/default-plugins/tab-bar/src/main.rs
@@ -112,7 +112,7 @@ impl ZellijPlugin for State {
}
len_cnt += bar_part.len;
}
- match self.mode_info.palette.cyan {
+ match self.mode_info.palette.gray {
PaletteColor::Rgb((r, g, b)) => {
println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", s, r, g, b);
}
diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs
index fdb498553..fc34b6c36 100644
--- a/default-plugins/tab-bar/src/tab.rs
+++ b/default-plugins/tab-bar/src/tab.rs
@@ -5,12 +5,12 @@ use zellij_tile::prelude::*;
use zellij_tile_utils::style;
pub fn active_tab(text: String, palette: Palette, separator: &str) -> LinePart {
- let left_separator = style!(palette.cyan, palette.green).paint(separator);
+ let left_separator = style!(palette.gray, palette.green).paint(separator);
let tab_text_len = text.width() + 2 + separator.width() * 2; // 2 for left and right separators, 2 for the text padding
let tab_styled_text = style!(palette.black, palette.green)
.bold()
.paint(format!(" {} ", text));
- let right_separator = style!(palette.green, palette.cyan).paint(separator);
+ let right_separator = style!(palette.green, palette.gray).paint(separator);
let tab_styled_text = format!(
"{}",
ANSIStrings(&[left_separator, tab_styled_text, right_separator,])
@@ -22,12 +22,12 @@ pub fn active_tab(text: String, palette: Palette, separator: &str) -> LinePart {
}
pub fn non_active_tab(text: String, palette: Palette, separator: &str) -> LinePart {
- let left_separator = style!(palette.cyan, palette.fg).paint(separator);
+ let left_separator = style!(palette.gray, palette.fg).paint(separator);
let tab_text_len = text.width() + 2 + separator.width() * 2; // 2 for left and right separators, 2 for the text padding
let tab_styled_text = style!(palette.black, palette.fg)
.bold()
.paint(format!(" {} ", text));
- let right_separator = style!(palette.fg, palette.cyan).paint(separator);
+ let right_separator = style!(palette.fg, palette.gray).paint(separator);
let tab_styled_text = format!(
"{}",
ANSIStrings(&[left_separator, tab_styled_text, right_separator,])