bin: Rename event handling function

This commit is contained in:
Erik Kundt
2024-04-23 18:06:44 +02:00
parent 0738ec7543
commit 8df76a295d
3 changed files with 21 additions and 21 deletions
+7 -7
View File
@@ -205,9 +205,9 @@ where
self.shortcuts.update(state);
}
fn handle_key_event(&mut self, key: Key) {
fn handle_event(&mut self, key: Key) {
if self.props.show_search {
self.search.handle_key_event(key);
self.search.handle_event(key);
} else {
match key {
Key::Esc | Key::Ctrl('c') => {
@@ -257,7 +257,7 @@ where
});
}
_ => {
self.notifications.handle_key_event(key);
self.notifications.handle_event(key);
}
}
}
@@ -438,7 +438,7 @@ impl<B: Backend> View<State, Action> for Search<B> {
self.input.update(state);
}
fn handle_key_event(&mut self, key: termion::event::Key) {
fn handle_event(&mut self, key: termion::event::Key) {
match key {
Key::Esc => {
let _ = self.base.action_tx.send(Action::CloseSearch);
@@ -447,7 +447,7 @@ impl<B: Backend> View<State, Action> for Search<B> {
let _ = self.base.action_tx.send(Action::ApplySearch);
}
_ => {
self.input.handle_key_event(key);
self.input.handle_event(key);
}
}
}
@@ -589,7 +589,7 @@ where
self.content.update(state);
}
fn handle_key_event(&mut self, key: termion::event::Key) {
fn handle_event(&mut self, key: termion::event::Key) {
match key {
Key::Esc | Key::Ctrl('c') => {
let _ = self.base.action_tx.send(Action::Exit { selection: None });
@@ -598,7 +598,7 @@ where
let _ = self.base.action_tx.send(Action::LeavePage);
}
_ => {
self.content.handle_key_event(key);
self.content.handle_event(key);
}
}
}
+7 -7
View File
@@ -208,9 +208,9 @@ where
self.shortcuts.update(state);
}
fn handle_key_event(&mut self, key: Key) {
fn handle_event(&mut self, key: Key) {
if self.props.show_search {
self.search.handle_key_event(key);
self.search.handle_event(key);
} else {
match key {
Key::Esc | Key::Ctrl('c') => {
@@ -262,7 +262,7 @@ where
});
}
_ => {
self.issues.handle_key_event(key);
self.issues.handle_event(key);
}
}
}
@@ -457,7 +457,7 @@ impl<B: Backend> View<State, Action> for Search<B> {
self.input.update(state);
}
fn handle_key_event(&mut self, key: termion::event::Key) {
fn handle_event(&mut self, key: termion::event::Key) {
match key {
Key::Esc => {
let _ = self.base.action_tx.send(Action::CloseSearch);
@@ -466,7 +466,7 @@ impl<B: Backend> View<State, Action> for Search<B> {
let _ = self.base.action_tx.send(Action::ApplySearch);
}
_ => {
self.input.handle_key_event(key);
self.input.handle_event(key);
}
}
}
@@ -608,7 +608,7 @@ where
self.content.update(state);
}
fn handle_key_event(&mut self, key: termion::event::Key) {
fn handle_event(&mut self, key: termion::event::Key) {
match key {
Key::Esc | Key::Ctrl('c') => {
let _ = self.base.action_tx.send(Action::Exit { selection: None });
@@ -617,7 +617,7 @@ where
let _ = self.base.action_tx.send(Action::LeavePage);
}
_ => {
self.content.handle_key_event(key);
self.content.handle_event(key);
}
}
}
+7 -7
View File
@@ -209,9 +209,9 @@ where
self.shortcuts.update(state);
}
fn handle_key_event(&mut self, key: Key) {
fn handle_event(&mut self, key: Key) {
if self.props.show_search {
self.search.handle_key_event(key);
self.search.handle_event(key);
} else {
match key {
Key::Esc | Key::Ctrl('c') => {
@@ -280,7 +280,7 @@ where
});
}
_ => {
self.patches.handle_key_event(key);
self.patches.handle_event(key);
}
}
}
@@ -485,7 +485,7 @@ impl<B: Backend> View<State, Action> for Search<B> {
self.input.update(state);
}
fn handle_key_event(&mut self, key: termion::event::Key) {
fn handle_event(&mut self, key: termion::event::Key) {
match key {
Key::Esc => {
let _ = self.base.action_tx.send(Action::CloseSearch);
@@ -494,7 +494,7 @@ impl<B: Backend> View<State, Action> for Search<B> {
let _ = self.base.action_tx.send(Action::ApplySearch);
}
_ => {
self.input.handle_key_event(key);
self.input.handle_event(key);
}
}
}
@@ -636,7 +636,7 @@ where
self.content.update(state);
}
fn handle_key_event(&mut self, key: termion::event::Key) {
fn handle_event(&mut self, key: termion::event::Key) {
match key {
Key::Esc | Key::Ctrl('c') => {
let _ = self.base.action_tx.send(Action::Exit { selection: None });
@@ -645,7 +645,7 @@ where
let _ = self.base.action_tx.send(Action::LeavePage);
}
_ => {
self.content.handle_key_event(key);
self.content.handle_event(key);
}
}
}