diff options
| author | Joe Carstairs <me@joeac.net> | 2026-02-01 21:14:47 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-02-01 21:14:47 +0000 |
| commit | 7454d25d0706db232df46f5912337863805cf560 (patch) | |
| tree | f6db406f182d75982425c5362c7ea6d8dab9de37 /schist_desktop_gui/src | |
| parent | 8f7b89bf656b046269a0a40baa3df670b886d5e6 (diff) | |
Adds keys for expanding and collapsing groups
Diffstat (limited to 'schist_desktop_gui/src')
| -rw-r--r-- | schist_desktop_gui/src/config/keys.rs | 6 | ||||
| -rw-r--r-- | schist_desktop_gui/src/gui.rs | 8 | ||||
| -rw-r--r-- | schist_desktop_gui/src/shortcut.rs | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/config/keys.rs b/schist_desktop_gui/src/config/keys.rs index ff28757..fef2dc3 100644 --- a/schist_desktop_gui/src/config/keys.rs +++ b/schist_desktop_gui/src/config/keys.rs @@ -11,6 +11,8 @@ pub struct Keyboard { pub goto_prev_item: KeyBind, pub goto_next_view: KeyBind, pub goto_prev_view: KeyBind, + pub expand_item: KeyBind, + pub collapse_item: KeyBind, pub goto_view_1: KeyBind, pub goto_view_2: KeyBind, pub goto_view_3: KeyBind, @@ -23,6 +25,8 @@ impl Default for Keyboard { goto_prev_item: KeyBind::goto_prev_item(), goto_next_view: KeyBind::goto_next_view(), goto_prev_view: KeyBind::goto_prev_view(), + expand_item: KeyBind::expand_item(), + collapse_item: KeyBind::collapse_item(), goto_view_1: KeyBind::goto_view_1(), goto_view_2: KeyBind::goto_view_2(), goto_view_3: KeyBind::goto_view_3(), @@ -37,6 +41,8 @@ impl Keyboard { shortcut(self.goto_prev_item.clone(), Command::GotoPrevItem), shortcut(self.goto_next_view.clone(), Command::GotoNextView), shortcut(self.goto_prev_view.clone(), Command::GotoPrevView), + shortcut(self.expand_item.clone(), Command::ExpandItem), + shortcut(self.collapse_item.clone(), Command::CollapseItem), shortcut(self.goto_view_1.clone(), Command::GotoView(View::VIEW_1)), shortcut(self.goto_view_2.clone(), Command::GotoView(View::VIEW_2)), shortcut(self.goto_view_3.clone(), Command::GotoView(View::VIEW_3)), diff --git a/schist_desktop_gui/src/gui.rs b/schist_desktop_gui/src/gui.rs index b7405c6..c11a609 100644 --- a/schist_desktop_gui/src/gui.rs +++ b/schist_desktop_gui/src/gui.rs @@ -109,6 +109,14 @@ impl Gui { self.main_screen.update(main_screen::Message::PrevItem); iced::Task::none() } + crate::shortcut::Command::ExpandItem => { + self.main_screen.update(main_screen::Message::ExpandItem); + iced::Task::none() + } + crate::shortcut::Command::CollapseItem => { + self.main_screen.update(main_screen::Message::CollapseItem); + iced::Task::none() + } } } else { iced::Task::none() diff --git a/schist_desktop_gui/src/shortcut.rs b/schist_desktop_gui/src/shortcut.rs index f979f4e..0b8cb7a 100644 --- a/schist_desktop_gui/src/shortcut.rs +++ b/schist_desktop_gui/src/shortcut.rs @@ -30,6 +30,8 @@ pub enum Command { GotoNextView, GotoPrevView, GotoView(View), + ExpandItem, + CollapseItem, } macro_rules! default { @@ -108,6 +110,8 @@ impl KeyBind { default!(goto_prev_item, "k", Modifiers::EMPTY); default!(goto_next_view, "j", Modifiers::CTRL); default!(goto_prev_view, "k", Modifiers::CTRL); + default!(expand_item, "l", Modifiers::EMPTY); + default!(collapse_item, "h", Modifiers::EMPTY); default!(goto_view_1, "1", Modifiers::CTRL); default!(goto_view_2, "2", Modifiers::CTRL); default!(goto_view_3, "3", Modifiers::CTRL); |
