[balsa/gtk4: 93/311] Various: Stop using GtkBox child properties




commit ba3b5de52911c56cad8dc5089722e4cc0c62476f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 10 13:40:56 2020 -0400

    Various: Stop using GtkBox child properties
    
    Stop using GtkBox padding, fill and expand child properties
    
    Also clarify access to GtkDialog areas.
    
    * libbalsa/autocrypt.c (autocrypt_db_dialog_run):
    * libbalsa/libbalsa-gpgme-cb.c (lb_gpgme_select_key), (get_passphrase_real):
    * libbalsa/libbalsa-gpgme-widgets.c (libbalsa_key_dialog):
    * libbalsa/libbalsa.c (ask_cert_real):
    * libbalsa/smtp-server.c (libbalsa_smtp_server_dialog):
    * src/balsa-mblist.c (bmbl_mru_show_tree):
    * src/balsa-mime-widget-message.c (bm_header_widget_new):
    * src/filter-edit-dialog.c (filters_edit_dialog):
    * src/filter-export-dialog.c (filters_export_dialog):
    * src/filter-run-dialog.c (balsa_filter_run_dialog_init):
    * src/folder-conf.c (create_imap_folder_dialog),
      (folder_conf_imap_node), (subfolder_conf_clicked_ok),
      (folder_conf_imap_sub_node), (folder_conf_add_imap_sub_cb):
    * src/mailbox-conf.c (create_pop_mailbox_dialog):
    * src/sendmsg-window.c (show_decrypted_warning):
    * src/toolbar-prefs.c (create_toolbar_page):
    
    * src/main-window.c (bw_set_panes), (balsa_window_new): put a new box in
      priv->vbox to hold the panes; that way, we can rearrange the components
      without disturbing the other widgets in priv->vbox.

 ChangeLog                         | 29 +++++++++++++++++++++++
 libbalsa/autocrypt.c              |  1 +
 libbalsa/libbalsa-gpgme-cb.c      | 18 +++++++-------
 libbalsa/libbalsa-gpgme-widgets.c |  4 +++-
 libbalsa/libbalsa.c               |  8 +++----
 libbalsa/smtp-server.c            |  4 +++-
 src/balsa-mblist.c                |  5 +++-
 src/balsa-mime-widget-message.c   | 21 ----------------
 src/filter-edit-dialog.c          |  4 +++-
 src/filter-export-dialog.c        |  4 +++-
 src/filter-run-dialog.c           |  3 ++-
 src/folder-conf.c                 | 50 +++++++++++++++++++++++++++++----------
 src/mailbox-conf.c                |  4 +++-
 src/main-window.c                 |  9 ++++++-
 src/sendmsg-window.c              |  6 +++--
 src/toolbar-prefs.c               |  5 +++-
 16 files changed, 118 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4b3aa91da..65a9f5e56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -565,6 +565,35 @@
        (open_with_change_state), (copy_part_change_state),
        (part_create_menu):
 
+2020-06-10  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Various: Stop using GtkBox padding, fill and expand child properties
+
+       Also clarify access to GtkDialog areas.
+
+       * libbalsa/autocrypt.c (autocrypt_db_dialog_run):
+       * libbalsa/libbalsa-gpgme-cb.c (lb_gpgme_select_key),
+       (get_passphrase_real):
+       * libbalsa/libbalsa-gpgme-widgets.c (libbalsa_key_dialog):
+       * libbalsa/libbalsa.c (ask_cert_real):
+       * libbalsa/smtp-server.c (libbalsa_smtp_server_dialog):
+       * src/balsa-mblist.c (bmbl_mru_show_tree):
+       * src/balsa-mime-widget-message.c (bm_header_widget_new):
+       * src/filter-edit-dialog.c (filters_edit_dialog):
+       * src/filter-export-dialog.c (filters_export_dialog):
+       * src/filter-run-dialog.c (balsa_filter_run_dialog_init):
+       * src/folder-conf.c (create_imap_folder_dialog),
+       (folder_conf_imap_node), (subfolder_conf_clicked_ok),
+       (folder_conf_imap_sub_node), (folder_conf_add_imap_sub_cb):
+       * src/mailbox-conf.c (create_pop_mailbox_dialog):
+       * src/sendmsg-window.c (show_decrypted_warning):
+       * src/toolbar-prefs.c (create_toolbar_page):
+
+       * src/main-window.c (bw_set_panes), (balsa_window_new): put a
+       new box in priv->vbox to hold the panes; that way, we can
+       rearrange the components without disturbing the other widgets in
+       priv->vbox.
+
 2020-06-09  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Various: Stop using GtkBox padding, fill and expand child properties
