[geary] Display total count, not unread, in headerbar for Drafts/Outbox
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Display total count, not unread, in headerbar for Drafts/Outbox
- Date: Tue, 27 May 2014 23:08:50 +0000 (UTC)
commit e44d50561d25fe525287bf0f476dc78c6a7ae364
Author: Jim Nelson <jim yorba org>
Date: Fri Apr 4 14:01:21 2014 -0700
Display total count, not unread, in headerbar for Drafts/Outbox
This is a similar heuristic as in the folder list, as unread counts
in these folders is uninteresting.
src/client/components/main-window.vala | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index d2366b4..0a013ce 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -278,13 +278,25 @@ public class MainWindow : Gtk.ApplicationWindow {
}
main_toolbar.title = current_folder.account.information.nickname;
- if(current_folder.properties.email_unread > 0) {
- /// Current folder's name followed by its unread count, i.e. "Inbox (42)"
- main_toolbar.subtitle = _("%s (%d)").printf(current_folder.get_display_name(),
- current_folder.properties.email_unread);
- } else {
- main_toolbar.subtitle = current_folder.get_display_name();
+
+ /// Current folder's name followed by its unread count, i.e. "Inbox (42)"
+ // except for Drafts and Outbox, where we show total count
+ int count;
+ switch (current_folder.special_folder_type) {
+ case Geary.SpecialFolderType.DRAFTS:
+ case Geary.SpecialFolderType.OUTBOX:
+ count = current_folder.properties.email_total;
+ break;
+
+ default:
+ count = current_folder.properties.email_unread;
+ break;
}
+
+ if (count > 0)
+ main_toolbar.subtitle = _("%s (%d)").printf(current_folder.get_display_name(), count);
+ else
+ main_toolbar.subtitle = current_folder.get_display_name();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]