Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make end_separator respoect separator_fg and separator_bg #2111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,28 @@ where
}

if let Separator::Custom(end_separator) = &config.theme.end_separator {
rendered_blocks.push(I3BarBlock {
// The separator's FG is the last block's last widget's BG
let sep_fg = if config.theme.separator_fg == Color::Auto {
prev_last_bg
} else {
config.theme.separator_fg
};

// The separator has no background color
let sep_bg = if config.theme.separator_bg == Color::Auto {
Color::None
} else {
config.theme.separator_bg
};

let separator = I3BarBlock {
full_text: end_separator.clone(),
background: Color::None,
color: prev_last_bg,
background: sep_bg,
color: sep_fg,
..Default::default()
});
};

rendered_blocks.push(separator);
}

println!("{},", serde_json::to_string(&rendered_blocks).unwrap());
Expand Down