diff --git a/libbalsa/autocrypt.c b/libbalsa/autocrypt.c
index 7aa44450d..4b9ce3257 100644
--- a/libbalsa/autocrypt.c
+++ b/libbalsa/autocrypt.c
@@ -447,6 +447,7 @@ autocrypt_db_dialog_run(const gchar *date_string, GtkWindow *parent)
        dialog = gtk_dialog_new_with_buttons(_("Autocrypt database"), parent,
                GTK_DIALOG_DESTROY_WITH_PARENT | libbalsa_dialog_flags(), _("_Close"), GTK_RESPONSE_CLOSE, 
NULL);
        geometry_manager_attach(GTK_WINDOW(dialog), "AutocryptDB");
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
     gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
diff --git a/libbalsa/libbalsa-gpgme-cb.c b/libbalsa/libbalsa-gpgme-cb.c
index 890669cf4..404ab3b4d 100644
--- a/libbalsa/libbalsa-gpgme-cb.c
+++ b/libbalsa/libbalsa-gpgme-cb.c
@@ -162,6 +162,7 @@ lb_gpgme_select_key(const gchar * user_name, lb_key_sel_md_t mode, GList * keys,
                    gpgme_protocol_t protocol, GtkWindow * parent)
 {
     GtkWidget *dialog;
+    GtkWidget *content_area;
     GtkWidget *vbox;
     GtkWidget *label;
     GtkWidget *scrolled_window;
@@ -186,14 +187,14 @@ lb_gpgme_select_key(const gchar * user_name, lb_key_sel_md_t mode, GList * keys,
     gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
     gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), GTK_RESPONSE_OK, FALSE);
        geometry_manager_attach(GTK_WINDOW(dialog), "KeyList");
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, parent);
 #endif
+
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
     gtk_widget_set_vexpand (vbox, TRUE);
