state: remove runtime_settings

jmap-eventsource
Manos Pitsidianakis 2020-12-02 19:01:51 +02:00
parent 68f9d1220b
commit e5b0ff4fe2
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
3 changed files with 12 additions and 5 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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(),