From 3e598c565e6e8ad4c34e93aec9a49e60d51d730e Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 24 Apr 2024 21:49:07 +0400 Subject: Implement border window rule --- src/layout/tile.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/layout/tile.rs') diff --git a/src/layout/tile.rs b/src/layout/tile.rs index ed6773da..4778db69 100644 --- a/src/layout/tile.rs +++ b/src/layout/tile.rs @@ -107,9 +107,12 @@ struct MoveAnimation { impl Tile { pub fn new(window: W, options: Rc) -> Self { + let rules = window.rules(); + let border_config = rules.border.resolve_against(options.border); + Self { window, - border: FocusRing::new(options.border.into()), + border: FocusRing::new(border_config.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.]), @@ -123,7 +126,11 @@ impl Tile { } pub fn update_config(&mut self, options: Rc) { - self.border.update_config(options.border.into()); + let rules = self.window.rules(); + + let border_config = rules.border.resolve_against(self.options.border); + self.border.update_config(border_config.into()); + self.focus_ring.update_config(options.focus_ring); self.options = options; } @@ -164,6 +171,10 @@ impl Tile { self.resize_animation = None; } } + + let rules = self.window.rules(); + let border_config = rules.border.resolve_against(self.options.border); + self.border.update_config(border_config.into()); } pub fn advance_animations(&mut self, current_time: Duration, is_active: bool) { -- cgit