-    gtk_container_add(GTK_CONTAINER
-                     (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                     vbox);
+    gtk_container_add(GTK_CONTAINER(content_area), vbox);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
     switch (mode) {
        case LB_SELECT_PRIVATE_KEY:
@@ -304,7 +305,7 @@ lb_gpgme_select_key(const gchar * user_name, lb_key_sel_md_t mode, GList * keys,
     gtk_container_add(GTK_CONTAINER(scrolled_window), tree_view);
     g_signal_connect(tree_view, "row-activated", G_CALLBACK(row_activated_cb), dialog);
 
-    gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
+    gtk_widget_show_all(content_area);
 
     if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK) {
        use_key = NULL;
@@ -357,6 +358,7 @@ get_passphrase_real(const gchar * uid_hint, const gchar * passphrase_info,
 {
     static GdkPixbuf *padlock_keyhole = NULL;
     GtkWidget *dialog, *entry, *vbox, *hbox;
+    GtkWidget *content_area;
     gchar *prompt, *passwd;
 
     /* FIXME: create dialog according to the Gnome HIG */
@@ -366,14 +368,14 @@ get_passphrase_real(const gchar * uid_hint, const gchar * passphrase_info,
                                          _("_OK"),     GTK_RESPONSE_OK,
                                          _("_Cancel"), GTK_RESPONSE_CANCEL,
                                          NULL);
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, parent);
 #endif
+
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
     gtk_container_set_border_width(GTK_CONTAINER(hbox), 12);
-    gtk_container_add(GTK_CONTAINER
-                     (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                     hbox);
+    gtk_container_add(GTK_CONTAINER(content_area), hbox);
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
     gtk_container_add(GTK_CONTAINER(hbox), vbox);
@@ -400,7 +402,7 @@ get_passphrase_real(const gchar * uid_hint, const gchar * passphrase_info,
     entry = gtk_entry_new();
     gtk_container_add(GTK_CONTAINER(vbox), entry);
 
-    gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
+    gtk_widget_show_all(content_area);
     gtk_entry_set_width_chars(GTK_ENTRY(entry), 40);
     gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
 
diff --git a/libbalsa/libbalsa-gpgme-widgets.c b/libbalsa/libbalsa-gpgme-widgets.c
index ba082ca01..8d1400a10 100644
--- a/libbalsa/libbalsa-gpgme-widgets.c
+++ b/libbalsa/libbalsa-gpgme-widgets.c
@@ -378,6 +378,7 @@ libbalsa_key_dialog(GtkWindow            *parent,
                                        const gchar          *message2)
 {
        GtkWidget *dialog;
+       GtkWidget *content_area;
        GtkWidget *hbox;
        GtkWidget *icon;
        GtkWidget *vbox;
@@ -400,12 +401,13 @@ libbalsa_key_dialog(GtkWindow            *parent,
                g_error("%s: buttons type %d not yet implemented", __func__, buttons);
        }
        geometry_manager_attach(GTK_WINDOW(dialog), "KeyDialog");
+       content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 
        hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
        gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
         gtk_widget_set_vexpand(hbox, TRUE);
         gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-       gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox, FALSE, FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(content_area), hbox, FALSE, FALSE, 0);
        gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE);
 
        /* standard key icon; "application-certificate" would be an alternative... */
diff --git a/libbalsa/libbalsa.c b/libbalsa/libbalsa.c
index 4c2bf4c15..003d6c7b9 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -391,6 +391,7 @@ ask_cert_real(void *data)
     GString *str;
     unsigned i;
     GtkWidget *label;
+    GtkWidget *content_area;
 
     /* never accept if the certificate is broken, resulting in a NULL widget */
     cert_widget = x509_cert_chain_tls(acd->certificate);
@@ -408,6 +409,7 @@ ask_cert_real(void *data)
                                          _("_Reject"), GTK_RESPONSE_CANCEL,
                                          NULL);
     gtk_window_set_role(GTK_WINDOW(dialog), "tls_cert_dialog");
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 
     str = g_string_new("");
     g_string_printf(str, _("<big><b>Authenticity of this certificate "
@@ -419,16 +421,14 @@ ask_cert_real(void *data)
     gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
     gtk_widget_set_margin_top(label, 1);
     gtk_widget_set_margin_bottom(label, 1);
-    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                       label, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);
     gtk_widget_show(label);
 
     gtk_widget_set_vexpand(cert_widget, TRUE);
     gtk_widget_set_valign(cert_widget, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(cert_widget, 1);
     gtk_widget_set_margin_bottom(cert_widget, 1);
-    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                       cert_widget, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(content_area), cert_widget, FALSE, FALSE, 0);
     gtk_widget_show_all(cert_widget);
 
     switch(gtk_dialog_run(GTK_DIALOG(dialog))) {
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index bf13c0aad..4bd66d889 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -299,6 +299,7 @@ libbalsa_smtp_server_dialog(LibBalsaSmtpServer * smtp_server,
     LibBalsaServer *server = LIBBALSA_SERVER(smtp_server);
     struct smtp_server_dialog_info *sdi;
     GtkWidget *dialog;
+    GtkWidget *content_area;
     GtkWidget *label, *hbox;
 
     /* Show only one dialog at a time. */
@@ -327,6 +328,7 @@ libbalsa_smtp_server_dialog(LibBalsaSmtpServer * smtp_server,
                                     _("_Cancel"), GTK_RESPONSE_CANCEL,
                                     _("_Help"),   GTK_RESPONSE_HELP,
                                     NULL);
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, parent);
 #endif
@@ -340,7 +342,7 @@ libbalsa_smtp_server_dialog(LibBalsaSmtpServer * smtp_server,
                                       FALSE);
 
     sdi->notebook = libbalsa_server_cfg_new(server, smtp_server->name);
-    gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), 
GTK_WIDGET(sdi->notebook));
+    gtk_container_add(GTK_CONTAINER(content_area), GTK_WIDGET(sdi->notebook));
 
 #define HIG_PADDING 12
 
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index dace4f5c2..c51cf84ed 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -1790,6 +1790,7 @@ bmbl_mru_show_tree(GtkWidget * widget, gpointer data)
 {
     BalsaMBListMRUEntry *mru = data;
     GtkWidget *dialog;
+    GtkWidget *content_area;
     GtkWidget *scroll;
     GtkWidget *mblist;
     GtkTreeSelection *selection;
@@ -1816,12 +1817,14 @@ bmbl_mru_show_tree(GtkWidget * widget, gpointer data)
                                     libbalsa_dialog_flags(),
                                     _("_Cancel"), GTK_RESPONSE_CANCEL,
                                     NULL);
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, mru->window);
 #endif
+
     gtk_widget_set_vexpand(scroll, TRUE);
     gtk_widget_set_valign(scroll, GTK_ALIGN_FILL);
-    gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), scroll);
+    gtk_container_add(GTK_CONTAINER(content_area), scroll);
 
     g_signal_connect(dialog, "size-allocate",
                      G_CALLBACK(bmbl_mru_size_allocate_cb), NULL);
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index ddc31ab16..56825514f 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -507,13 +507,9 @@ static GtkWidget *
 bm_header_widget_new(BalsaMessage * bm, GtkWidget * const * buttons)
 {
     GtkWidget *grid;
-#ifdef GTK_INFO_BAR_WRAPPING_IS_BROKEN
-    GtkWidget *hbox;
-#else                           /* GTK_INFO_BAR_WRAPPING_IS_BROKEN */
     GtkWidget *info_bar_widget;
     GtkInfoBar *info_bar;
     GtkWidget *content_area;
-#endif                          /* GTK_INFO_BAR_WRAPPING_IS_BROKEN */
     GtkWidget *action_area;
     GtkWidget *widget;
     GtkEventController *key_controller;
@@ -530,18 +526,6 @@ bm_header_widget_new(BalsaMessage * bm, GtkWidget * const * buttons)
     g_signal_connect(key_controller, "key-pressed",
                     G_CALLBACK(balsa_mime_widget_key_pressed), bm);
 
-#ifdef GTK_INFO_BAR_WRAPPING_IS_BROKEN
-    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-    gtk_container_add(GTK_CONTAINER(hbox), grid);
-    gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
-
-    action_area = gtk_button_box_new(GTK_ORIENTATION_VERTICAL);
-    gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area),
-                              GTK_BUTTONBOX_START);
-
-    gtk_widget_set_valign(action_area, GTK_ALIGN_FILL);
-    gtk_box_pack_end(GTK_BOX(hbox), action_area, FALSE, FALSE, 0);
-#else                           /* GTK_INFO_BAR_WRAPPING_IS_BROKEN */
     info_bar_widget = gtk_info_bar_new();
     info_bar = GTK_INFO_BAR(info_bar_widget);
 
