Add open_mailbox shortcut for sidebar

async
Manos Pitsidianakis 2020-04-05 21:35:36 +03:00
parent d8135674df
commit 18dcf15e1e
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
3 changed files with 7 additions and 2 deletions

1
Cargo.lock generated
View File

@ -683,6 +683,7 @@ name = "meli"
version = "0.5.1"
dependencies = [
"bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -843,7 +843,7 @@ impl Component for Listing {
return true;
}
UIEvent::Input(ref k)
if shortcut!(k == shortcuts[CompactListing::DESCRIPTION]["open_thread"]) =>
if shortcut!(k == shortcuts[Listing::DESCRIPTION]["open_mailbox"]) =>
{
self.cursor_pos = self.menu_cursor_pos;
self.change_account(context);
@ -1058,7 +1058,10 @@ impl Component for Listing {
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
let mut map = self.component.get_shortcuts(context);
let config_map = context.settings.shortcuts.listing.key_values();
let mut config_map = context.settings.shortcuts.listing.key_values();
if self.focus != ListingFocus::Menu {
config_map.remove("open_mailbox");
}
map.insert(Listing::DESCRIPTION, config_map);
map

View File

@ -132,6 +132,7 @@ shortcut_key_values! { "listing",
next_page |> "Go to next page." |> Key::PageDown,
prev_account |> "Go to previous account." |> Key::Char('l'),
prev_mailbox |> "Go to previous mailbox." |> Key::Char('K'),
open_mailbox |> "Open selected mailbox" |> Key::Char('\n'),
prev_page |> "Go to previous page." |> Key::PageUp,
search |> "Search within list of e-mails." |> Key::Char('/'),
refresh |> "Manually request a mailbox refresh." |> Key::F(5),