aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-02-12 09:22:22 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-02-12 09:22:22 +0400
commit6e2307301991a187b8d4a28cdbbf7a49d33039d5 (patch)
tree056f9b6d37d08a4c08217f5aefc022c0aaf1a65c
parenta9fcbf81eb3e5247f699afeee1f078b0dcd93fc3 (diff)
downloadniri-6e2307301991a187b8d4a28cdbbf7a49d33039d5.tar.gz
niri-6e2307301991a187b8d4a28cdbbf7a49d33039d5.tar.bz2
niri-6e2307301991a187b8d4a28cdbbf7a49d33039d5.zip
Move default_border() into FocusRing
-rw-r--r--niri-config/src/lib.rs16
-rw-r--r--src/layout/mod.rs2
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<PresetWidth>,
@@ -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.),