@@ -553,7 +537,6 @@ bm_header_widget_new(BalsaMessage * bm, GtkWidget * const * buttons)
                                    GTK_ORIENTATION_VERTICAL);
     gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area),
                               GTK_BUTTONBOX_START);
-#endif                          /* GTK_INFO_BAR_WRAPPING_IS_BROKEN */
     if (balsa_message_get_face_box(bm) == NULL) {
         GtkWidget *face_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 
@@ -571,11 +554,7 @@ bm_header_widget_new(BalsaMessage * bm, GtkWidget * const * buttons)
 
     widget = gtk_frame_new(NULL);
     gtk_frame_set_shadow_type(GTK_FRAME(widget), GTK_SHADOW_IN);
-#ifdef GTK_INFO_BAR_WRAPPING_IS_BROKEN
-    gtk_container_add(GTK_CONTAINER(widget), hbox);
-#else                           /* GTK_INFO_BAR_WRAPPING_IS_BROKEN */
     gtk_container_add(GTK_CONTAINER(widget), info_bar_widget);
-#endif                          /* GTK_INFO_BAR_WRAPPING_IS_BROKEN */
 
     g_object_set_data(G_OBJECT(widget), BALSA_MESSAGE_GRID, grid);
 
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index 8f5df6462..e2c3dcdb8 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -560,6 +560,7 @@ fe_collect_user_headers(LibBalsaCondition * condition)
 void
 filters_edit_dialog(GtkWindow * parent)
 {
+    GtkWidget *content_area;
     GtkWidget *hbox;
     GtkWidget *piece;
     LibBalsaFilter * cpfil,* fil;
@@ -590,6 +591,7 @@ filters_edit_dialog(GtkWindow * parent)
                                             _("_Cancel"), GTK_RESPONSE_CANCEL,
                                             _("_Help"), GTK_RESPONSE_HELP,
                                            NULL);
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(fe_window));
 
     g_signal_connect(fe_window, "response",
                      G_CALLBACK(fe_dialog_response), NULL);
