mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Implement border window rule
This commit is contained in:
+12
-6
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user