mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Implement border window rule
This commit is contained in:
+13
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user