feat(config): add floating border colour opt

This commit is contained in:
alex-ds13
2024-10-10 19:29:02 +01:00
committed by LGUG2Z
parent 91519227d4
commit a17924c2af
2 changed files with 10 additions and 0 deletions

View File

@@ -96,6 +96,8 @@ pub struct BorderColours {
pub stack: Option<Colour>, pub stack: Option<Colour>,
/// Border colour when the container is in monocle mode /// Border colour when the container is in monocle mode
pub monocle: Option<Colour>, pub monocle: Option<Colour>,
/// Border colour when the container is in floating mode
pub floating: Option<Colour>,
/// Border colour when the container is unfocused /// Border colour when the container is unfocused
pub unfocused: Option<Colour>, pub unfocused: Option<Colour>,
} }
@@ -525,6 +527,7 @@ impl From<&WindowManager> for StaticConfig {
single: Option::from(Colour::from(border_manager::FOCUSED.load(Ordering::SeqCst))), single: Option::from(Colour::from(border_manager::FOCUSED.load(Ordering::SeqCst))),
stack: Option::from(Colour::from(border_manager::STACK.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))), 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( unfocused: Option::from(Colour::from(
border_manager::UNFOCUSED.load(Ordering::SeqCst), border_manager::UNFOCUSED.load(Ordering::SeqCst),
)), )),
@@ -652,6 +655,10 @@ impl StaticConfig {
border_manager::MONOCLE.store(u32::from(monocle), Ordering::SeqCst); 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 { if let Some(unfocused) = colours.unfocused {
border_manager::UNFOCUSED.store(u32::from(unfocused), Ordering::SeqCst); border_manager::UNFOCUSED.store(u32::from(unfocused), Ordering::SeqCst);
} }

View File

@@ -167,6 +167,9 @@ impl Default for GlobalState {
monocle: Option::from(Colour::Rgb(Rgb::from( monocle: Option::from(Colour::Rgb(Rgb::from(
border_manager::MONOCLE.load(Ordering::SeqCst), 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( unfocused: Option::from(Colour::Rgb(Rgb::from(
border_manager::UNFOCUSED.load(Ordering::SeqCst), border_manager::UNFOCUSED.load(Ordering::SeqCst),
))), ))),