[balsa/gtk4: 82/311] Various: Stop using GtkBox child properties




commit afb75b9e4ab5c728567f3b2d2bcaaffe9cc16ee9
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jun 7 10:21:55 2020 -0400

    Various: Stop using GtkBox child properties
    
    Stop using GtkBox padding, fill and expand child properties.
    
    * libbalsa/address.c (libbalsa_address_get_edit_widget):
    * libbalsa/identity.c (libbalsa_identity_select_dialog),
      (libbalsa_identity_config_dialog):
    * libbalsa/libbalsa-gpgme-widgets.c (libbalsa_key_dialog),
      (create_subkey_widget), (smime_show_chain):
    * libbalsa/libbalsa.c (ask_cert_real):
    * libbalsa/smtp-server.c (libbalsa_smtp_server_dialog):
    * libbalsa/source-viewer.c (libbalsa_show_message_source):
    * libbalsa/x509-cert-widget.c (create_chain_widget):

 ChangeLog                         | 14 ++++++++++++++
 libbalsa/address.c                |  6 ++++--
 libbalsa/identity.c               |  4 ----
 libbalsa/libbalsa-gpgme-widgets.c |  8 ++++----
 libbalsa/libbalsa.c               |  8 ++++----
 libbalsa/smtp-server.c            |  4 +++-
 libbalsa/source-viewer.c          |  9 +++++++--
 libbalsa/x509-cert-widget.c       | 12 ++++++++++--
 8 files changed, 46 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4fbb41a56..d263377f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -600,6 +600,20 @@
        * src/filter-run-dialog.c (balsa_filter_run_dialog_new): call
        prepare-threading to get ready for filtering.
 
+2020-06-07  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Various: Stop using GtkBox padding, fill and expand child properties
+
+       * libbalsa/address.c (libbalsa_address_get_edit_widget):
+       * libbalsa/identity.c (libbalsa_identity_select_dialog),
+       (libbalsa_identity_config_dialog):
+       * libbalsa/libbalsa-gpgme-widgets.c (libbalsa_key_dialog),
+       (create_subkey_widget), (smime_show_chain):
+       * libbalsa/libbalsa.c (ask_cert_real):
+       * libbalsa/smtp-server.c (libbalsa_smtp_server_dialog):
+       * libbalsa/source-viewer.c (libbalsa_show_message_source):
+       * libbalsa/x509-cert-widget.c (create_chain_widget):
+
 2020-06-07  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Various: Stop using GtkBox padding, fill and expand child properties