@@ -606,7 +608,7 @@ filters_edit_dialog(GtkWindow * parent)
     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_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(fe_window))), hbox);
+    gtk_container_add(GTK_CONTAINER(content_area), hbox);
 
     gtk_widget_set_margin_start(piece, FILTER_EDIT_PADDING);
     gtk_widget_set_margin_end(piece, FILTER_EDIT_PADDING);
diff --git a/src/filter-export-dialog.c b/src/filter-export-dialog.c
index de5b87ca2..815bdadaa 100644
--- a/src/filter-export-dialog.c
+++ b/src/filter-export-dialog.c
@@ -51,6 +51,7 @@ GtkWidget * fex_window;
 void
 filters_export_dialog(GtkWindow * parent)
 {
+    GtkWidget *content_area;
     GtkTreeView *list;
     GtkTreeModel *model;
     GtkTreeIter iter;
@@ -80,6 +81,7 @@ filters_export_dialog(GtkWindow * parent)
                                     _("_Cancel"), GTK_RESPONSE_CANCEL,
                                     _("_Help"), GTK_RESPONSE_HELP,
                                     NULL);
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(fex_window));
     gtk_window_set_role(GTK_WINDOW(fex_window), "filter-export");
 
     sw = gtk_scrolled_window_new(NULL, NULL);
@@ -96,7 +98,7 @@ filters_export_dialog(GtkWindow * parent)
     gtk_widget_set_valign(sw, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(sw, 2);
     gtk_widget_set_margin_bottom(sw, 2);
-    gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(fex_window))), sw);
+    gtk_container_add(GTK_CONTAINER(content_area), sw);
 
     /* Populate the list of filters */
 
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index e9cc6120f..cffbfc3e8 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -274,6 +274,7 @@ static
 void
 balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
 {
+    GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(p));
     GtkWidget *bbox, *hbox, *vbox;
     GtkTreeSelection *selection;
     GtkWidget *button;
@@ -310,7 +311,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
 
     gtk_widget_set_vexpand(hbox, TRUE);
     gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-    gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(p))), hbox);
+    gtk_container_add(GTK_CONTAINER(content_area), hbox);
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
     gtk_widget_set_hexpand(vbox, TRUE);
