aboutsummaryrefslogtreecommitdiff
path: root/src/layout/workspace.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-15 10:53:15 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-30 20:12:37 +0300
commit3c67b08488789d5781a4b58d4503559145755ba7 (patch)
tree9391aa4bb4c242cb94e8dc3d4df21da0284727e5 /src/layout/workspace.rs
parent4add755a4d72132324be5cfd04fd119850519b5b (diff)
downloadniri-3c67b08488789d5781a4b58d4503559145755ba7.tar.gz
niri-3c67b08488789d5781a4b58d4503559145755ba7.tar.bz2
niri-3c67b08488789d5781a4b58d4503559145755ba7.zip
floating: Implement directional move
Diffstat (limited to 'src/layout/workspace.rs')
-rw-r--r--src/layout/workspace.rs24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs
index 46ed669e..b5d0f894 100644
--- a/src/layout/workspace.rs
+++ b/src/layout/workspace.rs
@@ -840,16 +840,20 @@ impl<W: LayoutElement> Workspace<W> {
pub fn move_left(&mut self) -> bool {
if self.floating_is_active {
- return true;
+ self.floating.move_left();
+ true
+ } else {
+ self.scrolling.move_left()
}
- self.scrolling.move_left()
}
pub fn move_right(&mut self) -> bool {
if self.floating_is_active {
- return true;
+ self.floating.move_right();
+ true
+ } else {
+ self.scrolling.move_right()
}
- self.scrolling.move_right()
}
pub fn move_column_to_first(&mut self) {
@@ -868,16 +872,20 @@ impl<W: LayoutElement> Workspace<W> {
pub fn move_down(&mut self) -> bool {
if self.floating_is_active {
- return true;
+ self.floating.move_down();
+ true
+ } else {
+ self.scrolling.move_down()
}
- self.scrolling.move_down()
}
pub fn move_up(&mut self) -> bool {
if self.floating_is_active {
- return true;
+ self.floating.move_up();
+ true
+ } else {
+ self.scrolling.move_up()
}
- self.scrolling.move_up()
}
pub fn consume_or_expel_window_left(&mut self, window: Option<&W::Id>) {