[balsa/gtk4: 144/206] Various: Stop using GtkBox child properties




commit 30a37657e00f83222d9e78ccc515d02c50653c5b
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Jun 9 14:23:14 2020 -0400

    Various: Stop using GtkBox child properties
    
    Stop using GtkBox padding, fill and expand child properties
    
    * src/information-dialog.c (balsa_information_list):
    * src/main-window.c (bw_create_index_widget), (bw_set_panes),
      (balsa_window_new), (bw_notebook_label_new), (bw_find_real):

 ChangeLog         |  8 ++++++++
 src/main-window.c | 38 +++++++++++++++++---------------------
 2 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9dd4b1f84..c1a23a65f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -480,6 +480,14 @@
        * src/main-window.c (bw_create_index_widget), (bw_set_panes),
        (balsa_window_new), (bw_notebook_label_new), (bw_find_real):
 
+2020-06-09  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Various: Stop using GtkBox padding, fill and expand child properties
+
+       * src/information-dialog.c (balsa_information_list):
+       * src/main-window.c (bw_create_index_widget), (bw_set_panes),
+       (balsa_window_new), (bw_notebook_label_new), (bw_find_real):
+
 2020-06-09  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Various: restore filtering in a mailbox that is not currently
diff --git a/src/main-window.c b/src/main-window.c
index 735c751f2..82bfe96a7 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -569,7 +569,7 @@ bw_create_index_widget(BalsaWindow *bw)
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     gtk_widget_show(priv->sos_bar);
-    gtk_container_add(GTK_CONTAINER(vbox), priv->sos_bar);
+    gtk_box_pack_start(GTK_BOX(vbox), priv->sos_bar, FALSE, FALSE, 0);
 
     gtk_widget_set_vexpand(priv->notebook, TRUE);
     gtk_widget_set_valign(priv->notebook, GTK_ALIGN_FILL);
@@ -599,7 +599,7 @@ bw_set_panes(BalsaWindow * window)
 
         gtk_widget_set_vexpand(priv->content, TRUE);
         gtk_widget_set_valign(priv->content, GTK_ALIGN_FILL);
-        gtk_container_add(GTK_CONTAINER(priv->content_area), priv->content);
+        gtk_container_add(GTK_CONTAINER(priv->vbox), priv->content);
 
        gtk_paned_pack1(GTK_PANED(priv->paned_child),
                        bw_frame(priv->mblist), TRUE, TRUE);
@@ -621,7 +621,7 @@ bw_set_panes(BalsaWindow * window)
 
         gtk_widget_set_vexpand(priv->content, TRUE);
         gtk_widget_set_valign(priv->content, GTK_ALIGN_FILL);
-        gtk_container_add(GTK_CONTAINER(priv->content_area), priv->content);
+        gtk_container_add(GTK_CONTAINER(priv->vbox), priv->content);
 
        gtk_paned_pack1(GTK_PANED(priv->paned_parent),
                         bw_frame(priv->mblist), TRUE, TRUE);
@@ -644,7 +644,7 @@ bw_set_panes(BalsaWindow * window)
 
         gtk_widget_set_vexpand(priv->content, TRUE);
         gtk_widget_set_valign(priv->content, GTK_ALIGN_FILL);
-        gtk_container_add(GTK_CONTAINER(priv->content_area), priv->content);
+        gtk_container_add(GTK_CONTAINER(priv->vbox), priv->content);
 
        gtk_paned_pack1(GTK_PANED(priv->paned_parent),
                         bw_frame(priv->mblist), TRUE, TRUE);
@@ -2250,13 +2250,7 @@ balsa_window_new(GtkApplication *application)
     model = balsa_window_get_toolbar_model();
 
     priv->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
-    gtk_container_add(GTK_CONTAINER(priv->vbox), priv->toolbar);
-
-    priv->content_area = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-    gtk_widget_show(priv->content_area);
-    gtk_widget_set_vexpand(priv->content_area, TRUE);
-    gtk_widget_set_valign(priv->content_area, GTK_ALIGN_FILL);
-    gtk_container_add(GTK_CONTAINER(priv->vbox), priv->content_area);
+    gtk_box_pack_start(GTK_BOX(priv->vbox), priv->toolbar, FALSE, FALSE, 0);
 
     priv->bottom_bar = hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
     gtk_container_add(GTK_CONTAINER(priv->vbox), hbox);
