mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Add focus-window-top/bottom/down-or-top/up-or-bottom actions
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user