[balsa/gtk4: 171/311] balsa-mime-widget-crypto: Stop using GtkButtonBox




commit c7da57654bafa790c7ea8f5f935afe00fd267409
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Aug 28 17:49:00 2020 -0400

    balsa-mime-widget-crypto: Stop using GtkButtonBox

 src/balsa-mime-widget-crypto.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index e2a428456..25ded8589 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -129,22 +129,23 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
     if (g_mime_gpgme_sigstat_protocol(mime_body->sig_info) == GPGME_PROTOCOL_OpenPGP) {
        GtkWidget *hbox;
         GtkWidget *button;
+        GtkSizeGroup *size_group;
 
-        hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-        gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_EXPAND);
-        gtk_box_set_spacing(GTK_BOX(hbox), BMW_HBOX_SPACE);
-
+        hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, BMW_HBOX_SPACE);
         gtk_widget_set_vexpand(hbox, TRUE);
         gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
         gtk_container_add(GTK_CONTAINER(vbox), hbox);
+
+        size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
+
         if (g_mime_gpgme_sigstat_status(mime_body->sig_info) == GPG_ERR_NO_PUBKEY) {
 #ifdef ENABLE_AUTOCRYPT
                GBytes *autocrypt_key;
 
                autocrypt_key = autocrypt_get_key(g_mime_gpgme_sigstat_fingerprint(mime_body->sig_info), 
NULL);
                if (autocrypt_key != NULL) {
-                       button = libbalsa_add_mnemonic_button_to_box(_("_Import Autocrypt key"),
-                                                            hbox, GTK_ALIGN_FILL);
+                       button = libbalsa_button_box_button(_("_Import Autocrypt key"),
+                                                            size_group, GTK_ALIGN_FILL);
                        g_object_set_data_full(G_OBJECT(button), "autocrypt_key", autocrypt_key, 
(GDestroyNotify) g_bytes_unref);
                        g_signal_connect(button, "clicked", G_CALLBACK(on_key_import_button), NULL);
                        gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
@@ -155,18 +156,16 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
                        gtk_container_add(GTK_CONTAINER(hbox), button);
                }
 #endif
-            button = libbalsa_add_mnemonic_button_to_box(_("_Search key server for this key"),
-                                                hbox, GTK_ALIGN_FILL);
+            button = libbalsa_button_box_button(_("_Search key server for this key"),
+                                                size_group, GTK_ALIGN_FILL);
         } else {
-            button = libbalsa_add_mnemonic_button_to_box(_("_Search key server for updates of this key"),
-                                                hbox, GTK_ALIGN_FILL);
+            button = libbalsa_button_box_button(_("_Search key server for updates of this key"),
+                                                size_group, GTK_ALIGN_FILL);
         }
         g_signal_connect(button, "clicked",
                          G_CALLBACK(on_gpg_key_button),
                          (gpointer) g_mime_gpgme_sigstat_fingerprint(mime_body->sig_info));
 
-        gtk_widget_set_hexpand(button, TRUE);
-        gtk_widget_set_halign(button, GTK_ALIGN_FILL);
         gtk_container_add(GTK_CONTAINER(hbox), button);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]