diff --git a/src/folder-conf.c b/src/folder-conf.c
index c2dcc0469..95d3cbf94 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -307,6 +307,7 @@ create_imap_folder_dialog(LibBalsaServer  *server,
                                                  GtkWidget      **treeview)
 {
        GtkWidget *dialog;
+       GtkWidget *content_area;
        GtkWidget *vbox;
        GtkWidget *label;
        GtkWidget *scrolled_wind;
@@ -344,16 +345,17 @@ create_imap_folder_dialog(LibBalsaServer  *server,
                                                      _("_OK"), GTK_RESPONSE_ACCEPT,
                                                      NULL);
        }
+        content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
        geometry_manager_attach(GTK_WINDOW(dialog), geometry_key);
 
        /* content: vbox, message label, scrolled window */
        vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
-       gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
+       gtk_container_add(GTK_CONTAINER(content_area), vbox);
        gtk_widget_set_vexpand(vbox, TRUE);
 
        label = libbalsa_create_wrap_label(message, FALSE);
-       gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
+       gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
        scrolled_wind = gtk_scrolled_window_new(NULL,NULL);
        gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_wind),
@@ -361,7 +363,10 @@ create_imap_folder_dialog(LibBalsaServer  *server,
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_wind),
                                        GTK_POLICY_NEVER,
                                        GTK_POLICY_AUTOMATIC);
-       gtk_box_pack_start(GTK_BOX(vbox), scrolled_wind, TRUE, TRUE, 0);
+
+        gtk_widget_set_vexpand(scrolled_wind, TRUE);
+        gtk_widget_set_valign(scrolled_wind, GTK_ALIGN_FILL);
+       gtk_container_add(GTK_CONTAINER(vbox), scrolled_wind);
 
        /* folder tree */
        *treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(*store));
@@ -439,6 +444,7 @@ folder_conf_imap_node(BalsaMailboxNode *mn)
     static FolderDialogData *folder_data_new;
     GtkWidget *box;
     GtkWidget *button;
+    GtkWidget *content_area;
 
     /* Allow only one dialog per mailbox node, and one with mn == NULL
      * for creating a new folder. */
@@ -486,13 +492,18 @@ folder_conf_imap_node(BalsaMailboxNode *mn)
     }
 
     folder_data->server_cfg = libbalsa_server_cfg_new(folder_data->server, (mn != NULL) ? 
balsa_mailbox_node_get_name(mn) : NULL);
-    
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(folder_data->common_data.dialog))), 
GTK_WIDGET(folder_data->server_cfg));
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(folder_data->common_data.dialog));
+    gtk_container_add(GTK_CONTAINER(content_area), GTK_WIDGET(folder_data->server_cfg));
     g_signal_connect(folder_data->server_cfg, "changed", G_CALLBACK(validate_folder), folder_data);
 
     /* additional basic settings - subscription management */
     box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
+
     folder_data->subscribed = gtk_check_button_new_with_mnemonic(_("Subscribed _folders only"));
-    gtk_box_pack_start(GTK_BOX(box), folder_data->subscribed, TRUE, TRUE, 0);
+    gtk_widget_set_hexpand(folder_data->subscribed, TRUE);
+    gtk_widget_set_halign(folder_data->subscribed, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(box), folder_data->subscribed);
+
     button = gtk_button_new_with_label(_("Manage subscriptions…"));
     g_signal_connect(button, "clicked", G_CALLBACK(folder_conf_imap_subscriptions), folder_data);
     if (mn != NULL) {
@@ -694,12 +705,12 @@ folder, parent);
                                                 _("Cancel"),
                                                 GTK_RESPONSE_CANCEL,
                                                 NULL);
+                GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(ask));
+
 #if HAVE_MACOSX_DESKTOP
                libbalsa_macosx_menu_for_parent(ask, GTK_WINDOW(sub_folder_data->common_data.dialog));
 #endif
-                gtk_container_add(GTK_CONTAINER
-                                  (gtk_dialog_get_content_area
-                                   (GTK_DIALOG(ask))), gtk_label_new(msg));
+                gtk_container_add(GTK_CONTAINER(content_area), gtk_label_new(msg));
                 g_free(msg);
                 button = gtk_dialog_run(GTK_DIALOG(ask));
                 gtk_widget_destroy(ask);
