[geary/mjog/1193-conversation-buttons-resize-race: 4/11] client: Add a `justified_pack` property Component.ConversationActions
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/1193-conversation-buttons-resize-race: 4/11] client: Add a `justified_pack` property Component.ConversationActions
- Date: Sun, 11 Apr 2021 06:52:45 +0000 (UTC)
commit a41a2d3ec9d7b66ce4247dd2f1278cbe31b66574
Author: Michael Gratton <mike vee net>
Date: Sat Apr 10 21:23:59 2021 +1000
client: Add a `justified_pack` property Component.ConversationActions
Allows getting split alignment of buttons back for the conversation
list's actions.
.../components-conversation-actions.vala | 10 ++++--
ui/application-main-window.ui | 2 +-
ui/components-conversation-actions.ui | 37 +++++++---------------
3 files changed, 20 insertions(+), 29 deletions(-)
---
diff --git a/src/client/components/components-conversation-actions.vala
b/src/client/components/components-conversation-actions.vala
index 51e6a145f..c30e33800 100644
--- a/src/client/components/components-conversation-actions.vala
+++ b/src/client/components/components-conversation-actions.vala
@@ -10,12 +10,14 @@
* A container of conversation-related actions.
*/
[GtkTemplate (ui = "/org/gnome/Geary/components-conversation-actions.ui")]
-public class Components.ConversationActions : Gtk.Box {
+public class Components.ConversationActions : Gtk.Grid {
public bool show_conversation_actions { get; construct; }
public bool show_response_actions { get; construct; }
+ public bool pack_justified { get; construct; }
+
public FolderPopover copy_folder_menu { get; private set; default = new FolderPopover(); }
public FolderPopover move_folder_menu { get; private set; default = new FolderPopover(); }
@@ -45,7 +47,6 @@ public class Components.ConversationActions : Gtk.Box {
// GObject style constuction to support loading via GTK Builder files
construct {
-
// Assemble the mark menus
Gtk.Builder menu_builder = new Gtk.Builder.from_resource(
"/org/gnome/Geary/components-main-toolbar-menus.ui"
@@ -62,6 +63,11 @@ public class Components.ConversationActions : Gtk.Box {
this.response_buttons.set_visible(this.show_response_actions);
this.mark_copy_move_buttons.set_visible(this.show_conversation_actions);
this.archive_trash_delete_buttons.set_visible(this.show_conversation_actions);
+
+ if (this.pack_justified) {
+ this.archive_trash_delete_buttons.hexpand = true;
+ this.archive_trash_delete_buttons.halign = END;
+ }
}
public void update_trash_button(bool show_trash) {
diff --git a/ui/application-main-window.ui b/ui/application-main-window.ui
index 371accea9..f9c35b654 100644
--- a/ui/application-main-window.ui
+++ b/ui/application-main-window.ui
@@ -108,6 +108,7 @@
<property name="visible">True</property>
<property name="show_conversation_actions">True</property>
<property name="show_response_actions">False</property>
+ <property name="pack_justified">True</property>
<property name="hexpand">True</property>
</object>
</child>
@@ -155,7 +156,6 @@
<property name="visible">True</property>
<property name="show_conversation_actions">False</property>
<property name="show_response_actions">True</property>
- <property name="hexpand">True</property>
</object>
</child>
</object>
diff --git a/ui/components-conversation-actions.ui b/ui/components-conversation-actions.ui
index a64dfbd8c..6ebf17dce 100644
--- a/ui/components-conversation-actions.ui
+++ b/ui/components-conversation-actions.ui
@@ -2,9 +2,10 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
- <template class="ComponentsConversationActions" parent="GtkBox">
+ <template class="ComponentsConversationActions" parent="GtkGrid">
+ <property name="orientation">horizontal</property>
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkBox" id="response_buttons">
<property name="visible">True</property>
@@ -25,7 +26,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -46,7 +47,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -67,7 +68,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
@@ -76,11 +77,6 @@
<class name="linked"/>
</style>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkBox" id="mark_copy_move_buttons">
@@ -100,7 +96,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -119,7 +115,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -138,7 +134,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
@@ -147,11 +143,6 @@
<class name="linked"/>
</style>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
<child>
<object class="GtkImage" id="archive_image">
@@ -173,7 +164,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -193,7 +184,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -202,12 +193,6 @@
<class name="linked"/>
</style>
</object>
- <packing>
- <property name="pack_type">end</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</template>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]