aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/configuration/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/configuration/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/configuration/src/main.rs')
-rw-r--r--default-plugins/configuration/src/main.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/default-plugins/configuration/src/main.rs b/default-plugins/configuration/src/main.rs
index 67c7577b..afc08bf5 100644
--- a/default-plugins/configuration/src/main.rs
+++ b/default-plugins/configuration/src/main.rs
@@ -71,6 +71,7 @@ struct State {
ui_size: usize,
current_screen: Screen,
latest_mode_info: Option<ModeInfo>,
+ colors: Palette,
}
impl Default for State {
@@ -81,6 +82,7 @@ impl Default for State {
ui_size: UI_SIZE,
current_screen: Screen::default(),
latest_mode_info: None,
+ colors: Palette::default(),
}
}
}
@@ -114,6 +116,7 @@ impl ZellijPlugin for State {
let mut should_render = false;
match event {
Event::ModeUpdate(mode_info) => {
+ self.colors = mode_info.style.colors;
if self.latest_mode_info.as_ref().and_then(|l| l.base_mode) != mode_info.base_mode {
// reset ui state
self.current_screen.reset_state(self.is_setup_wizard);
@@ -168,7 +171,7 @@ impl ZellijPlugin for State {
fn render(&mut self, rows: usize, cols: usize) {
let notification = self.notification.clone();
if self.is_in_main_screen() {
- top_tab_menu(cols, &self.current_screen);
+ top_tab_menu(cols, &self.current_screen, &self.colors);
}
match &mut self.current_screen {
Screen::RebindLeaders(rebind_leaders_screen) => {