@@ -796,6 +807,7 @@ set_ok_sensitive(GtkDialog * dialog)
 void
 folder_conf_imap_sub_node(BalsaMailboxNode * mn)
 {
+    GtkWidget *content_area;
     GtkWidget *grid, *button, *label, *hbox;
     SubfolderDialogData *sub_folder_data;
     LibBalsaMailbox *mailbox;
@@ -842,6 +854,7 @@ folder_conf_imap_sub_node(BalsaMailboxNode * mn)
                     _("_Cancel"), GTK_RESPONSE_CANCEL,
                     _("_Help"), GTK_RESPONSE_HELP,
                     NULL));
+    content_area = gtk_dialog_get_content_area(sub_folder_data->common_data.dialog);
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(GTK_WIDGET(sub_folder_data->common_data.dialog), 
GTK_WINDOW(balsa_app.main_window));
 #endif
@@ -865,8 +878,9 @@ folder_conf_imap_sub_node(BalsaMailboxNode * mn)
     gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
     gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
     gtk_container_set_border_width(GTK_CONTAINER(grid), 12);
-    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(sub_folder_data->common_data.dialog)),
-                       grid, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(grid, TRUE);
+    gtk_widget_set_valign(grid, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(content_area), grid);
  
     row = 0;
     /* INPUT FIELD CREATION */
@@ -897,9 +911,13 @@ folder_conf_imap_sub_node(BalsaMailboxNode * mn)
                     G_CALLBACK(browse_button_cb), (gpointer) sub_folder_data);
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
-    gtk_widget_set_hexpand(hbox, TRUE);
-    gtk_box_pack_start(GTK_BOX(hbox), sub_folder_data->parent_folder, TRUE, TRUE, 0);
+
+    gtk_widget_set_hexpand(sub_folder_data->parent_folder, TRUE);
+    gtk_widget_set_halign(sub_folder_data->parent_folder, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(hbox), sub_folder_data->parent_folder);
     gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+
+    gtk_widget_set_hexpand(hbox, TRUE);
     gtk_grid_attach(GTK_GRID(grid), hbox, 1, row, 1, 1);
 
     {
@@ -1076,6 +1094,7 @@ folder_conf_add_imap_sub_cb(GtkWidget * widget, gpointer data)
 
        if (mbnode != NULL) {
                GtkWidget *dialog;
+               GtkWidget *content_area;
                GtkWidget *grid;
                GtkWidget *plabel;
                GtkWidget *label;
@@ -1090,11 +1109,16 @@ folder_conf_add_imap_sub_cb(GtkWidget * widget, gpointer data)
              _("_Cancel"), GTK_RESPONSE_REJECT,
              NULL);
                gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_REJECT);
+                content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
            grid = libbalsa_create_grid();
            gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
            gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
            gtk_container_set_border_width(GTK_CONTAINER(grid), 12);
-           gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), grid, TRUE, TRUE, 0);
+
+            gtk_widget_set_vexpand(grid, TRUE);
+            gtk_widget_set_valign(grid, GTK_ALIGN_FILL);
+            gtk_container_add(GTK_CONTAINER(content_area), grid);
 
            row = 0;
            (void) libbalsa_create_grid_label(_("Subfolder of:"), grid, row);
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 408c94f88..c0cd54035 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -780,6 +780,7 @@ create_local_mailbox_dialog(MailboxConfWindow *mcw)
 static GtkWidget *
 create_pop_mailbox_dialog(MailboxConfWindow *mcw)
 {
+    GtkWidget *content_area;
        LibBalsaMailbox *mailbox = mcw->mailbox;
     LibBalsaMailboxPOP3 *mailbox_pop3 = LIBBALSA_MAILBOX_POP3(mailbox);
 
@@ -789,6 +790,7 @@ create_pop_mailbox_dialog(MailboxConfWindow *mcw)
         mcw->ok_button_name, MCW_RESPONSE,
                _("_Cancel"), GTK_RESPONSE_CANCEL,
         NULL));
