Skip to content

Commit

Permalink
Alignment with the actual requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
lorber13 committed Nov 10, 2024
1 parent f28b6ce commit c253b01
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,12 @@ where

let mut prev_merge_with_next = false;

if let Separator::Custom(start_separator) = &config.theme.start_separator {
rendered_blocks.push(I3BarBlock {
full_text: start_separator.clone(),
background: Color::None,
color: prev_last_bg,
..Default::default()
});
}

for widgets in blocks
for (i, widgets) in blocks
.iter()
.map(|x| x.borrow())
.filter(|x| !x.segments.is_empty())
.cloned()
.enumerate()
{
let RenderedBlock {
mut segments,
Expand All @@ -73,7 +65,12 @@ where
alt = !alt;
}

if let Separator::Custom(separator) = &config.theme.separator {
let separator = match &config.theme.start_separator {
Separator::Custom(_) if i == 0 => &config.theme.start_separator,
_ => &config.theme.separator,
};

if let Separator::Custom(separator) = separator {
if !prev_merge_with_next {
// The first widget's BG is used to get the FG color for the current separator
let sep_fg = if config.theme.separator_fg == Color::Auto {
Expand Down

0 comments on commit c253b01

Please sign in to comment.