From be95fb90708bc7016bbf3dc28e5bfa68a77153a6 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 12 Jun 2023 17:25:54 +0200 Subject: [PATCH] tiling: Allow direction to be reversed --- src/shell/layout/tiling/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 824fe7e7..8e37a8ac 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -95,6 +95,18 @@ pub enum Direction { Down, } +impl std::ops::Not for Direction { + type Output = Self; + fn not(self) -> Self::Output { + match self { + Direction::Left => Direction::Right, + Direction::Right => Direction::Left, + Direction::Up => Direction::Down, + Direction::Down => Direction::Up, + } + } +} + #[derive(Debug, Clone, PartialEq)] pub enum FocusResult { None,