+    content_area = gtk_dialog_get_content_area(GTK_DIALOG(mcw->window));
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(mcw->window, GTK_WINDOW(balsa_app.main_window));
 #endif
@@ -796,7 +798,7 @@ create_pop_mailbox_dialog(MailboxConfWindow *mcw)
     mcw->mb_data.pop3.server_cfg =
         libbalsa_server_cfg_new(LIBBALSA_MAILBOX_REMOTE_GET_SERVER(mailbox),
                                 libbalsa_mailbox_get_name(mailbox));
-    gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(mcw->window))), 
GTK_WIDGET(mcw->mb_data.pop3.server_cfg));
+    gtk_container_add(GTK_CONTAINER(content_area), GTK_WIDGET(mcw->mb_data.pop3.server_cfg));
     g_signal_connect(mcw->mb_data.pop3.server_cfg, "changed", G_CALLBACK(check_for_blank_fields), mcw);
 
     /* toggle for deletion from server */
diff --git a/src/main-window.c b/src/main-window.c
index a30dfc771..cd4e0a157 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -203,6 +203,7 @@ struct _BalsaWindowPrivate {
     GtkWidget *current_index;
     GtkWidget *filter_choice;
     GtkWidget *vbox;
+    GtkWidget *content_area;
 
     guint set_message_id;
 
@@ -2302,8 +2303,14 @@ balsa_window_new(GtkApplication *application)
     priv->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
     gtk_box_pack_start(GTK_BOX(priv->vbox), priv->toolbar, FALSE, FALSE, 0);
 
+    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);
+
     priv->bottom_bar = hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-    gtk_box_pack_end(GTK_BOX(priv->vbox), hbox, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(priv->vbox), hbox, FALSE, FALSE, 0);
 
     priv->progress_bar = gtk_progress_bar_new();
     g_object_add_weak_pointer(G_OBJECT(priv->progress_bar),
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index dd5df892c..44767f96a 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -3472,6 +3472,7 @@ static void
 show_decrypted_warning(GtkWindow *parent)
 {
        GtkWidget *dialog;
+       GtkWidget *message_area;
        GtkWidget *remind_btn;
 
        dialog = gtk_message_dialog_new(parent,
@@ -3482,11 +3483,12 @@ show_decrypted_warning(GtkWindow *parent)
                  "the decrypted contents of the original message.\n"
                  "Consider to encrypt the reply, and verify that you do not "
                  "unintentionally leak sensitive information."));
+        message_area = gtk_message_dialog_get_message_area(GTK_MESSAGE_DIALOG(dialog));
+
        remind_btn = gtk_check_button_new_with_label(_("Do not remind me again."));
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remind_btn), FALSE);
        gtk_widget_show(remind_btn);
-       gtk_box_pack_end(GTK_BOX(gtk_message_dialog_get_message_area(GTK_MESSAGE_DIALOG(dialog))),
-               remind_btn, FALSE, FALSE, 0);
+       gtk_box_pack_end(GTK_BOX(message_area), remind_btn, FALSE, FALSE, 0);
        gtk_dialog_run(GTK_DIALOG(dialog));
        balsa_app.warn_reply_decrypted = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remind_btn));
        gtk_widget_destroy(dialog);
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index 6916c2682..55ce1c88c 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -504,7 +504,10 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     gtk_box_pack_start(GTK_BOX(button_box), page->forward_button, FALSE, FALSE, 0);
 
     /* Pack destination list */
-    gtk_box_pack_start(GTK_BOX(lower_ctlbox), destination_frame, TRUE, TRUE, 0);
+    gtk_widget_set_hexpand(destination_frame, TRUE);
+    gtk_widget_set_halign(destination_frame, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(lower_ctlbox), destination_frame);
+
     gtk_container_add(GTK_CONTAINER(destination_frame), destination_scroll);
     gtk_container_add(GTK_CONTAINER(destination_scroll), page->current);
 


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