Skip to content

Commit

Permalink
feat(config): add floating border colour opt
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ds13 authored and LGUG2Z committed Oct 13, 2024
1 parent 9151922 commit a17924c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions komorebi/src/static_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ pub struct BorderColours {
pub stack: Option<Colour>,
/// Border colour when the container is in monocle mode
pub monocle: Option<Colour>,
/// Border colour when the container is in floating mode
pub floating: Option<Colour>,
/// Border colour when the container is unfocused
pub unfocused: Option<Colour>,
}
Expand Down Expand Up @@ -525,6 +527,7 @@ impl From<&WindowManager> for StaticConfig {
single: Option::from(Colour::from(border_manager::FOCUSED.load(Ordering::SeqCst))),
stack: Option::from(Colour::from(border_manager::STACK.load(Ordering::SeqCst))),
monocle: Option::from(Colour::from(border_manager::MONOCLE.load(Ordering::SeqCst))),
floating: Option::from(Colour::from(border_manager::FLOATING.load(Ordering::SeqCst))),
unfocused: Option::from(Colour::from(
border_manager::UNFOCUSED.load(Ordering::SeqCst),
)),
Expand Down Expand Up @@ -652,6 +655,10 @@ impl StaticConfig {
border_manager::MONOCLE.store(u32::from(monocle), Ordering::SeqCst);
}

if let Some(floating) = colours.floating {
border_manager::FLOATING.store(u32::from(floating), Ordering::SeqCst);
}

if let Some(unfocused) = colours.unfocused {
border_manager::UNFOCUSED.store(u32::from(unfocused), Ordering::SeqCst);
}
Expand Down
3 changes: 3 additions & 0 deletions komorebi/src/window_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ impl Default for GlobalState {
monocle: Option::from(Colour::Rgb(Rgb::from(
border_manager::MONOCLE.load(Ordering::SeqCst),
))),
floating: Option::from(Colour::Rgb(Rgb::from(
border_manager::FLOATING.load(Ordering::SeqCst),
))),
unfocused: Option::from(Colour::Rgb(Rgb::from(
border_manager::UNFOCUSED.load(Ordering::SeqCst),
))),
Expand Down

0 comments on commit a17924c

Please sign in to comment.