diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/layout/mod.rs | 19 | ||||
| -rw-r--r-- | src/layout/tile.rs | 4 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9443093f..dfc7ee0a 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -153,7 +153,7 @@ pub struct Options { /// Extra padding around the working area in logical pixels. pub struts: Struts, pub focus_ring: niri_config::FocusRing, - pub border: niri_config::FocusRing, + pub border: niri_config::Border, pub center_focused_column: CenterFocusedColumn, /// Column widths that `toggle_width()` switches between. pub preset_widths: Vec<ColumnWidth>, @@ -168,7 +168,7 @@ impl Default for Options { gaps: 16, struts: Default::default(), focus_ring: Default::default(), - border: niri_config::FocusRing::default_border(), + border: Default::default(), center_focused_column: Default::default(), preset_widths: vec![ ColumnWidth::Proportion(1. / 3.), @@ -2819,11 +2819,24 @@ mod tests { } prop_compose! { + fn arbitrary_border()( + off in any::<bool>(), + width in arbitrary_spacing(), + ) -> niri_config::Border { + niri_config::Border { + off, + width, + ..Default::default() + } + } + } + + prop_compose! { fn arbitrary_options()( gaps in arbitrary_spacing(), struts in arbitrary_struts(), focus_ring in arbitrary_focus_ring(), - border in arbitrary_focus_ring(), + border in arbitrary_border(), center_focused_column in arbitrary_center_focused_column(), ) -> Options { Options { diff --git a/src/layout/tile.rs b/src/layout/tile.rs index 62f79a77..54c38d15 100644 --- a/src/layout/tile.rs +++ b/src/layout/tile.rs @@ -62,7 +62,7 @@ impl<W: LayoutElement> Tile<W> { pub fn new(window: W, options: Rc<Options>) -> Self { Self { window, - border: FocusRing::new(options.border), + border: FocusRing::new(options.border.into()), focus_ring: FocusRing::new(options.focus_ring), is_fullscreen: false, // FIXME: up-to-date fullscreen right away, but we need size. fullscreen_backdrop: SolidColorBuffer::new((0, 0), [0., 0., 0., 1.]), @@ -73,7 +73,7 @@ impl<W: LayoutElement> Tile<W> { } pub fn update_config(&mut self, options: Rc<Options>) { - self.border.update_config(options.border); + self.border.update_config(options.border.into()); self.focus_ring.update_config(options.focus_ring); self.options = options; } |
