[balsa/stop-using-gtkbox-child-properties] Various: Stop using GtkBox child properties



commit c642466b9b32acfa85c2a3ede7e3be5d49cc3c60
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Jun 9 17:14:38 2020 -0400

    Various: Stop using GtkBox child properties
    
    Stop using GtkBox padding, fill and expand child properties
    
    * src/spell-check.c (balsa_spell_check_init):
    * src/store-address.c (store_address_dialog), (store_address_book_frame):
    * src/toolbar-prefs.c (customize_dialog_cb), (create_toolbar_page):

 ChangeLog           |  9 +++++++++
 src/spell-check.c   |  4 +++-
 src/store-address.c |  9 +++++++--
 src/toolbar-prefs.c | 14 ++++++++------
 4 files changed, 27 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 900cbf63d..cd7e24ae3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-06-09  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Various: Stop using GtkBox padding, fill and expand child properties
+
+       * src/spell-check.c (balsa_spell_check_init):
+       * src/store-address.c (store_address_dialog),
+       (store_address_book_frame):
+       * src/toolbar-prefs.c (customize_dialog_cb), (create_toolbar_page):
+
 2020-06-09  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Various: Stop using GtkBox padding, fill and expand child properties
diff --git a/src/spell-check.c b/src/spell-check.c
index 581ce9815..b795e5a69 100644
--- a/src/spell-check.c
+++ b/src/spell-check.c
@@ -313,7 +313,9 @@ balsa_spell_check_init(BalsaSpellCheck *spell_check)
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
                                   GTK_POLICY_AUTOMATIC,
                                   GTK_POLICY_AUTOMATIC);
-    gtk_box_pack_start(box, sw, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(sw, TRUE);
+    gtk_widget_set_valign(sw, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(box), sw);
 
     /* setup suggestion list */
     store  = gtk_list_store_new(1, G_TYPE_STRING);
diff --git a/src/store-address.c b/src/store-address.c
index 257a8ce13..5ed347810 100644
--- a/src/store-address.c
+++ b/src/store-address.c
@@ -227,7 +227,10 @@ store_address_dialog(StoreAddressInfo * info)
 
     frame = store_address_note_frame(info);
     gtk_widget_show_all(frame);
-    gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+
+    gtk_widget_set_vexpand(frame, TRUE);
+    gtk_widget_set_valign(frame, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(vbox), frame);
 
     return dialog;
 }
@@ -313,7 +316,9 @@ store_address_book_frame(StoreAddressInfo * info)
     }
     gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), default_ab_offset);
 
-    gtk_box_pack_start(GTK_BOX(hbox), combo_box, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(combo_box, TRUE);
+    gtk_widget_set_valign(combo_box, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(hbox), combo_box);
 
     return hbox;
 }
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index 8bcf46c97..a33cf1c98 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -152,7 +152,9 @@ customize_dialog_cb(GtkWidget * widget, gpointer data)
     notebook = gtk_notebook_new();
     content_area =
         gtk_dialog_get_content_area(GTK_DIALOG(customize_widget));
-    gtk_box_pack_start(GTK_BOX(content_area), notebook, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(notebook, TRUE);
+    gtk_widget_set_valign(notebook, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(content_area), notebook);
 
     gtk_window_set_role(GTK_WINDOW(customize_widget), "customize");
     gtk_window_set_default_size(GTK_WINDOW(customize_widget), 600, 440);
@@ -413,7 +415,7 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     /* Preview display */
     toolbar_frame=gtk_frame_new(_("Preview"));
     gtk_container_set_border_width(GTK_CONTAINER(toolbar_frame), 5);
-    gtk_box_pack_start(GTK_BOX(outer_box), toolbar_frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(outer_box), toolbar_frame);
 
     toolbar_ctlbox=gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
     gtk_container_add(GTK_CONTAINER(toolbar_frame), toolbar_ctlbox);
@@ -429,9 +431,7 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
                                   GTK_POLICY_AUTOMATIC,
                                    GTK_POLICY_NEVER);
 
-    gtk_box_pack_start(GTK_BOX(toolbar_ctlbox), toolbar_scroll,
-                       TRUE, TRUE, 0);
-
+    gtk_container_add(GTK_CONTAINER(toolbar_ctlbox), toolbar_scroll);
     gtk_container_add(GTK_CONTAINER(toolbar_scroll), page->toolbar);
 
     /* Button box */
@@ -454,7 +454,9 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     lower_ctlbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
     gtk_container_set_border_width(GTK_CONTAINER(lower_ctlbox), 5);
 
-    gtk_box_pack_start(GTK_BOX(outer_box), lower_ctlbox, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(lower_ctlbox, TRUE);
+    gtk_widget_set_valign(lower_ctlbox, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(outer_box), lower_ctlbox);
 
     /* A list to show the available items */
     list_scroll=gtk_scrolled_window_new(NULL, NULL);


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