summaryrefslogtreecommitdiffstats
path: root/ui/src/components
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-12-14 18:50:05 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-12-14 18:57:58 +0200
commitab3e01359a077805b7f902a1d746ec5fc0ac1705 (patch)
tree545a18b0e37f9d95d229af544d85693c931545e0 /ui/src/components
parent2e38ea11e21d93c5d8bb4d53c4a0f34681ecf4da (diff)
ui/Component: change set_dirty() to set_dirty(value)
Next commit will need to set a child component as not dirty so we need set_dirty(value) instead of set_dirty() that always sets is to true.
Diffstat (limited to 'ui/src/components')
-rw-r--r--ui/src/components/contacts.rs14
-rw-r--r--ui/src/components/contacts/contact_list.rs30
-rw-r--r--ui/src/components/indexer.rs4
-rw-r--r--ui/src/components/indexer/index.rs16
-rw-r--r--ui/src/components/mail/compose.rs20
-rw-r--r--ui/src/components/mail/listing.rs20
-rw-r--r--ui/src/components/mail/listing/compact.rs14
-rw-r--r--ui/src/components/mail/listing/conversations.rs14
-rw-r--r--ui/src/components/mail/listing/plain.rs14
-rw-r--r--ui/src/components/mail/listing/thread.rs12
-rw-r--r--ui/src/components/mail/status.rs10
-rw-r--r--ui/src/components/mail/view.rs24
-rw-r--r--ui/src/components/mail/view/envelope.rs4
-rw-r--r--ui/src/components/mail/view/html.rs4
-rw-r--r--ui/src/components/mail/view/thread.rs16
-rw-r--r--ui/src/components/notifications.rs10
-rw-r--r--ui/src/components/utilities.rs81
-rw-r--r--ui/src/components/utilities/widgets.rs28
18 files changed, 167 insertions, 168 deletions
diff --git a/ui/src/components/contacts.rs b/ui/src/components/contacts.rs
index 4eef427c..91907a58 100644
--- a/ui/src/components/contacts.rs
+++ b/ui/src/components/contacts.rs
@@ -194,7 +194,7 @@ impl Component for ContactManager {
_ => {}
}
}
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
}
@@ -240,7 +240,7 @@ impl Component for ContactManager {
context.replies.push_back(UIEvent::ComponentKill(self.id));
}
}
- self.set_dirty();
+ self.set_dirty(true);
if let UIEvent::InsertInput(_) = event {
self.has_changes = true;
}
@@ -269,11 +269,11 @@ impl Component for ContactManager {
}
}
- fn set_dirty(&mut self) {
- self.dirty = true;
- self.form.set_dirty();
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
+ self.form.set_dirty(value);
if let ViewMode::Discard(ref mut selector) = self.mode {
- selector.set_dirty();
+ selector.set_dirty(value);
}
}
@@ -301,7 +301,7 @@ impl Component for ContactManager {
true,
context,
));
- self.set_dirty();
+ self.set_dirty(true);
false
}
}
diff --git a/ui/src/components/contacts/contact_list.rs b/ui/src/components/contacts/contact_list.rs
index 89d60bab..a79d4cfd 100644
--- a/ui/src/components/contacts/contact_list.rs
+++ b/ui/src/components/contacts/contact_list.rs
@@ -656,7 +656,7 @@ impl Component for ContactList {
}
if self.account_pos + amount < self.accounts.len() {
self.account_pos += amount;
- self.set_dirty();
+ self.set_dirty(true);
self.initialized = false;
self.cursor_pos = 0;
self.new_cursor_pos = 0;
@@ -693,7 +693,7 @@ impl Component for ContactList {
}
if self.account_pos >= amount {
self.account_pos -= amount;
- self.set_dirty();
+ self.set_dirty(true);
self.cursor_pos = 0;
self.new_cursor_pos = 0;
self.length = 0;
@@ -710,7 +710,7 @@ impl Component for ContactList {
if shortcut!(k == shortcuts[Self::DESCRIPTION]["toggle_menu_visibility"]) =>
{
self.menu_visibility = !self.menu_visibility;
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
self.cmd_buf.clear();
@@ -747,7 +747,7 @@ impl Component for ContactList {
return true;
};
self.movement = Some(PageMovement::Up(amount));
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -769,7 +769,7 @@ impl Component for ContactList {
.push_back(UIEvent::StatusEvent(StatusEvent::BufClear));
return true;
};
- self.set_dirty();
+ self.set_dirty(true);
self.movement = Some(PageMovement::Down(amount));
return true;
}
@@ -789,7 +789,7 @@ impl Component for ContactList {
.push_back(UIEvent::StatusEvent(StatusEvent::BufClear));
return true;
};
- self.set_dirty();
+ self.set_dirty(true);
self.movement = Some(PageMovement::PageUp(mult));
return true;
}
@@ -809,17 +809,17 @@ impl Component for ContactList {
.push_back(UIEvent::StatusEvent(StatusEvent::BufClear));
return true;
};
- self.set_dirty();
+ self.set_dirty(true);
self.movement = Some(PageMovement::PageDown(mult));
return true;
}
UIEvent::Input(ref key) if *key == Key::Home => {
- self.set_dirty();
+ self.set_dirty(true);
self.movement = Some(PageMovement::Home);
return true;
}
UIEvent::Input(ref key) if *key == Key::End => {
- self.set_dirty();
+ self.set_dirty(true);
self.movement = Some(PageMovement::End);
return true;
}
@@ -830,14 +830,14 @@ impl Component for ContactList {
UIEvent::ComponentKill(ref kill_id) if self.mode == ViewMode::View(*kill_id) => {
self.mode = ViewMode::List;
self.view.take();
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::ChangeMode(UIMode::Normal) => {
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::Resize => {
- self.set_dirty();
+ self.set_dirty(true);
}
_ => {}
}
@@ -849,11 +849,11 @@ impl Component for ContactList {
self.dirty || self.view.as_ref().map(|v| v.is_dirty()).unwrap_or(false)
}
- fn set_dirty(&mut self) {
+ fn set_dirty(&mut self, value: bool) {
if let Some(p) = self.view.as_mut() {
- p.set_dirty();
+ p.set_dirty(value);
};
- self.dirty = true;
+ self.dirty = value;
}
fn kill(&mut self, uuid: Uuid, context: &mut Context) {
diff --git a/ui/src/components/indexer.rs b/ui/src/components/indexer.rs
index 6a1bdf1f..150caa85 100644
--- a/ui/src/components/indexer.rs
+++ b/ui/src/components/indexer.rs
@@ -124,8 +124,8 @@ impl Component for Indexer {
self.dirty
}
- fn set_dirty(&mut self) {
- self.dirty = true;
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
}
fn id(&self) -> ComponentId {
diff --git a/ui/src/components/indexer/index.rs b/ui/src/components/indexer/index.rs
index 585b3703..731e5361 100644
--- a/ui/src/components/indexer/index.rs
+++ b/ui/src/components/indexer/index.rs
@@ -131,32 +131,32 @@ impl Component for Index {
UIEvent::Input(Key::Up) => {
if self.cursor_pos > 0 {
self.new_cursor_pos = self.new_cursor_pos.saturating_sub(1);
- self.set_dirty();
+ self.set_dirty(true);
}
return true;
}
UIEvent::Input(Key::Down) => {
if self.length > 0 && self.new_cursor_pos < self.length - 1 {
self.new_cursor_pos += 1;
- self.set_dirty();
+ self.set_dirty(true);
}
return true;
}
UIEvent::Input(Key::Char('\n')) if self.state == IndexState::Listing => {
self.state = IndexState::Unfocused;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(Key::Char('i')) if self.state == IndexState::Unfocused => {
self.state = IndexState::Listing;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::ChangeMode(UIMode::Normal) => {
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::Resize => {
- self.set_dirty();
+ self.set_dirty(true);
}
_ => {}
}
@@ -166,8 +166,8 @@ impl Component for Index {
fn is_dirty(&self) -> bool {
self.dirty || self.content.is_dirty()
}
- fn set_dirty(&mut self) {
- self.dirty = true;
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
}
fn id(&self) -> ComponentId {
diff --git a/ui/src/components/mail/compose.rs b/ui/src/components/mail/compose.rs
index 12429578..8f2838de 100644
--- a/ui/src/components/mail/compose.rs
+++ b/ui/src/components/mail/compose.rs
@@ -507,7 +507,7 @@ impl Component for Composer {
}
} else {
self.embed_area = (upper_left!(header_area), bottom_right!(body_area));
- self.pager.set_dirty();
+ self.pager.set_dirty(true);
self.pager.draw(grid, body_area, context);
}
@@ -642,7 +642,7 @@ impl Component for Composer {
}
_ => {}
}
- self.set_dirty();
+ self.set_dirty(true);
}
return true;
}
@@ -661,7 +661,7 @@ impl Component for Composer {
match *event {
UIEvent::Resize => {
- self.set_dirty();
+ self.set_dirty(true);
}
/*
/* Switch e-mail From: field to the `left` configured account. */
@@ -812,7 +812,7 @@ impl Component for Composer {
}
}
}
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -830,7 +830,7 @@ impl Component for Composer {
context
.replies
.push_back(UIEvent::ChangeMode(UIMode::Embed));
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -997,10 +997,10 @@ impl Component for Composer {
}
}
- fn set_dirty(&mut self) {
- self.dirty = true;
- self.pager.set_dirty();
- self.form.set_dirty();
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
+ self.pager.set_dirty(value);
+ self.form.set_dirty(value);
}
fn kill(&mut self, uuid: Uuid, context: &mut Context) {
@@ -1063,7 +1063,7 @@ impl Component for Composer {
context,
),
);
- self.set_dirty();
+ self.set_dirty(true);
false
}
}
diff --git a/ui/src/components/mail/listing.rs b/ui/src/components/mail/listing.rs
index bd705499..a44c6ac6 100644
--- a/ui/src/components/mail/listing.rs
+++ b/ui/src/components/mail/listing.rs
@@ -387,7 +387,7 @@ impl Component for Listing {
self.cursor_pos.1 += amount;
self.component
.set_coordinates((self.cursor_pos.0, self.cursor_pos.1));
- self.set_dirty();
+ self.set_dirty(true);
} else {
return true;
}
@@ -397,7 +397,7 @@ impl Component for Listing {
self.cursor_pos.1 -= amount;
self.component
.set_coordinates((self.cursor_pos.0, self.cursor_pos.1));
- self.set_dirty();
+ self.set_dirty(true);
} else {
return true;
}
@@ -451,7 +451,7 @@ impl Component for Listing {
if self.cursor_pos.0 + amount < self.accounts.len() {
self.cursor_pos = (self.cursor_pos.0 + amount, 0);
self.component.set_coordinates((self.cursor_pos.0, 0));
- self.set_dirty();
+ self.set_dirty(true);
} else {
return true;
}
@@ -460,7 +460,7 @@ impl Component for Listing {
if self.cursor_pos.0 >= amount {
self.cursor_pos = (self.cursor_pos.0 - amount, 0);
self.component.set_coordinates((self.cursor_pos.0, 0));
- self.set_dirty();
+ self.set_dirty(true);
} else {
return true;
}
@@ -520,7 +520,7 @@ impl Component for Listing {
for i in focused {
self.component.perform_action(context, i, a);
}
- self.component.set_dirty();
+ self.component.set_dirty(true);
return true;
}
_ => {}
@@ -545,7 +545,7 @@ impl Component for Listing {
self.dirty = true;
}
UIEvent::Resize => {
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::Input(ref key)
if shortcut!(key == shortcuts[Listing::DESCRIPTION]["scroll_up"]) =>
@@ -643,7 +643,7 @@ impl Component for Listing {
if shortcut!(k == shortcuts[Listing::DESCRIPTION]["toggle_menu_visibility"]) =>
{
self.menu_visibility = !self.menu_visibility;
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::Input(ref k)
if shortcut!(k == shortcuts[Listing::DESCRIPTION]["new_mail"]) =>
@@ -711,9 +711,9 @@ impl Component for Listing {
fn is_dirty(&self) -> bool {
self.dirty || self.component.is_dirty()
}
- fn set_dirty(&mut self) {
- self.dirty = true;
- self.component.set_dirty();
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
+ self.component.set_dirty(value);
}
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs
index 89015609..e4965fc8 100644
--- a/ui/src/components/mail/listing/compact.rs
+++ b/ui/src/components/mail/listing/compact.rs
@@ -499,7 +499,7 @@ impl ListingTrait for CompactListing {
fn set_movement(&mut self, mvm: PageMovement) {
self.movement = Some(mvm);
- self.set_dirty();
+ self.set_dirty(true);
}
}
@@ -1335,14 +1335,14 @@ impl Component for CompactListing {
) =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::StartupCheck(ref f)
if *f
== context.accounts[self.cursor_pos.0].folders_order[self.new_cursor_pos.1] =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::EnvelopeRename(ref old_hash, ref new_hash) => {
let account = &context.accounts[self.cursor_pos.0];
@@ -1398,7 +1398,7 @@ impl Component for CompactListing {
UIEvent::Input(Key::Esc) if !self.unfocused && !self.filter_term.is_empty() => {
self.set_coordinates((self.new_cursor_pos.0, self.new_cursor_pos.1));
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Action(ref action) => match action {
@@ -1433,11 +1433,11 @@ impl Component for CompactListing {
false
}
}
- fn set_dirty(&mut self) {
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
if self.unfocused {
- self.view.set_dirty();
+ self.view.set_dirty(value);
}
- self.dirty = true;
}
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
diff --git a/ui/src/components/mail/listing/conversations.rs b/ui/src/components/mail/listing/conversations.rs
index 9cfd2543..92c18848 100644
--- a/ui/src/components/mail/listing/conversations.rs
+++ b/ui/src/components/mail/listing/conversations.rs
@@ -469,7 +469,7 @@ impl ListingTrait for ConversationsListing {
fn set_movement(&mut self, mvm: PageMovement) {
self.movement = Some(mvm);
- self.set_dirty();
+ self.set_dirty(true);
}
}
@@ -1353,14 +1353,14 @@ impl Component for ConversationsListing {
) =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::StartupCheck(ref f)
if *f
== context.accounts[self.cursor_pos.0].folders_order[self.new_cursor_pos.1] =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::ChangeMode(UIMode::Normal) => {
self.dirty = true;
@@ -1395,7 +1395,7 @@ impl Component for ConversationsListing {
self.set_coordinates((self.new_cursor_pos.0, self.new_cursor_pos.1));
self.refresh_mailbox(context);
self.force_draw = false;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
_ => {}
@@ -1411,11 +1411,11 @@ impl Component for ConversationsListing {
false
}
}
- fn set_dirty(&mut self) {
+ fn set_dirty(&mut self, value: bool) {
if self.unfocused {
- self.view.set_dirty();
+ self.view.set_dirty(value);
}
- self.dirty = true;
+ self.dirty = value;
}
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
diff --git a/ui/src/components/mail/listing/plain.rs b/ui/src/components/mail/listing/plain.rs
index be72d6d8..e18b85f8 100644
--- a/ui/src/components/mail/listing/plain.rs
+++ b/ui/src/components/mail/listing/plain.rs
@@ -451,7 +451,7 @@ impl ListingTrait for PlainListing {
fn set_movement(&mut self, mvm: PageMovement) {
self.movement = Some(mvm);
- self.set_dirty();
+ self.set_dirty(true);
}
}
@@ -1112,14 +1112,14 @@ impl Component for PlainListing {
) =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::StartupCheck(ref f)
if *f
== context.accounts[self.cursor_pos.0].folders_order[self.new_cursor_pos.1] =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::EnvelopeRename(ref old_hash, ref new_hash) => {
let account = &context.accounts[self.cursor_pos.0];
@@ -1156,7 +1156,7 @@ impl Component for PlainListing {
}
UIEvent::Input(Key::Esc) if !self.unfocused && !self.filter_term.is_empty() => {
self.set_coordinates((self.new_cursor_pos.0, self.new_cursor_pos.1));
- self.set_dirty();
+ self.set_dirty(true);
self.refresh_mailbox(context);
return true;
}
@@ -1192,11 +1192,11 @@ impl Component for PlainListing {
false
}
}
- fn set_dirty(&mut self) {
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
if self.unfocused {
- self.view.set_dirty();
+ self.view.set_dirty(value);
}
- self.dirty = true;
}
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
diff --git a/ui/src/components/mail/listing/thread.rs b/ui/src/components/mail/listing/thread.rs
index 5312c93e..3754dd23 100644
--- a/ui/src/components/mail/listing/thread.rs
+++ b/ui/src/components/mail/listing/thread.rs
@@ -216,7 +216,7 @@ impl ListingTrait for ThreadListing {
fn set_movement(&mut self, mvm: PageMovement) {
self.movement = Some(mvm);
- self.set_dirty();
+ self.set_dirty(true);
}
}
@@ -628,7 +628,7 @@ impl Component for ThreadListing {
) =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::StartupCheck(ref f)
if *f
@@ -636,7 +636,7 @@ impl Component for ThreadListing {
[self.new_cursor_pos.1] =>
{
self.refresh_mailbox(context);
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::ChangeMode(UIMode::Normal) => {
self.dirty = true;
@@ -674,11 +674,11 @@ impl Component for ThreadListing {
fn is_dirty(&self) -> bool {
self.dirty || self.view.as_ref().map(|p| p.is_dirty()).unwrap_or(false)
}
- fn set_dirty(&mut self) {
+ fn set_dirty(&mut self, value: bool) {
if let Some(p) = self.view.as_mut() {
- p.set_dirty();
+ p.set_dirty(value);
};
- self.dirty = true;
+ self.dirty = value;
}
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
self.view
diff --git a/ui/src/components/mail/status.rs b/ui/src/components/mail/status.rs
index e803462c..653e5898 100644
--- a/ui/src/components/mail/status.rs
+++ b/ui/src/components/mail/status.rs
@@ -208,10 +208,10 @@ impl Component for StatusPanel {
fn is_dirty(&self) -> bool {
self.dirty || self.status.as_ref().map(|s| s.is_dirty()).unwrap_or(false)
}
- fn set_dirty(&mut self) {
- self.dirty = true;
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
if let Some(ref mut status) = self.status {
- status.set_dirty();
+ status.set_dirty(value);
}
}
@@ -575,8 +575,8 @@ impl Component for AccountStatus {
fn is_dirty(&self) -> bool {
self.dirty
}
- fn set_dirty(&mut self) {
- self.dirty = true;
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
}
fn id(&self) -> ComponentId {
diff --git a/ui/src/components/mail/view.rs b/ui/src/components/mail/view.rs
index fe5369ba..f8d11998 100644
--- a/ui/src/components/mail/view.rs
+++ b/ui/src/components/mail/view.rs
@@ -269,7 +269,7 @@ impl MailView {
pub fn update(&mut self, new_coordinates: (usize, usize, EnvelopeHash)) {
self.coordinates = new_coordinates;
self.mode = ViewMode::Normal;
- self.set_dirty();
+ self.set_dirty(true);
}
}
@@ -615,7 +615,7 @@ impl Component for MailView {
}
}
}
- self.set_dirty();
+ self.set_dirty(true);
}
return true;
}
@@ -637,7 +637,7 @@ impl Component for MailView {
return true;
}
}
- self.pager.set_dirty();
+ self.pager.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -647,7 +647,7 @@ impl Component for MailView {
{
self.force_draw_headers = true;
self.headers_cursor += 1;
- self.pager.set_dirty();
+ self.pager.set_dirty(true);
return true;
}
_ => {
@@ -718,7 +718,7 @@ impl Component for MailView {
if self.mode.is_contact_selector() =>
{
self.mode = ViewMode::Normal;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
@@ -742,7 +742,7 @@ impl Component for MailView {
&& shortcut!(key == shortcuts[MailView::DESCRIPTION]["view_raw_source"]) =>
{
self.mode = ViewMode::Raw;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -755,7 +755,7 @@ impl Component for MailView {
) =>
{
self.mode = ViewMode::Normal;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -797,7 +797,7 @@ impl Component for MailView {
drop(account);
if let Some(u) = attachments.get(lidx) {
if let Ok(()) = crate::mailcap::MailcapEntry::execute(u, context) {
- self.set_dirty();
+ self.set_dirty(true);
} else {
context.replies.push_back(UIEvent::StatusEvent(
StatusEvent::DisplayMessage(format!(
@@ -1270,15 +1270,15 @@ impl Component for MailView {
false
}
}
- fn set_dirty(&mut self) {
- self.dirty = true;
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
match self.mode {
ViewMode::Normal => {
- self.pager.set_dirty();
+ self.pager.set_dirty(value);
}
ViewMode::Subview => {
if let Some(s) = self.subview.as_mut() {
- s.set_dirty();
+ s.set_dirty(value);
}
}
_ => {}
diff --git a/ui/src/components/mail/view/envelope.rs b/ui/src/components/mail/view/envelope.rs
index 5a43370b..57bfc0d0 100644
--- a/ui/src/components/mail/view/envelope.rs
+++ b/ui/src/components/mail/view/envelope.rs
@@ -541,8 +541,8 @@ impl Component for EnvelopeView {
|| self.pager.as_ref().map(|p| p.is_dirty()).unwrap_or(false)
|| self.subview.as_ref().map(|p| p.is_dirty()).unwrap_or(false)
}
- fn set_dirty(&mut self) {
- self.dirty = true;
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
}
fn id(&self) -> ComponentId {
diff --git a/ui/src/components/mail/view/html.rs b/ui/src/components/mail/view/html.rs
index 1df18c97..9fc5231b 100644
--- a/ui/src/components/mail/view/html.rs
+++ b/ui/src/components/mail/view/html.rs
@@ -160,8 +160,8 @@ impl Component for HtmlView {
fn is_dirty(&self) -> bool {
self.pager.is_dirty()
}
- fn set_dirty(&mut self) {
- self.pager.set_dirty();
+ fn set_dirty(&mut self, value: bool) {
+ self.pager.set_dirty(value);
}
fn id(&self) -> ComponentId {
diff --git a/ui/src/components/mail/view/thread.rs b/ui/src/components/mail/view/thread.rs
index 626e1899..dc4f341a 100644
--- a/ui/src/components/mail/view/thread.rs
+++ b/ui/src/components/mail/view/thread.rs
@@ -155,7 +155,7 @@ impl ThreadView {
self.expanded_pos = new_entry_idx;
}
}
- self.set_dirty();
+ self.set_dirty(true);
}
fn initiate(&mut self, expanded_hash: Option<ThreadHash>, context: &Context) {
/* stack to push thread messages in order in order to pop and print them later */
@@ -1014,7 +1014,7 @@ impl Component for ThreadView {
self.new_expanded_pos = self.current_pos();
self.show_mailview = true;
//self.initiated = false;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -1022,7 +1022,7 @@ impl Component for ThreadView {
{
self.show_mailview = !self.show_mailview;
self.initiated = false;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -1030,7 +1030,7 @@ impl Component for ThreadView {
{
self.show_thread = !self.show_thread;
self.initiated = false;
- self.set_dirty();
+ self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@@ -1076,7 +1076,7 @@ impl Component for ThreadView {
return true;
}
UIEvent::Resize => {
- self.set_dirty();
+ self.set_dirty(true);
}
UIEvent::EnvelopeRename(ref old_hash, ref new_hash) => {
let account = &context.accounts[self.coordinates.0];
@@ -1104,9 +1104,9 @@ impl Component for ThreadView {
fn is_dirty(&self) -> bool {
self.dirty || (self.show_mailview && self.mailview.is_dirty())
}
- fn set_dirty(&mut self) {
- self.dirty = true;
- self.mailview.set_dirty();
+ fn set_dirty(&mut self, value: bool) {
+ self.dirty = value;
+ self.mailview.set_dirty(value);
}
fn get_shortcuts(&self, context: &Context) -> ShortcutMaps {
let mut map = self.mailview.get_shortcuts(context);
diff --git a/ui/src/components/notifications.rs b/ui/src/components/notifications.rs
index 8e603662..ec4c0ae4 100644
--- a/ui/src/components/notifications.rs
+++ b/