[balsa/gtk4: 103/311] ab-main: Stop using GtkButtonBox




commit a934b404fa09db725c767635e8a4637de1b9a44b
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Aug 28 17:17:39 2020 -0400

    ab-main: Stop using GtkButtonBox

 src/ab-main.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/ab-main.c b/src/ab-main.c
index f41ffb46b..1a62da9ed 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -832,22 +832,26 @@ static GtkWidget*
 bab_get_edit_button_box(struct ABMainWindow *abmw)
 {
     GtkWidget *box;
-    box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_container_add(GTK_CONTAINER(box),
-                      abmw->apply_button =
-                      gtk_button_new_with_mnemonic(_("_Apply")));
+    GtkSizeGroup *size_group;
+
+    box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+    size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
+
+    abmw->apply_button = libbalsa_button_box_button(_("_Apply"), size_group, GTK_ALIGN_START);
+    gtk_container_add(GTK_CONTAINER(box), abmw->apply_button);
     g_signal_connect(abmw->apply_button, "clicked",
                      G_CALLBACK(apply_button_cb), (gpointer) NULL);
-    gtk_container_add(GTK_CONTAINER(box),
-                      abmw->remove_button =
-                      gtk_button_new_with_mnemonic(_("_Remove")));
+
+    abmw->remove_button = libbalsa_button_box_button(_("_Remove"), size_group, GTK_ALIGN_CENTER);
+    gtk_container_add(GTK_CONTAINER(box), abmw->remove_button);
     g_signal_connect(abmw->remove_button, "clicked",
                      G_CALLBACK(remove_button_cb), (gpointer) NULL);
-    gtk_container_add(GTK_CONTAINER(box),
-                      abmw->cancel_button =
-                      gtk_button_new_with_mnemonic(_("_Cancel")));
+
+    abmw->cancel_button = libbalsa_button_box_button(_("_Cancel"), size_group, GTK_ALIGN_END);
+    gtk_container_add(GTK_CONTAINER(box), abmw->cancel_button);
     g_signal_connect(abmw->cancel_button, "clicked",
                      G_CALLBACK(cancel_button_cb), abmw);
+
     return box;
 }
 


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