Add focus-window-top/bottom/down-or-top/up-or-bottom actions

This commit is contained in:
Ivan Molodetskikh
2025-02-05 17:18:21 +03:00
parent 900da597e4
commit c41f93a468
9 changed files with 168 additions and 0 deletions
+24
View File
@@ -1422,6 +1422,22 @@ impl<W: LayoutElement> ScrollingSpace<W> {
}
}
pub fn focus_top(&mut self) {
if self.columns.is_empty() {
return;
}
self.columns[self.active_column_idx].focus_top()
}
pub fn focus_bottom(&mut self) {
if self.columns.is_empty() {
return;
}
self.columns[self.active_column_idx].focus_bottom()
}
fn move_column_to(&mut self, new_idx: usize) {
if self.active_column_idx == new_idx {
return;
@@ -3616,6 +3632,14 @@ impl<W: LayoutElement> Column<W> {
true
}
fn focus_top(&mut self) {
self.active_tile_idx = 0;
}
fn focus_bottom(&mut self) {
self.active_tile_idx = self.tiles.len() - 1;
}
fn move_up(&mut self) -> bool {
let new_idx = self.active_tile_idx.saturating_sub(1);
if self.active_tile_idx == new_idx {