mail/listing: fix SEEN flag update hiding mail view momentarily
parent
7606317f24
commit
abc56eae43
|
@ -242,7 +242,7 @@ impl MailListingTrait for CompactListing {
|
||||||
/// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has
|
/// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has
|
||||||
/// chosen.
|
/// chosen.
|
||||||
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
|
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
self.rows.clear();
|
self.rows.clear();
|
||||||
let old_cursor_pos = self.cursor_pos;
|
let old_cursor_pos = self.cursor_pos;
|
||||||
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
||||||
|
@ -1783,7 +1783,7 @@ impl Component for CompactListing {
|
||||||
self.sortcmd = true;
|
self.sortcmd = true;
|
||||||
if !self.filtered_selection.is_empty() {
|
if !self.filtered_selection.is_empty() {
|
||||||
// FIXME: perform sort
|
// FIXME: perform sort
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
} else {
|
} else {
|
||||||
self.refresh_mailbox(context, false);
|
self.refresh_mailbox(context, false);
|
||||||
}
|
}
|
||||||
|
@ -1854,7 +1854,7 @@ impl Component for CompactListing {
|
||||||
self.rows.row_update_add_thread(thread);
|
self.rows.row_update_add_thread(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
self.view
|
self.view
|
||||||
|
@ -1884,7 +1884,7 @@ impl Component for CompactListing {
|
||||||
self.rows.row_update_add_thread(thread);
|
self.rows.row_update_add_thread(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
self.view
|
self.view
|
||||||
|
@ -1892,10 +1892,10 @@ impl Component for CompactListing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UIEvent::ChangeMode(UIMode::Normal) => {
|
UIEvent::ChangeMode(UIMode::Normal) => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Resize => {
|
UIEvent::Resize => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc)
|
UIEvent::Input(Key::Esc)
|
||||||
if !self.unfocused()
|
if !self.unfocused()
|
||||||
|
@ -1909,7 +1909,7 @@ impl Component for CompactListing {
|
||||||
for v in self.rows.selection.values_mut() {
|
for v in self.rows.selection.values_mut() {
|
||||||
*v = false;
|
*v = false;
|
||||||
}
|
}
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => {
|
UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => {
|
||||||
|
|
|
@ -168,7 +168,7 @@ impl MailListingTrait for ConversationsListing {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
|
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
let old_mailbox_hash = self.cursor_pos.1;
|
let old_mailbox_hash = self.cursor_pos.1;
|
||||||
let old_cursor_pos = self.cursor_pos;
|
let old_cursor_pos = self.cursor_pos;
|
||||||
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
||||||
|
@ -1327,7 +1327,7 @@ impl Component for ConversationsListing {
|
||||||
self.rows.rename_env(*old_hash, *new_hash);
|
self.rows.rename_env(*old_hash, *new_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
self.view.process_event(
|
self.view.process_event(
|
||||||
|
@ -1359,7 +1359,7 @@ impl Component for ConversationsListing {
|
||||||
self.rows.row_updates.push(*env_hash);
|
self.rows.row_updates.push(*env_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
self.view
|
self.view
|
||||||
|
@ -1392,7 +1392,7 @@ impl Component for ConversationsListing {
|
||||||
self.sort,
|
self.sort,
|
||||||
&context.accounts[&self.cursor_pos.0].collection.envelopes,
|
&context.accounts[&self.cursor_pos.0].collection.envelopes,
|
||||||
);
|
);
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
} else {
|
} else {
|
||||||
self.refresh_mailbox(context, false);
|
self.refresh_mailbox(context, false);
|
||||||
}
|
}
|
||||||
|
@ -1441,10 +1441,10 @@ impl Component for ConversationsListing {
|
||||||
self.set_dirty(true);
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::ChangeMode(UIMode::Normal) => {
|
UIEvent::ChangeMode(UIMode::Normal) => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Resize => {
|
UIEvent::Resize => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Action(ref action) => match action {
|
UIEvent::Action(ref action) => match action {
|
||||||
Action::Listing(Search(ref filter_term)) if !self.unfocused() => {
|
Action::Listing(Search(ref filter_term)) if !self.unfocused() => {
|
||||||
|
@ -1482,7 +1482,7 @@ impl Component for ConversationsListing {
|
||||||
.any(std::convert::identity) =>
|
.any(std::convert::identity) =>
|
||||||
{
|
{
|
||||||
self.rows.clear_selection();
|
self.rows.clear_selection();
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Char(''))
|
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Char(''))
|
||||||
|
|
|
@ -185,7 +185,7 @@ impl MailListingTrait for PlainListing {
|
||||||
/// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has
|
/// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has
|
||||||
/// chosen.
|
/// chosen.
|
||||||
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
|
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
let old_cursor_pos = self.cursor_pos;
|
let old_cursor_pos = self.cursor_pos;
|
||||||
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
||||||
&& self.cursor_pos.1 == self.new_cursor_pos.1)
|
&& self.cursor_pos.1 == self.new_cursor_pos.1)
|
||||||
|
@ -1478,7 +1478,7 @@ impl Component for PlainListing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
self.view
|
self.view
|
||||||
|
@ -1497,7 +1497,7 @@ impl Component for PlainListing {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.rows.row_updates.push(*env_hash);
|
self.rows.row_updates.push(*env_hash);
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
self.view
|
self.view
|
||||||
|
@ -1505,10 +1505,10 @@ impl Component for PlainListing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UIEvent::ChangeMode(UIMode::Normal) => {
|
UIEvent::ChangeMode(UIMode::Normal) => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Resize => {
|
UIEvent::Resize => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc)
|
UIEvent::Input(Key::Esc)
|
||||||
if !self.unfocused()
|
if !self.unfocused()
|
||||||
|
@ -1520,7 +1520,7 @@ impl Component for PlainListing {
|
||||||
.any(std::convert::identity) =>
|
.any(std::convert::identity) =>
|
||||||
{
|
{
|
||||||
self.rows.clear_selection();
|
self.rows.clear_selection();
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => {
|
UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => {
|
||||||
|
|
|
@ -170,7 +170,7 @@ impl MailListingTrait for ThreadListing {
|
||||||
/// Fill the `self.content` `CellBuffer` with the contents of the account mailbox the user has
|
/// Fill the `self.content` `CellBuffer` with the contents of the account mailbox the user has
|
||||||
/// chosen.
|
/// chosen.
|
||||||
fn refresh_mailbox(&mut self, context: &mut Context, _force: bool) {
|
fn refresh_mailbox(&mut self, context: &mut Context, _force: bool) {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
if !(self.cursor_pos.0 == self.new_cursor_pos.0
|
||||||
&& self.cursor_pos.1 == self.new_cursor_pos.1)
|
&& self.cursor_pos.1 == self.new_cursor_pos.1)
|
||||||
{
|
{
|
||||||
|
@ -1409,7 +1409,7 @@ impl Component for ThreadListing {
|
||||||
(self.rows.entries[row].0).1 = *new_hash;
|
(self.rows.entries[row].0).1 = *new_hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
if let Some(v) = self.view.as_mut() {
|
if let Some(v) = self.view.as_mut() {
|
||||||
|
@ -1435,7 +1435,7 @@ impl Component for ThreadListing {
|
||||||
self.rows.row_updates.push(*env_hash);
|
self.rows.row_updates.push(*env_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
|
|
||||||
if self.unfocused() {
|
if self.unfocused() {
|
||||||
if let Some(v) = self.view.as_mut() {
|
if let Some(v) = self.view.as_mut() {
|
||||||
|
@ -1444,10 +1444,10 @@ impl Component for ThreadListing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UIEvent::ChangeMode(UIMode::Normal) => {
|
UIEvent::ChangeMode(UIMode::Normal) => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Resize => {
|
UIEvent::Resize => {
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc)
|
UIEvent::Input(Key::Esc)
|
||||||
if !self.unfocused()
|
if !self.unfocused()
|
||||||
|
@ -1461,7 +1461,7 @@ impl Component for ThreadListing {
|
||||||
for v in self.rows.selection.values_mut() {
|
for v in self.rows.selection.values_mut() {
|
||||||
*v = false;
|
*v = false;
|
||||||
}
|
}
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UIEvent::Input(ref key)
|
UIEvent::Input(ref key)
|
||||||
|
@ -1480,14 +1480,14 @@ impl Component for ThreadListing {
|
||||||
Action::SubSort(field, order) => {
|
Action::SubSort(field, order) => {
|
||||||
debug!("SubSort {:?} , {:?}", field, order);
|
debug!("SubSort {:?} , {:?}", field, order);
|
||||||
self.subsort = (*field, *order);
|
self.subsort = (*field, *order);
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
self.refresh_mailbox(context, false);
|
self.refresh_mailbox(context, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Action::Sort(field, order) => {
|
Action::Sort(field, order) => {
|
||||||
debug!("Sort {:?} , {:?}", field, order);
|
debug!("Sort {:?} , {:?}", field, order);
|
||||||
self.sort = (*field, *order);
|
self.sort = (*field, *order);
|
||||||
self.dirty = true;
|
self.set_dirty(true);
|
||||||
self.refresh_mailbox(context, false);
|
self.refresh_mailbox(context, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue