Add space switching shortcuts
This commit is contained in:
@@ -8,6 +8,7 @@ mod reading_list;
|
||||
mod render;
|
||||
mod sidebar;
|
||||
mod site_permissions;
|
||||
mod spaces;
|
||||
mod splits;
|
||||
mod tab_groups;
|
||||
|
||||
|
||||
@@ -51,7 +51,9 @@ impl ElyShell {
|
||||
.on_action(cx.listener(Self::on_open_settings))
|
||||
.on_action(cx.listener(Self::on_open_task_manager))
|
||||
.on_action(cx.listener(Self::on_restore_closed_tab))
|
||||
.on_action(cx.listener(Self::on_select_next_space))
|
||||
.on_action(cx.listener(Self::on_select_next_tab))
|
||||
.on_action(cx.listener(Self::on_select_previous_space))
|
||||
.on_action(cx.listener(Self::on_select_previous_tab))
|
||||
.on_action(cx.listener(Self::on_split_right))
|
||||
.on_action(cx.listener(Self::on_toggle_favorite_tab))
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
use gpui::{Context, Window};
|
||||
|
||||
use super::{ElyShell, ShellState};
|
||||
use crate::{SelectNextSpace, SelectPreviousSpace};
|
||||
|
||||
impl ElyShell {
|
||||
pub(super) fn on_select_next_space(
|
||||
&mut self,
|
||||
_: &SelectNextSpace,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if let ShellState::Ready(core) = &mut self.state
|
||||
&& core.select_next_space().is_ok()
|
||||
{
|
||||
self.sync_address_input(window, cx);
|
||||
cx.notify();
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn on_select_previous_space(
|
||||
&mut self,
|
||||
_: &SelectPreviousSpace,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if let ShellState::Ready(core) = &mut self.state
|
||||
&& core.select_previous_space().is_ok()
|
||||
{
|
||||
self.sync_address_input(window, cx);
|
||||
cx.notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user