[geary/mjog/1193-conversation-buttons-resize-race: 2/9] client: Ensure conversation list action bar shown when main window folded
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/1193-conversation-buttons-resize-race: 2/9] client: Ensure conversation list action bar shown when main window folded
- Date: Tue, 13 Apr 2021 14:49:58 +0000 (UTC)
commit d695f5b5fefdb6d24c6b171f3861bec1b0687f78
Author: Michael Gratton <mike vee net>
Date: Sun Apr 11 12:00:35 2021 +1000
client: Ensure conversation list action bar shown when main window folded
.../application/application-main-window.vala | 26 ++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/src/client/application/application-main-window.vala
b/src/client/application/application-main-window.vala
index 14c0ab98c..b2cefcfa3 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -262,7 +262,19 @@ public class Application.MainWindow :
}
- private enum ConversationCount { NONE, SINGLE, MULTIPLE; }
+ private enum ConversationCount {
+ NONE, SINGLE, MULTIPLE;
+
+ public static ConversationCount for_size(int size) {
+ return (
+ size == 0
+ ? NONE
+ : size == 1
+ ? SINGLE
+ : MULTIPLE
+ );
+ }
+ }
/** Returns the window's associated client application instance. */
@@ -1808,12 +1820,18 @@ public class Application.MainWindow :
);
this.update_context_dependent_actions.begin(sensitive);
+ update_conversation_list_actions_revealer(count);
+ }
+
+ private void update_conversation_list_actions_revealer(ConversationCount count) {
switch (count) {
case NONE:
this.conversation_list_actions_revealer.reveal_child = false;
break;
case SINGLE:
- this.conversation_list_actions_revealer.reveal_child = false;
+ this.conversation_list_actions_revealer.reveal_child = (
+ this.outer_leaflet.folded
+ );
break;
case MULTIPLE:
this.conversation_list_actions_revealer.reveal_child = true;
@@ -2060,6 +2078,10 @@ public class Application.MainWindow :
[GtkCallback]
private void on_outer_leaflet_changed() {
+ int selected = this.conversation_list_view.get_selected().size;
+ update_conversation_list_actions_revealer(
+ ConversationCount.for_size(selected)
+ );
if (this.has_composer &&
this.outer_leaflet.folded &&
(this.is_folder_list_shown || this.is_conversation_list_shown)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]