summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-01-17 17:40:08 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-17 17:40:08 +0100
commit4988103be43ee441833f71e4467d260c7df70e7c (patch)
tree54ea103e54bb390c4c5effbbb213c543504ac10a
parent112fcf5b3144419dd94d227cd5078db01ef7f372 (diff)
Add mail view right of mail list
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/maillist_view.rs10
-rw-r--r--src/main_view.rs7
2 files changed, 8 insertions, 9 deletions
diff --git a/src/maillist_view.rs b/src/maillist_view.rs
index 2ce9b83..3de8e9f 100644
--- a/src/maillist_view.rs
+++ b/src/maillist_view.rs
@@ -118,13 +118,11 @@ impl MaillistView {
// Why do I have to do this? This is UGLY!
let n = n.clone();
let db_path = db_path.clone();
+ let name = format!("{}-{}", n, mail_id);
+ let mv = MailView::create_for(db_path, mail_id, filename, name).unwrap();
- siv.call_on_name(crate::main_view::MAIN_VIEW_NAME, move |main_view: &mut MainView| {
- let name = format!("{}-{}", n, mail_id);
- debug!("Creating MailView '{}' for {} ({}) in {}", name, mail_id, filename.display(), db_path.display());
- let mv = MailView::create_for(db_path, mail_id, filename, name.clone()).unwrap();
-
- main_view.add_tab(name, mv);
+ siv.call_on_name(crate::main_view::MAIN_MUX_NAME, move |mux: &mut cursive_multiplex::Mux| {
+ mux.add_right_of(mv, mux.root().build().unwrap());
});
// use the mail ID to get the whole thread and open it as a table item
diff --git a/src/main_view.rs b/src/main_view.rs
index a3b0be7..5195fb0 100644
--- a/src/main_view.rs
+++ b/src/main_view.rs
@@ -20,11 +20,12 @@ use cursive::view::SizeConstraint;
use cursive::event::Key;
use getset::{Getters, MutGetters};
+use crate::bindings::BindingCaller;
+use crate::bindings::Bindings;
use crate::configuration::Configuration;
-use crate::maillist_view::MaillistView;
+use crate::mail_view::MailView;
use crate::maillist_view::MailListingData;
-use crate::bindings::Bindings;
-use crate::bindings::BindingCaller;
+use crate::maillist_view::MaillistView;
pub const MAIN_VIEW_NAME: &'static str = "main_view";
pub const MAIN_MUX_NAME: &'static str = "main_mux";