mirror of
https://github.com/rust-kotlin/ashell.git
synced 2026-09-22 16:00:59 +00:00
fix: correctly reset active_dialog in session selector and ssh dialog
This commit is contained in:
+11
-1
@@ -160,7 +160,11 @@ impl Ashell {
|
||||
.child(
|
||||
Button::new("connect-ssh-cancel")
|
||||
.label(t!("cancel").to_string())
|
||||
.on_click(|_, window, cx| window.close_dialog(cx)),
|
||||
.on_click(window.listener_for(&view, |this, _, window, cx| {
|
||||
this.active_dialog = None;
|
||||
window.close_dialog(cx);
|
||||
cx.notify();
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
Button::new("connect-ssh-confirm")
|
||||
@@ -259,8 +263,10 @@ impl Ashell {
|
||||
.on_mouse_down(
|
||||
MouseButton::Left,
|
||||
window.listener_for(&view, |this, _, window, cx| {
|
||||
this.active_dialog = None;
|
||||
this.open_local(cx);
|
||||
window.close_dialog(cx);
|
||||
cx.notify();
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
@@ -301,8 +307,10 @@ impl Ashell {
|
||||
.on_mouse_down(
|
||||
MouseButton::Left,
|
||||
window.listener_for(&view, |this, _, window, cx| {
|
||||
this.active_dialog = None;
|
||||
window.close_dialog(cx);
|
||||
this.open_new_ssh_dialog(window, cx);
|
||||
cx.notify();
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
@@ -370,11 +378,13 @@ impl Ashell {
|
||||
window.listener_for(
|
||||
&view,
|
||||
move |this, _, window, cx| {
|
||||
this.active_dialog = None;
|
||||
this.connect_saved_session(
|
||||
connect_id.clone(),
|
||||
cx,
|
||||
);
|
||||
window.close_dialog(cx);
|
||||
cx.notify();
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
@@ -113,7 +113,9 @@ impl Ashell {
|
||||
|
||||
self.open_ssh_session(session, cx);
|
||||
self.editing_session_id = None;
|
||||
self.active_dialog = None;
|
||||
window.close_dialog(cx);
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
pub(crate) fn set_input_value(
|
||||
@@ -368,6 +370,7 @@ impl Ashell {
|
||||
return;
|
||||
};
|
||||
|
||||
self.active_dialog = None;
|
||||
match entry {
|
||||
SelectorEntry::Local => {
|
||||
self.open_local(cx);
|
||||
@@ -382,6 +385,7 @@ impl Ashell {
|
||||
window.close_dialog(cx);
|
||||
}
|
||||
}
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
pub(crate) fn on_selector_key_down(
|
||||
|
||||
Reference in New Issue
Block a user