mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Close popups also with <ENTER>
This commit is contained in:
@@ -405,7 +405,7 @@ impl AuthActivity {
|
|||||||
pub(super) fn handle_input_event_mode_popup_alert(&mut self, ev: &InputEvent) {
|
pub(super) fn handle_input_event_mode_popup_alert(&mut self, ev: &InputEvent) {
|
||||||
// Only enter should be allowed here
|
// Only enter should be allowed here
|
||||||
if let InputEvent::Key(key) = ev {
|
if let InputEvent::Key(key) = ev {
|
||||||
if let KeyCode::Enter = key.code {
|
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
|
||||||
self.input_mode = InputMode::Form; // Hide popup
|
self.input_mode = InputMode::Form; // Hide popup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -417,12 +417,9 @@ impl AuthActivity {
|
|||||||
pub(super) fn handle_input_event_mode_popup_help(&mut self, ev: &InputEvent) {
|
pub(super) fn handle_input_event_mode_popup_help(&mut self, ev: &InputEvent) {
|
||||||
// If enter, close popup
|
// If enter, close popup
|
||||||
if let InputEvent::Key(key) = ev {
|
if let InputEvent::Key(key) = ev {
|
||||||
match key.code {
|
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
|
||||||
KeyCode::Enter | KeyCode::Esc => {
|
// Set input mode back to form
|
||||||
// Set input mode back to form
|
self.input_mode = InputMode::Form;
|
||||||
self.input_mode = InputMode::Form;
|
|
||||||
}
|
|
||||||
_ => { /* Nothing to do */ }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ impl FileTransferActivity {
|
|||||||
pub(super) fn handle_input_event_mode_popup_alert(&mut self, ev: &InputEvent) {
|
pub(super) fn handle_input_event_mode_popup_alert(&mut self, ev: &InputEvent) {
|
||||||
// If enter, close popup
|
// If enter, close popup
|
||||||
if let InputEvent::Key(key) = ev {
|
if let InputEvent::Key(key) = ev {
|
||||||
if let KeyCode::Enter = key.code {
|
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
|
||||||
// Set input mode back to explorer
|
// Set input mode back to explorer
|
||||||
self.input_mode = InputMode::Explorer;
|
self.input_mode = InputMode::Explorer;
|
||||||
}
|
}
|
||||||
@@ -618,12 +618,9 @@ impl FileTransferActivity {
|
|||||||
pub(super) fn handle_input_event_mode_popup_fileinfo(&mut self, ev: &InputEvent) {
|
pub(super) fn handle_input_event_mode_popup_fileinfo(&mut self, ev: &InputEvent) {
|
||||||
// If enter, close popup
|
// If enter, close popup
|
||||||
if let InputEvent::Key(key) = ev {
|
if let InputEvent::Key(key) = ev {
|
||||||
match key.code {
|
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
|
||||||
KeyCode::Enter | KeyCode::Esc => {
|
// Set input mode back to explorer
|
||||||
// Set input mode back to explorer
|
self.input_mode = InputMode::Explorer;
|
||||||
self.input_mode = InputMode::Explorer;
|
|
||||||
}
|
|
||||||
_ => { /* Nothing to do */ }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -634,12 +631,9 @@ impl FileTransferActivity {
|
|||||||
pub(super) fn handle_input_event_mode_popup_help(&mut self, ev: &InputEvent) {
|
pub(super) fn handle_input_event_mode_popup_help(&mut self, ev: &InputEvent) {
|
||||||
// If enter, close popup
|
// If enter, close popup
|
||||||
if let InputEvent::Key(key) = ev {
|
if let InputEvent::Key(key) = ev {
|
||||||
match key.code {
|
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
|
||||||
KeyCode::Enter | KeyCode::Esc => {
|
// Set input mode back to explorer
|
||||||
// Set input mode back to explorer
|
self.input_mode = InputMode::Explorer;
|
||||||
self.input_mode = InputMode::Explorer;
|
|
||||||
}
|
|
||||||
_ => { /* Nothing to do */ }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -650,7 +644,7 @@ impl FileTransferActivity {
|
|||||||
pub(super) fn handle_input_event_mode_popup_fatal(&mut self, ev: &InputEvent) {
|
pub(super) fn handle_input_event_mode_popup_fatal(&mut self, ev: &InputEvent) {
|
||||||
// If enter, close popup
|
// If enter, close popup
|
||||||
if let InputEvent::Key(key) = ev {
|
if let InputEvent::Key(key) = ev {
|
||||||
if let KeyCode::Enter = key.code {
|
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
|
||||||
// Set quit to true; since a fatal error happened
|
// Set quit to true; since a fatal error happened
|
||||||
self.disconnect();
|
self.disconnect();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user