summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoscha <joscha@plugh.de>2022-09-25 22:22:20 +0200
committerJoscha <joscha@plugh.de>2022-09-25 22:35:05 +0200
commitf109fd0d9b6193c1e56fe3127ddb1b6cbfcdb50c (patch)
tree292ff195f380c22e80b6b74421e5c460894e7d02
parentc16ad024edd64b6ae048d63d91d712b5d879bbf4 (diff)
Move cursor in nick list
-rw-r--r--src/ui/euph/room.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/ui/euph/room.rs b/src/ui/euph/room.rs
index 1ee1ae0..f89de09 100644
--- a/src/ui/euph/room.rs
+++ b/src/ui/euph/room.rs
@@ -23,7 +23,7 @@ use crate::ui::widgets::list::ListState;
use crate::ui::widgets::padding::Padding;
use crate::ui::widgets::text::Text;
use crate::ui::widgets::BoxedWidget;
-use crate::ui::UiEvent;
+use crate::ui::{util, UiEvent};
use crate::vault::EuphRoomVault;
use super::account::{self, AccountUiState};
@@ -481,6 +481,20 @@ impl EuphRoom {
false
}
+ fn list_nick_list_focus_key_bindings(&self, bindings: &mut KeyBindingsList) {
+ util::list_list_key_bindings(bindings);
+ }
+
+ fn handle_nick_list_focus_input_event(&mut self, event: &InputEvent) -> bool {
+ if util::handle_list_input_event(&mut self.nick_list, event) {
+ return true;
+ }
+
+ // TODO Inspect users
+
+ false
+ }
+
pub async fn list_normal_key_bindings(&self, bindings: &mut KeyBindingsList) {
// Handled in rooms list, not here
// TODO Move to rooms list?
@@ -498,6 +512,7 @@ impl EuphRoom {
}
Focus::NickList => {
bindings.binding("tab", "focus on chat");
+ self.list_nick_list_focus_key_bindings(bindings);
}
}
}
@@ -533,6 +548,10 @@ impl EuphRoom {
self.focus = Focus::Chat;
return true;
}
+
+ if self.handle_nick_list_focus_input_event(event) {
+ return true;
+ }
}
}