summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-04-05 21:35:36 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-04-05 21:35:36 +0300
commit18dcf15e1eb8b2b915016233b7185dd6ef36e1ef (patch)
treee5781c8206285a78a67082e82d7d532cecbcd47f
parentd8135674dfb1f8ae22607ef7e41e5e33e39b3f61 (diff)
Add open_mailbox shortcut for sidebar
-rw-r--r--Cargo.lock1
-rw-r--r--src/components/mail/listing.rs7
-rw-r--r--src/conf/shortcuts.rs1
3 files changed, 7 insertions, 2 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 208b87a0..b0d25681 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -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)",
diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs
index 99bc7a84..547abdda 100644
--- a/src/components/mail/listing.rs
+++ b/src/components/mail/listing.rs
@@ -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
diff --git a/src/conf/shortcuts.rs b/src/conf/shortcuts.rs
index 03b6eb7d..dec44c39 100644
--- a/src/conf/shortcuts.rs
+++ b/src/conf/shortcuts.rs
@@ -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),