@@ -2267,12 +2261,12 @@ balsa_window_new(GtkApplication *application)
     gtk_widget_set_valign(priv->progress_bar, GTK_ALIGN_CENTER);
     gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(priv->progress_bar),
                                     0.01);
-    gtk_container_add(GTK_CONTAINER(hbox), priv->progress_bar);
+    gtk_box_pack_start(GTK_BOX(hbox), priv->progress_bar, FALSE, FALSE, 0);
 
     priv->statusbar = gtk_statusbar_new();
     gtk_widget_set_hexpand(priv->statusbar, TRUE);
     gtk_widget_set_halign(priv->statusbar, GTK_ALIGN_FILL);
-    gtk_container_add(GTK_CONTAINER(hbox), priv->statusbar);
+    gtk_box_pack_start(GTK_BOX(hbox), priv->statusbar, FALSE, FALSE, 0);
     gtk_widget_show_all(hbox);
 
 #if 0
@@ -2826,7 +2820,9 @@ bw_notebook_label_new(BalsaMailboxNode * mbnode)
                             libbalsa_mailbox_get_unread(balsa_mailbox_node_get_mailbox(mbnode)) > 0);
     g_signal_connect_object(balsa_mailbox_node_get_mailbox(mbnode), "changed",
                             G_CALLBACK(bw_mailbox_changed), lab, 0);
-    gtk_container_add(GTK_CONTAINER(box), lab);
+    gtk_widget_set_hexpand(lab, TRUE);
+    gtk_widget_set_halign(lab, GTK_ALIGN_FILL);
+    gtk_box_pack_start(GTK_BOX(box), lab, FALSE, FALSE, 0);
 
     but = gtk_button_new();
     gtk_widget_set_focus_on_click(but, FALSE);
@@ -3839,7 +3835,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(page, 2);
         gtk_widget_set_margin_bottom(page, 2);
-       gtk_container_add(GTK_CONTAINER(vbox), page);
+       gtk_box_pack_start(GTK_BOX(vbox), page, FALSE, FALSE, 0);
 
        /* builds the toggle buttons to specify fields concerned by
          * the search. */
@@ -3852,7 +3848,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(frame, 2);
         gtk_widget_set_margin_bottom(frame, 2);
-       gtk_container_add(GTK_CONTAINER(vbox), frame);
+       gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
        grid = gtk_grid_new();
         gtk_grid_set_column_homogeneous(GTK_GRID(grid), TRUE);
@@ -3870,7 +3866,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(frame, 2);
         gtk_widget_set_margin_bottom(frame, 2);
-       gtk_container_add(GTK_CONTAINER(vbox), frame);
+       gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
        /* Button box */
        box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
@@ -3892,7 +3888,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(frame, 2);
         gtk_widget_set_margin_bottom(frame, 2);
-       gtk_container_add(GTK_CONTAINER(vbox), frame);
+       gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
        /* Reverse and Wrap checkboxes */
        box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
@@ -3910,7 +3906,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_vexpand(reverse_button, TRUE);
         gtk_widget_set_valign(reverse_button, GTK_ALIGN_FILL);
-       gtk_container_add(GTK_CONTAINER(w), reverse_button);
+       gtk_box_pack_start(GTK_BOX(w), reverse_button, FALSE, FALSE, 0);
 
        wrap_button =
             gtk_check_button_new_with_mnemonic(_("_Wrap around"));
@@ -3919,11 +3915,11 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_vexpand(wrap_button, TRUE);
         gtk_widget_set_valign(wrap_button, GTK_ALIGN_FILL);
-       gtk_container_add(GTK_CONTAINER(w), wrap_button);
+       gtk_box_pack_start(GTK_BOX(w), wrap_button, FALSE, FALSE, 0);
 
         gtk_widget_set_hexpand(w, TRUE);
         gtk_widget_set_halign(w, GTK_ALIGN_FILL);
-       gtk_container_add(GTK_CONTAINER(box), w);
+       gtk_box_pack_start(GTK_BOX(box), w, FALSE, FALSE, 0);
 
        button = gtk_button_new_with_mnemonic(_("_OK"));
        g_signal_connect(button, "clicked",


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