[balsa/gtk4: 135/294] Various: Stop using GtkBox child properties




commit 8465a01aa2f7f639663b8cd723da4ca8fef21c14
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            |  2 +-
 libbalsa/source-viewer.c          |  6 +++---
 libbalsa/x509-cert-widget.c       | 12 ++++++------
 8 files changed, 36 insertions(+), 24 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c519ef1b4..645eae61b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -723,6 +723,20 @@
        * libbalsa/autocrypt.c (autocrypt_db_dialog_run):
        * libbalsa/html.c (libbalsa_html_new):
 
+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 a7026cfab..c07f99d8f 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -986,9 +986,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_frame_get_child(GTK_FRAME(entries[cnt]));
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 77da8565b..c88fce3bd 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 213bc4a80..3c48a30e4 100644
--- a/libbalsa/libbalsa-gpgme-widgets.c
+++ b/libbalsa/libbalsa-gpgme-widgets.c
@@ -405,9 +405,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);
@@ -646,7 +644,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);
@@ -780,7 +779,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 6d5f31fdd..227ad0da7 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -419,16 +419,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 d1f3c1461..122673780 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -352,7 +352,7 @@ libbalsa_smtp_server_dialog(LibBalsaSmtpServer * smtp_server,
     sdi->big_message = gtk_spin_button_new_with_range(0.1, 100, 0.1);
     gtk_widget_set_hexpand(sdi->big_message, TRUE);
     gtk_widget_set_halign(sdi->big_message, GTK_ALIGN_FILL);
-    gtk_container_add(GTK_CONTAINER(hbox), sdi->big_message);
+    gtk_box_pack_start(GTK_BOX(hbox), sdi->big_message, FALSE, FALSE, 0);
     label = gtk_label_new(_("MB"));
     gtk_container_add(GTK_CONTAINER(hbox), label);
     if (smtp_server->big_message > 0) {
diff --git a/libbalsa/source-viewer.c b/libbalsa/source-viewer.c
index 8873f16f0..cf7377c23 100644
--- a/libbalsa/source-viewer.c
+++ b/libbalsa/source-viewer.c
@@ -236,15 +236,15 @@ libbalsa_show_message_source(GtkApplication  * application,
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu(window, GTK_MENU_SHELL(menu_bar));
 #else
+    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_container_add(GTK_CONTAINER(vbox), menu_bar);
+    gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0);
 #endif
 
     gtk_widget_set_vexpand(interior, TRUE);
     gtk_widget_set_valign(interior, GTK_ALIGN_FILL);
-    g_object_set(interior, "margin", 2, NULL);
-    gtk_container_add(GTK_CONTAINER(vbox), interior);
+    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 c4653586e..fa96b8afd 100644
--- a/libbalsa/x509-cert-widget.c
+++ b/libbalsa/x509-cert-widget.c
@@ -165,9 +165,9 @@ create_chain_widget(GList *cert_list)
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
         gtk_widget_set_vexpand(scrolledwin, TRUE);
         gtk_widget_set_valign(scrolledwin, GTK_ALIGN_FILL);
-        gtk_widget_set_margin_top(scrolledwin, 6U);
-        gtk_widget_set_margin_bottom(scrolledwin, 6U);
-        gtk_container_add(GTK_CONTAINER(vbox), scrolledwin);
+        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));
@@ -183,9 +183,9 @@ create_chain_widget(GList *cert_list)
        stack = gtk_stack_new();
         gtk_widget_set_vexpand(stack, TRUE);
         gtk_widget_set_valign(stack, GTK_ALIGN_FILL);
-        gtk_widget_set_margin_top(stack, 6U);
-        gtk_widget_set_margin_bottom(stack, 6U);
-       gtk_container_add(GTK_CONTAINER(vbox), stack);
+        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]