From 6e2307301991a187b8d4a28cdbbf7a49d33039d5 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 12 Feb 2024 09:22:22 +0400 Subject: Move default_border() into FocusRing --- niri-config/src/lib.rs | 16 +++++++++------- src/layout/mod.rs | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index 1b4a999c..70dc3909 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -281,7 +281,7 @@ pub struct Mode { pub struct Layout { #[knuffel(child, default)] pub focus_ring: FocusRing, - #[knuffel(child, default = default_border())] + #[knuffel(child, default = FocusRing::default_border())] pub border: FocusRing, #[knuffel(child, unwrap(children), default)] pub preset_column_widths: Vec, @@ -324,12 +324,14 @@ impl Default for FocusRing { } } -pub const fn default_border() -> FocusRing { - FocusRing { - off: true, - width: 4, - active_color: Color::new(255, 200, 127, 255), - inactive_color: Color::new(80, 80, 80, 255), +impl FocusRing { + pub const fn default_border() -> FocusRing { + FocusRing { + off: true, + width: 4, + active_color: Color::new(255, 200, 127, 255), + inactive_color: Color::new(80, 80, 80, 255), + } } } diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 93b1fe13..9443093f 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -168,7 +168,7 @@ impl Default for Options { gaps: 16, struts: Default::default(), focus_ring: Default::default(), - border: niri_config::default_border(), + border: niri_config::FocusRing::default_border(), center_focused_column: Default::default(), preset_widths: vec![ ColumnWidth::Proportion(1. / 3.), -- cgit