[balsa/wip/gtk4] GtkButtonBox has gone away



commit 9e5779d55400477eaf7987e2830c63af49d9e7ef
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Feb 12 19:11:42 2019 -0500

    GtkButtonBox has gone away
    
    Just use GtkBox and hope for the best…

 src/ab-main.c                     |  2 +-
 src/ab-window.c                   |  3 +--
 src/balsa-mime-widget-message.c   |  4 ----
 src/balsa-mime-widget-vcalendar.c |  4 +---
 src/filter-edit-dialog.c          |  9 +++------
 src/filter-run-dialog.c           | 13 +++----------
 src/main-window.c                 |  2 +-
 src/main.c                        |  2 +-
 src/toolbar-prefs.c               |  3 +--
 9 files changed, 12 insertions(+), 30 deletions(-)
---
diff --git a/src/ab-main.c b/src/ab-main.c
index 9eb184c4d..85bb733f0 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -859,7 +859,7 @@ bab_get_edit_button_box(struct ABMainWindow *abmw)
     GtkWidget *box_widget;
     GtkContainer *box;
 
-    box_widget = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
+    box_widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
     box = GTK_CONTAINER(box_widget);
 
     abmw->apply_button = gtk_button_new_with_mnemonic(_("_Apply"));
diff --git a/src/ab-window.c b/src/ab-window.c
index f1b165f64..3c1f8ed27 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -319,8 +319,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_widget_set_size_request(scrolled_window, 300, 250);
 
     /* Buttons ... */
-    hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_SPREAD);
+    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
     gtk_widget_set_vexpand(hbox, FALSE);
     gtk_grid_attach(GTK_GRID(grid), hbox, 0, 2, 1, 1);
 
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index 809e970f4..f5bb0a6a3 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -500,14 +500,10 @@ bm_header_widget_new(BalsaMessage * bm, GtkWidget * const * buttons)
     action_area = gtk_info_bar_get_action_area(info_bar);
     gtk_orientable_set_orientation(GTK_ORIENTABLE(action_area),
                                    GTK_ORIENTATION_VERTICAL);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area),
-                              GTK_BUTTONBOX_START);
     face_box = balsa_message_get_face_box(bm);
     if (face_box == NULL) {
         face_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
         gtk_container_add(GTK_CONTAINER(action_area), face_box);
-        gtk_button_box_set_child_non_homogeneous(GTK_BUTTON_BOX(action_area),
-                                                 face_box, TRUE);
         balsa_message_set_face_box(bm, face_box);
     }
 
diff --git a/src/balsa-mime-widget-vcalendar.c b/src/balsa-mime-widget-vcalendar.c
index 5c4e7fc08..17bb1a026 100644
--- a/src/balsa-mime-widget-vcalendar.c
+++ b/src/balsa-mime-widget-vcalendar.c
@@ -241,9 +241,7 @@ balsa_vevent_widget(LibBalsaVEvent * event, gboolean may_reply,
        label =
            gtk_label_new(_("The sender asks you for a reply to this request:"));
        gtk_container_add(GTK_CONTAINER(box), label);
-       bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-       gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox),
-                                 GTK_BUTTONBOX_SPREAD);
+       bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_container_add(GTK_CONTAINER(box), bbox);
 
        button = gtk_button_new_with_label(_("Accept"));
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index 5e62e0fc1..aa844a190 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -215,10 +215,7 @@ build_left_side(void)
     gtk_container_add(GTK_CONTAINER(vbox), sw);
 
     /* new and delete buttons */
-    bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_box_set_spacing(GTK_BOX(bbox), 2);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
-
+    bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
     gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* new button */
@@ -304,7 +301,7 @@ build_match_page()
 
     gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(fe_conditions_list));
 
-    box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
+    box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
     gtk_widget_set_hexpand(box, TRUE);
     gtk_grid_attach(GTK_GRID(page), box, 0, 3, 2, 1);
     fe_condition_edit_button = gtk_button_new_with_mnemonic(_("_Edit"));
@@ -497,7 +494,7 @@ build_right_side(GtkWindow * window)
                             page, gtk_label_new(_("Action")));
 
     /* button box */
-    bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
+    bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
     gtk_container_add(GTK_CONTAINER(rightside), bbox);
 
     fe_apply_button = gtk_button_new_with_mnemonic(_("_Apply"));
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index e4ad3bbcf..0246015f0 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -330,9 +330,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
     gtk_container_add(GTK_CONTAINER(vbox), sw);
 
     /* To keep a consistent look, make a button box for a single button. */
-    bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_box_set_spacing(GTK_BOX(bbox), 2);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
+    bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
     gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* "Apply selected" button */
@@ -344,9 +342,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
     gtk_container_add(GTK_CONTAINER(bbox), button);
 
     /* Buttons between the 2 lists */
-    bbox = gtk_button_box_new(GTK_ORIENTATION_VERTICAL);
-    gtk_box_set_spacing(GTK_BOX(bbox), 2);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
+    bbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
 
     /* Right/Add button */
     p->add_button = button =
@@ -394,10 +390,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
     gtk_container_add(GTK_CONTAINER(vbox), sw);
 
     /* up down arrow buttons */
-    bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_box_set_spacing(GTK_BOX(bbox), 2);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
-
+    bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
     gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* up button */
diff --git a/src/main-window.c b/src/main-window.c
index 9980aea53..d35f461f5 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -3868,7 +3868,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
        gtk_container_add(GTK_CONTAINER(vbox), frame);
 
        /* Button box */
-       box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
+       box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 
        button = gtk_button_new_with_mnemonic(_("_Apply"));
        g_signal_connect(G_OBJECT(button), "clicked",
diff --git a/src/main.c b/src/main.c
index 4099da907..a829ad66d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -545,7 +545,7 @@ balsa_startup_cb(GApplication *application,
 
     default_icon = balsa_pixmap_finder("balsa_icon.png");
     if(default_icon) { /* may be NULL for developer installations */
-        gtk_window_set_default_icon_from_file(default_icon, NULL);
+        gtk_window_set_default_icon_name(default_icon);
         g_free(default_icon);
     }
 
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index dc9f15913..15743d2a3 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -435,8 +435,7 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     gtk_container_add(GTK_CONTAINER(toolbar_scroll), page->toolbar);
 
     /* Button box */
-    button_box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_box_set_spacing(GTK_BOX(button_box), 5);
+    button_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
     g_object_set(G_OBJECT(button_box), "margin", 5, NULL);
     gtk_container_add(GTK_CONTAINER(toolbar_ctlbox), button_box);
 


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