Browse Source

state: remove runtime_settings

jmap-eventsource
Manos Pitsidianakis 1 year ago
parent
commit
e5b0ff4fe2
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 7
      src/components/mail/listing/thread.rs
  2. 6
      src/components/mail/view/thread.rs
  3. 4
      src/state.rs

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

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

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

Loading…
Cancel
Save