diff --git a/libbalsa/address.c b/libbalsa/address.c
index 95008f8ff..c7a6584fc 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -982,9 +982,11 @@ libbalsa_address_get_edit_widget(LibBalsaAddress *address,
             GtkWidget *tree_view;
 
             entries[cnt] = lba_addr_list_widget(changed_cb, changed_data);
-            g_object_set(label, "margin", 1, NULL);
+            gtk_widget_set_margin_top(label, 1);
+            gtk_widget_set_margin_bottom(label, 1);
             gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
-            g_object_set(but, "margin", 1, NULL);
+            gtk_widget_set_margin_top(but, 1);
+            gtk_widget_set_margin_bottom(but, 1);
             gtk_box_pack_start(GTK_BOX(box), but,   FALSE, FALSE, 0);
             lhs = box;
             tree_view = gtk_bin_get_child(GTK_BIN(entries[cnt]));
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 2dd175d29..2813aa6bf 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -384,9 +384,7 @@ libbalsa_identity_select_dialog(GtkWindow * parent,
     identity_list_update_real(GTK_TREE_VIEW(tree), identities, initial_id);
 
     frame = gtk_frame_new(NULL);
-    gtk_widget_set_hexpand(frame, TRUE);
     gtk_widget_set_vexpand(frame, TRUE);
-    gtk_widget_set_halign(frame, GTK_ALIGN_FILL);
     gtk_widget_set_valign(frame, GTK_ALIGN_FILL);
     gtk_box_pack_start(GTK_BOX
                        (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
@@ -1677,9 +1675,7 @@ libbalsa_identity_config_dialog(GtkWindow *parent, GList **identities,
                                     IDENTITY_RESPONSE_CLOSE);
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, padding);
-    gtk_widget_set_hexpand(hbox, TRUE);
     gtk_widget_set_vexpand(hbox, TRUE);
-    gtk_widget_set_halign(hbox, GTK_ALIGN_FILL);
     gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
     gtk_box_pack_start(GTK_BOX
                        (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
diff --git a/libbalsa/libbalsa-gpgme-widgets.c b/libbalsa/libbalsa-gpgme-widgets.c
index 18951f474..ba082ca01 100644
--- a/libbalsa/libbalsa-gpgme-widgets.c
+++ b/libbalsa/libbalsa-gpgme-widgets.c
@@ -403,9 +403,7 @@ libbalsa_key_dialog(GtkWindow            *parent,
 
        hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
        gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
-        gtk_widget_set_hexpand(hbox, TRUE);
         gtk_widget_set_vexpand(hbox, TRUE);
-        gtk_widget_set_halign(hbox, GTK_ALIGN_FILL);
         gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
        gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox, FALSE, FALSE, 0);
        gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE);
@@ -644,7 +642,8 @@ create_subkey_widget(gpgme_subkey_t subkey)
 
        subkey_grid = gtk_grid_new();
        gtk_grid_set_column_spacing(GTK_GRID(subkey_grid), 6);
-        g_object_set(subkey_grid, "margin", 2, NULL);
+        gtk_widget_set_margin_top(subkey_grid, 2);
+        gtk_widget_set_margin_bottom(subkey_grid, 2);
 
        /* print a warning for a bad subkey status */
        details_str = create_status_str(subkey->expired != 0U, subkey->revoked != 0U, subkey->disabled != 0U, 
subkey->invalid != 0U);
@@ -778,7 +777,8 @@ smime_show_chain(GtkWidget *button, gpointer G_GNUC_UNUSED user_data)
        vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
         gtk_widget_set_vexpand(chain, TRUE);
         gtk_widget_set_valign(chain, GTK_ALIGN_FILL);
-        g_object_set(chain, "margin", 6, NULL);
+        gtk_widget_set_margin_top(chain, 6);
+        gtk_widget_set_margin_bottom(chain, 6);
        gtk_box_pack_start(GTK_BOX(vbox), chain, FALSE, FALSE, 0);
 
        gtk_widget_show_all(vbox);
diff --git a/libbalsa/libbalsa.c b/libbalsa/libbalsa.c
index 03cd6202e..4c2bf4c15 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -417,16 +417,16 @@ ask_cert_real(void *data)
     label = gtk_label_new(str->str);
     g_string_free(str, TRUE);
     gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
-    g_object_set(label, "margin", 1, NULL);
+    gtk_widget_set_margin_top(label, 1);
+    gtk_widget_set_margin_bottom(label, 1);
     gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
                        label, FALSE, FALSE, 0);
     gtk_widget_show(label);
 
-    gtk_widget_set_hexpand(cert_widget, TRUE);
     gtk_widget_set_vexpand(cert_widget, TRUE);
-    gtk_widget_set_halign(cert_widget, GTK_ALIGN_FILL);
     gtk_widget_set_valign(cert_widget, GTK_ALIGN_FILL);
-    g_object_set(cert_widget, "margin", 1, NULL);
+    gtk_widget_set_margin_top(cert_widget, 1);
+    gtk_widget_set_margin_bottom(cert_widget, 1);
     gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
                        cert_widget, FALSE, FALSE, 0);
     gtk_widget_show_all(cert_widget);
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index a0ca8dd7c..bf13c0aad 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -348,7 +348,9 @@ libbalsa_smtp_server_dialog(LibBalsaSmtpServer * smtp_server,
     sdi->split_button = gtk_check_button_new_with_mnemonic(_("Sp_lit message larger than"));
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
     sdi->big_message = gtk_spin_button_new_with_range(0.1, 100, 0.1);
-    gtk_box_pack_start(GTK_BOX(hbox), sdi->big_message, TRUE, TRUE, 0);
+    gtk_widget_set_hexpand(sdi->big_message, TRUE);
+    gtk_widget_set_halign(sdi->big_message, GTK_ALIGN_FILL);
+    gtk_box_pack_start(GTK_BOX(hbox), sdi->big_message, FALSE, FALSE, 0);
     label = gtk_label_new(_("MB"));
     gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
     if (smtp_server->big_message > 0) {
diff --git a/libbalsa/source-viewer.c b/libbalsa/source-viewer.c
index a80bf2fc4..cf7377c23 100644
--- a/libbalsa/source-viewer.c
+++ b/libbalsa/source-viewer.c
@@ -236,10 +236,15 @@ libbalsa_show_message_source(GtkApplication  * application,
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu(window, GTK_MENU_SHELL(menu_bar));
 #else
-    gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, TRUE, 1);
+    gtk_widget_set_valign(menu_bar, GTK_ALIGN_FILL);
+    gtk_widget_set_margin_top(menu_bar, 1);
+    gtk_widget_set_margin_bottom(menu_bar, 1);
+    gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0);
 #endif
 
-    gtk_box_pack_start(GTK_BOX(vbox), interior, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(interior, TRUE);
+    gtk_widget_set_valign(interior, GTK_ALIGN_FILL);
+    gtk_box_pack_start(GTK_BOX(vbox), interior, FALSE, FALSE, 0);
     gtk_container_add(GTK_CONTAINER(window), vbox);
 
     lsvi = g_new(LibBalsaSourceViewerInfo, 1);
diff --git a/libbalsa/x509-cert-widget.c b/libbalsa/x509-cert-widget.c
index 9afa60ef0..fa96b8afd 100644
--- a/libbalsa/x509-cert-widget.c
+++ b/libbalsa/x509-cert-widget.c
@@ -163,7 +163,11 @@ create_chain_widget(GList *cert_list)
 
        vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
-       gtk_box_pack_start(GTK_BOX(vbox), scrolledwin, TRUE, TRUE, 6U);
+        gtk_widget_set_vexpand(scrolledwin, TRUE);
+        gtk_widget_set_valign(scrolledwin, GTK_ALIGN_FILL);
+        gtk_widget_set_margin_start(scrolledwin, 6U);
+        gtk_widget_set_margin_end(scrolledwin, 6U);
+       gtk_box_pack_start(GTK_BOX(vbox), scrolledwin, FALSE, FALSE, 0U);
 
        store = gtk_tree_store_new(CERT_COLUMNS, G_TYPE_STRING, GTK_TYPE_WIDGET);
        tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
@@ -177,7 +181,11 @@ create_chain_widget(GList *cert_list)
        gtk_tree_view_set_activate_on_single_click(GTK_TREE_VIEW(tree_view), TRUE);
 
        stack = gtk_stack_new();
-       gtk_box_pack_start(GTK_BOX(vbox), stack, TRUE, TRUE, 6U);
+        gtk_widget_set_vexpand(stack, TRUE);
+        gtk_widget_set_valign(stack, GTK_ALIGN_FILL);
+        gtk_widget_set_margin_start(stack, 6U);
+        gtk_widget_set_margin_end(stack, 6U);
+       gtk_box_pack_start(GTK_BOX(vbox), stack, FALSE, FALSE, 0U);
        g_signal_connect(tree_view, "row-activated", G_CALLBACK(cert_selected_cb), stack);
 
        is_root = TRUE;


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