Move default_border() into FocusRing

This commit is contained in:
Ivan Molodetskikh
2024-02-12 09:22:22 +04:00
parent a9fcbf81eb
commit 6e23073019
2 changed files with 10 additions and 8 deletions
+3 -1
View File
@@ -281,7 +281,7 @@ pub struct Mode {
pub struct Layout { pub struct Layout {
#[knuffel(child, default)] #[knuffel(child, default)]
pub focus_ring: FocusRing, pub focus_ring: FocusRing,
#[knuffel(child, default = default_border())] #[knuffel(child, default = FocusRing::default_border())]
pub border: FocusRing, pub border: FocusRing,
#[knuffel(child, unwrap(children), default)] #[knuffel(child, unwrap(children), default)]
pub preset_column_widths: Vec<PresetWidth>, pub preset_column_widths: Vec<PresetWidth>,
@@ -324,6 +324,7 @@ impl Default for FocusRing {
} }
} }
impl FocusRing {
pub const fn default_border() -> FocusRing { pub const fn default_border() -> FocusRing {
FocusRing { FocusRing {
off: true, off: true,
@@ -332,6 +333,7 @@ pub const fn default_border() -> FocusRing {
inactive_color: Color::new(80, 80, 80, 255), inactive_color: Color::new(80, 80, 80, 255),
} }
} }
}
#[derive(knuffel::Decode, Debug, Default, Clone, Copy, PartialEq, Eq)] #[derive(knuffel::Decode, Debug, Default, Clone, Copy, PartialEq, Eq)]
pub struct Color { pub struct Color {
+1 -1
View File
@@ -168,7 +168,7 @@ impl Default for Options {
gaps: 16, gaps: 16,
struts: Default::default(), struts: Default::default(),
focus_ring: Default::default(), focus_ring: Default::default(),
border: niri_config::default_border(), border: niri_config::FocusRing::default_border(),
center_focused_column: Default::default(), center_focused_column: Default::default(),
preset_widths: vec![ preset_widths: vec![
ColumnWidth::Proportion(1. / 3.), ColumnWidth::Proportion(1. / 3.),