[balsa/gtk4: 178/298] filter-edit-dialog: Stop using GtkButtonBox




commit 86fd1692dd0262f972921edb2b4b30fad65e9a17
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Aug 29 15:40:55 2020 -0400

    filter-edit-dialog: Stop using GtkButtonBox

 src/filter-edit-dialog.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)
---
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index c9bbb5933..7c8ee8807 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -180,6 +180,7 @@ static GtkWidget *
 build_left_side(void)
 {
     GtkWidget *vbox, *bbox;
+    GtkSizeGroup *size_group;
     GtkWidget *sw;
 
     /*
@@ -218,16 +219,17 @@ build_left_side(void)
 
     /* new and delete buttons */
     bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
+    size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
 
     gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* new button */
     /* Translators: button "New" filter */
-    fe_new_button = libbalsa_add_mnemonic_button_to_box(C_("filter", "_New"), bbox, GTK_ALIGN_CENTER);
+    fe_new_button = libbalsa_button_box_button(C_("filter", "_New"), size_group, GTK_ALIGN_CENTER);
     g_signal_connect(fe_new_button, "clicked",
                     G_CALLBACK(fe_new_pressed), NULL);
     /* delete button */
-    fe_delete_button = libbalsa_add_mnemonic_button_to_box(("_Delete"), bbox, GTK_ALIGN_CENTER);
+    fe_delete_button = libbalsa_button_box_button(("_Delete"), size_group, GTK_ALIGN_CENTER);
     g_signal_connect(fe_delete_button, "clicked",
                     G_CALLBACK(fe_delete_pressed), NULL);
     gtk_widget_set_sensitive(fe_delete_button, FALSE);
@@ -246,6 +248,7 @@ build_match_page()
     GtkWidget *page, *button;
     GtkWidget *label, *scroll;
     GtkWidget *box = NULL;
+    GtkSizeGroup *size_group;
 
     /* The notebook page */
     page = gtk_grid_new();
@@ -308,15 +311,18 @@ build_match_page()
     gtk_widget_set_hexpand(box, TRUE);
     gtk_grid_attach(GTK_GRID(page), box, 0, 3, 2, 1);
 
-    fe_condition_edit_button = libbalsa_add_mnemonic_button_to_box(_("_Edit"), box, GTK_ALIGN_START);
+    size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
+
+    fe_condition_edit_button = libbalsa_button_box_button(_("_Edit"), size_group, GTK_ALIGN_START);
     gtk_widget_set_sensitive(fe_condition_edit_button,FALSE);
     g_signal_connect(fe_condition_edit_button, "clicked",
                      G_CALLBACK(fe_edit_condition), GINT_TO_POINTER(0));
     /* Translators: button "New" filter match */
-    button = libbalsa_add_mnemonic_button_to_box(C_("filter match", "Ne_w"), box, GTK_ALIGN_CENTER);
+    button = libbalsa_button_box_button(C_("filter match", "Ne_w"), size_group, GTK_ALIGN_CENTER);
+    gtk_container_add(GTK_CONTAINER(box), button);
     g_signal_connect(button, "clicked",
                      G_CALLBACK(fe_edit_condition), GINT_TO_POINTER(1));
-    fe_condition_delete_button = libbalsa_add_mnemonic_button_to_box(_("_Remove"), box, GTK_ALIGN_END);
+    fe_condition_delete_button = libbalsa_button_box_button(_("_Remove"), size_group, GTK_ALIGN_END);
     gtk_widget_set_sensitive(fe_condition_delete_button,FALSE);
     g_signal_connect(fe_condition_delete_button, "clicked",
                     G_CALLBACK(fe_condition_remove_pressed), NULL);
@@ -485,6 +491,7 @@ build_right_side(GtkWindow * window)
     GtkWidget *rightside;
     GtkWidget *notebook, *page;
     GtkWidget *bbox;
+    GtkSizeGroup *size_group;
 
     rightside = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 
@@ -503,14 +510,16 @@ 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 = libbalsa_add_mnemonic_button_to_box(_("_Apply"), bbox, GTK_ALIGN_START);
+    size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
+
+    fe_apply_button = libbalsa_button_box_button(_("_Apply"), size_group, GTK_ALIGN_START);
     g_signal_connect(fe_apply_button, "clicked",
                     G_CALLBACK(fe_apply_pressed), NULL);
 
-    fe_revert_button = libbalsa_add_mnemonic_button_to_box(_("Re_vert"), bbox, GTK_ALIGN_END);
+    fe_revert_button = libbalsa_button_box_button(_("Re_vert"), size_group, GTK_ALIGN_END);
     g_signal_connect(fe_revert_button, "clicked",
                     G_CALLBACK(fe_revert_pressed), NULL);
     gtk_widget_set_sensitive(fe_apply_button, FALSE);
@@ -595,12 +604,13 @@ filters_edit_dialog(GtkWindow * parent)
 
     /* main hbox */
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, FILTER_EDIT_PADDING);
-    gtk_widget_set_hexpand(hbox, TRUE);
-    gtk_widget_set_halign(hbox, GTK_ALIGN_FILL);
-    gtk_widget_set_margin_start(hbox, FILTER_EDIT_PADDING);
-    gtk_widget_set_margin_end(hbox, FILTER_EDIT_PADDING);
+    gtk_widget_set_vexpand(hbox, TRUE);
+    gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
+    gtk_widget_set_margin_top(hbox, FILTER_EDIT_PADDING);
+    gtk_widget_set_margin_bottom(hbox, FILTER_EDIT_PADDING);
     gtk_container_add(GTK_CONTAINER(content_area), hbox);
 
+    gtk_widget_set_hexpand(piece, FALSE);
     gtk_widget_set_margin_start(piece, FILTER_EDIT_PADDING);
     gtk_widget_set_margin_end(piece, FILTER_EDIT_PADDING);
     gtk_container_add(GTK_CONTAINER(hbox), piece);


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