aboutsummaryrefslogtreecommitdiff
path: root/src/layout/tile.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-04-24 21:49:07 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-04-24 22:01:26 +0400
commit3e598c565e6e8ad4c34e93aec9a49e60d51d730e (patch)
tree95d3f12d04f3a416ba86915ebea01b7e0f66498e /src/layout/tile.rs
parente261b641ed62474676c90aaa4e734cdd1ecde703 (diff)
downloadniri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.tar.gz
niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.tar.bz2
niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.zip
Implement border window rule
Diffstat (limited to 'src/layout/tile.rs')
-rw-r--r--src/layout/tile.rs15
1 files changed, 13 insertions, 2 deletions
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<W: LayoutElement> Tile<W> {
pub fn new(window: W, options: Rc<Options>) -> 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<W: LayoutElement> Tile<W> {
}
pub fn update_config(&mut self, options: Rc<Options>) {
- 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<W: LayoutElement> Tile<W> {
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) {