diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-24 21:49:07 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-24 22:01:26 +0400 |
| commit | 3e598c565e6e8ad4c34e93aec9a49e60d51d730e (patch) | |
| tree | 95d3f12d04f3a416ba86915ebea01b7e0f66498e /src/layout/mod.rs | |
| parent | e261b641ed62474676c90aaa4e734cdd1ecde703 (diff) | |
| download | niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.tar.gz niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.tar.bz2 niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.zip | |
Implement border window rule
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 4c570ef2..4889e9a7 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -463,8 +463,10 @@ impl<W: LayoutElement> Layout<W> { ) -> Option<&Output> { let mut width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w)); if let ColumnWidth::Fixed(w) = &mut width { - if !self.options.border.off { - *w += self.options.border.width as i32 * 2; + let rules = window.rules(); + let border_config = rules.border.resolve_against(self.options.border); + if !border_config.off { + *w += border_config.width as i32 * 2; } } @@ -519,8 +521,10 @@ impl<W: LayoutElement> Layout<W> { ) -> Option<&Output> { let mut width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w)); if let ColumnWidth::Fixed(w) = &mut width { - if !self.options.border.off { - *w += self.options.border.width as i32 * 2; + let rules = window.rules(); + let border_config = rules.border.resolve_against(self.options.border); + if !border_config.off { + *w += border_config.width as i32 * 2; } } @@ -555,8 +559,10 @@ impl<W: LayoutElement> Layout<W> { ) { let mut width = width.unwrap_or_else(|| ColumnWidth::Fixed(window.size().w)); if let ColumnWidth::Fixed(w) = &mut width { - if !self.options.border.off { - *w += self.options.border.width as i32 * 2; + let rules = window.rules(); + let border_config = rules.border.resolve_against(self.options.border); + if !border_config.off { + *w += border_config.width as i32 * 2; } } |
