From d8c1050b29a5045f3c963948b3cb832938058042 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Fri, 3 Feb 2023 11:11:43 +0200 Subject: implement margins for all directions --- src/state.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index 5f4d8b9..5884580 100644 --- a/src/state.rs +++ b/src/state.rs @@ -163,11 +163,23 @@ impl State { wayrs_client::cstr!("i3bar-river").into(), layer_surface_cb, ); - layer_surface.set_size(conn, 0, self.shared_state.config.height); - layer_surface.set_anchor(conn, self.shared_state.config.position.into()); + + let config = &self.shared_state.config; + + layer_surface.set_size(conn, 0, config.height); + layer_surface.set_anchor(conn, config.position.into()); + layer_surface.set_margin( + conn, + config.margin_top, + config.margin_right, + config.margin_bottom, + config.margin_left, + ); layer_surface.set_exclusive_zone( conn, - (self.shared_state.config.height + self.shared_state.config.vertical_margin) as i32, + (self.shared_state.config.height) as i32 + + self.shared_state.config.margin_top + + self.shared_state.config.margin_bottom, ); // Note: layer_surface is commited when we receive the scale factor of this output -- cgit v1.3.1