summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-12-02 19:01:51 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-12-02 21:01:22 +0200
commite5b0ff4fe2799339076de95227b13d9755245f5f (patch)
treef214dfde40d5545bb6a87c9bc3ff0e7dac5604d1
parent68f9d1220bbbd023a184aea3565149c8d45dbfe5 (diff)
state: remove runtime_settings
-rw-r--r--src/components/mail/listing/thread.rs7
-rw-r--r--src/components/mail/view/thread.rs6
-rw-r--r--src/state.rs4
3 files changed, 12 insertions, 5 deletions
diff --git a/src/components/mail/listing/thread.rs b/src/components/mail/listing/thread.rs
index ed347527..705fada0 100644
--- a/src/components/mail/listing/thread.rs
+++ b/src/components/mail/listing/thread.rs
@@ -1090,7 +1090,12 @@ impl Component for ThreadListing {
/* Render the mail body in a pager, basically copy what HSplit does */
let total_rows = get_y(bottom_right) - get_y(upper_left);
- let pager_ratio = context.runtime_settings.pager.pager_ratio;
+ let pager_ratio = *mailbox_settings!(
+ context[self.cursor_pos.0][&self.cursor_pos.1]
+ .pager
+ .pager_ratio
+ );
+
let bottom_entity_rows = (pager_ratio * total_rows) / 100;
if bottom_entity_rows > total_rows {
diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs
index 7d3e2c99..147ab6ff 100644
--- a/src/components/mail/view/thread.rs
+++ b/src/components/mail/view/thread.rs
@@ -748,7 +748,11 @@ impl ThreadView {
let bottom_right = bottom_right!(area);
let total_rows = height!(area);
- let pager_ratio = context.runtime_settings.pager.pager_ratio;
+ let pager_ratio = *mailbox_settings!(
+ context[self.coordinates.0][&self.coordinates.1]
+ .pager
+ .pager_ratio
+ );
let mut bottom_entity_rows = (pager_ratio * total_rows) / 100;
if bottom_entity_rows > total_rows {
diff --git a/src/state.rs b/src/state.rs
index 081d00d2..e5a40b15 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -104,7 +104,6 @@ pub struct Context {
pub accounts: IndexMap<AccountHash, Account>,
pub settings: Settings,
- pub runtime_settings: Settings,
/// Areas of the screen that must be redrawn in the next render
pub dirty_areas: VecDeque<Area>,
@@ -342,8 +341,7 @@ impl State {
display_messages_area: ((0, 0), (0, 0)),
context: Context {
accounts,
- settings: settings.clone(),
- runtime_settings: settings,
+ settings: settings,
dirty_areas: VecDeque::with_capacity(5),
replies: VecDeque::with_capacity(5),
temp_files: Vec::new(),