aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/status-bar/src/main.rs
diff options
context:
space:
mode:
authorDaniel Jankowski <Daniel.Jankowski@rub.de>2024-10-24 18:21:44 +0200
committerGitHub <noreply@github.com>2024-10-24 18:21:44 +0200
commit0cd6d5f4e5e7afcdd25cc45aaeeb80161498e322 (patch)
treef72011676c902a37828beee75f3d6e85a50124e4 /default-plugins/status-bar/src/main.rs
parentdocs(changelog): suspend commands in remote layouts (diff)
downloadsl0ppij-0cd6d5f4e5e7afcdd25cc45aaeeb80161498e322.tar.gz
sl0ppij-0cd6d5f4e5e7afcdd25cc45aaeeb80161498e322.tar.xz
sl0ppij-0cd6d5f4e5e7afcdd25cc45aaeeb80161498e322.zip
feat(plugins): add configurable black background for ui components (#3681)
* feat(plugins): add transparent background for text and nested_list * chore: fix formatting issue * feat: invert flag behaviour * feat: implement bg_black handling for table cells * fix: order of selected and bg_black in protocol * chore: rename from bg_black to opaque * fix: explicit selected, if opaque and selected for text * chore: fix formatting issues * feat: opaque tab-bar * feat: opaque session-manager bars * feat: opaque ribbon in plugin manager * feat: opaque one-line ui * feat: opaque tab-bar in configuration plugin
Diffstat (limited to 'default-plugins/status-bar/src/main.rs')
-rw-r--r--default-plugins/status-bar/src/main.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs
index 4fbc0089..8b35650c 100644
--- a/default-plugins/status-bar/src/main.rs
+++ b/default-plugins/status-bar/src/main.rs
@@ -253,10 +253,19 @@ impl ZellijPlugin for State {
""
};
+ let background = match self.mode_info.style.colors.theme_hue {
+ ThemeHue::Dark => self.mode_info.style.colors.black,
+ ThemeHue::Light => self.mode_info.style.colors.white,
+ };
+
if rows == 1 && !self.classic_ui {
+ let fill_bg = match background {
+ PaletteColor::Rgb((r, g, b)) => format!("\u{1b}[48;2;{};{};{}m\u{1b}[0K", r, g, b),
+ PaletteColor::EightBit(color) => format!("\u{1b}[48;5;{}m\u{1b}[0K", color),
+ };
let active_tab = self.tabs.iter().find(|t| t.active);
print!(
- "{}",
+ "{}{}",
one_line_ui(
&self.mode_info,
active_tab,
@@ -265,7 +274,8 @@ impl ZellijPlugin for State {
self.base_mode_is_locked,
self.text_copy_destination,
self.display_system_clipboard_failure,
- )
+ ),
+ fill_bg,
);
return;
}
@@ -274,11 +284,6 @@ impl ZellijPlugin for State {
let first_line = first_line(&self.mode_info, active_tab, cols, separator);
let second_line = self.second_line(cols);
- let background = match self.mode_info.style.colors.theme_hue {
- ThemeHue::Dark => self.mode_info.style.colors.black,
- ThemeHue::Light => self.mode_info.style.colors.white,
- };
-
// [48;5;238m is white 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 background {