Implement border window rule

This commit is contained in:
Ivan Molodetskikh
2024-04-24 21:49:07 +04:00
parent e261b641ed
commit 3e598c565e
8 changed files with 203 additions and 36 deletions
+13 -2
View File
@@ -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) {