mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-18 23:09:53 +02:00
feat(wm): add right-main-vertical-stack layout
This commit adds a new RightMainVerticalStack layout, adapting code from the similarly named LeftWM layout. It turns out that the horizontal axis flip on the VerticalStack does not play well with resize offsets. It was ultimately easier to implement this layout and the logic for resizing both VerticalStack and RightMainVerticalStack independently than to make resize offsets and horizontal axis flips work together. I still have no idea why resize offsets and horizontal axis flips aren't working properly together. Horizontal axis flips have been disabled for both the VerticalStack and RightMainVerticalStack layouts. re #789
This commit is contained in:
@@ -30,6 +30,7 @@ pub enum DefaultLayout {
|
||||
HorizontalStack,
|
||||
UltrawideVerticalStack,
|
||||
Grid,
|
||||
RightMainVerticalStack,
|
||||
// NOTE: If any new layout is added, please make sure to register the same in `DefaultLayout::cycle`
|
||||
}
|
||||
|
||||
@@ -44,7 +45,13 @@ impl DefaultLayout {
|
||||
sizing: Sizing,
|
||||
delta: i32,
|
||||
) -> Option<Rect> {
|
||||
if !matches!(self, Self::BSP) && !matches!(self, Self::UltrawideVerticalStack) {
|
||||
if !matches!(
|
||||
self,
|
||||
Self::BSP
|
||||
| Self::UltrawideVerticalStack
|
||||
| Self::VerticalStack
|
||||
| Self::RightMainVerticalStack
|
||||
) {
|
||||
return None;
|
||||
};
|
||||
|
||||
@@ -146,7 +153,8 @@ impl DefaultLayout {
|
||||
Self::VerticalStack => Self::HorizontalStack,
|
||||
Self::HorizontalStack => Self::UltrawideVerticalStack,
|
||||
Self::UltrawideVerticalStack => Self::Grid,
|
||||
Self::Grid => Self::BSP,
|
||||
Self::Grid => Self::RightMainVerticalStack,
|
||||
Self::RightMainVerticalStack => Self::BSP,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +167,8 @@ impl DefaultLayout {
|
||||
Self::VerticalStack => Self::Rows,
|
||||
Self::Rows => Self::Columns,
|
||||
Self::Columns => Self::Grid,
|
||||
Self::Grid => Self::BSP,
|
||||
Self::Grid => Self::RightMainVerticalStack,
|
||||
Self::RightMainVerticalStack => Self::BSP,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user