diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-02-03 17:47:53 +0200 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-02-03 17:47:53 +0200 |
| commit | 2c6a8a3895158aca192712db8eb6d0dfe13a2998 (patch) | |
| tree | 40f9465283662308af75da01a8d1528983fe2890 | |
| parent | d8c1050b29a5045f3c963948b3cb832938058042 (diff) | |
| download | i3bar-mango-2c6a8a3895158aca192712db8eb6d0dfe13a2998.tar.gz | |
fix margins for all directions
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | src/config.rs | 2 | ||||
| -rw-r--r-- | src/state.rs | 8 |
3 files changed, 8 insertions, 4 deletions
@@ -11,7 +11,7 @@ A list of things that are missing (for now): - Click events lack some info (IDK if anyone actually relies on `x`, `y`, `width`, etc.) - Tray icons -## Advantages +## Features - `river` support (obviously) - `short_text` switching is "progressive" (see https://github.com/i3/i3/issues/4113) diff --git a/src/config.rs b/src/config.rs index 33cb4f7..a65269f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -103,7 +103,7 @@ impl Config { } } -#[derive(Deserialize, Debug, Clone, Copy)] +#[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)] #[serde(rename_all = "lowercase")] pub enum Position { Top, diff --git a/src/state.rs b/src/state.rs index 5884580..b4123d3 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,3 +1,4 @@ +use crate::config::Position; use crate::cursor::CursorTheme; use crate::protocol::*; use crate::wm_info_provider::*; @@ -178,8 +179,11 @@ impl State { layer_surface.set_exclusive_zone( conn, (self.shared_state.config.height) as i32 - + self.shared_state.config.margin_top - + self.shared_state.config.margin_bottom, + + if config.position == Position::Top { + self.shared_state.config.margin_bottom + } else { + self.shared_state.config.margin_top + }, ); // Note: layer_surface is commited when we receive the scale factor of this output |
