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




commit 4eb5aeb0f85360f518922ce98c2b5e36b97463bf
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jun 7 16:15:14 2020 -0400

    Various: Stop using GtkBox child properties
    
    Stop using GtkBox padding, fill and expand child properties.
    Also, when the child is a GtkNotebook or a GtkStack or sometimes a
    GtkButton, we must again use container_add(…) instead of
    pack_start(…, FALSE, FALSE, 0).
    
    * src/ab-main.c (bab_get_filter_box), (bab_window_new):
    * src/ab-window.c (balsa_ab_window_init):
    * src/balsa-mblist.c (bmbl_mru_show_tree):
    * src/balsa-message.c (bm_find_bar_new), (balsa_message_init), (add_part):
    * src/balsa-mime-widget-crypto.c
      (balsa_mime_widget_signature_widget), (create_import_keys_widget):
    * src/balsa-mime-widget-message.c (bmw_message_extbody_url),
      (bmw_message_extbody_mail), (balsa_mime_widget_new_message_tl), (bm_header_widget_new):
    * src/balsa-mime-widget.c (balsa_mime_widget_new_unknown):

 ChangeLog                       | 16 +++++++++++
 src/ab-main.c                   | 64 ++++++++++++++++++++++++++++++++---------
 src/ab-window.c                 | 40 +++++++++++++++++---------
 src/balsa-mblist.c              |  6 ++--
 src/balsa-message.c             | 15 ++++++----
 src/balsa-mime-widget-crypto.c  | 23 +++++++++++----
 src/balsa-mime-widget-message.c | 28 +++++++++++-------
 src/balsa-mime-widget.c         | 16 +++++++----
 8 files changed, 151 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6c422b657..a1fb9c0aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -178,6 +178,22 @@
        * src/filter-run-dialog.c (balsa_filter_run_dialog_new): call
        prepare-threading to get ready for filtering.
 
+2020-06-07  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Various: Stop using GtkBox padding, fill and expand child properties
+
+       * src/ab-main.c (bab_get_filter_box), (bab_window_new):
+       * src/ab-window.c (balsa_ab_window_init):
+       * src/balsa-mblist.c (bmbl_mru_show_tree):
+       * src/balsa-message.c (bm_find_bar_new), (balsa_message_init),
+       (add_part):
+       * src/balsa-mime-widget-crypto.c
+       (balsa_mime_widget_signature_widget), (create_import_keys_widget):
+       * src/balsa-mime-widget-message.c (bmw_message_extbody_url),
+       (bmw_message_extbody_mail), (balsa_mime_widget_new_message_tl),
+       (bm_header_widget_new):
+       * src/balsa-mime-widget.c (balsa_mime_widget_new_unknown):
+
 2020-06-07  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Various: Stop using GtkBox padding, fill and expand child properties
diff --git a/src/ab-main.c b/src/ab-main.c
index 725291c5f..5cfd31796 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -872,21 +872,38 @@ bab_get_filter_box(void)
 {
     GtkWidget *search_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
     GtkWidget *find_label, *find_entry, *button;
+    GtkWidget *widget;
 
-    gtk_widget_show(search_hbox);
     find_label = gtk_label_new_with_mnemonic(_("F_ilter:"));
     gtk_widget_show(find_label);
-    gtk_box_pack_start(GTK_BOX(search_hbox), find_label, FALSE, FALSE, 1);
+
+    widget = find_label;
+    gtk_widget_set_margin_start(widget, 1);
+    gtk_widget_set_margin_end(widget, 1);
+    gtk_box_pack_start(GTK_BOX(search_hbox), widget, FALSE, FALSE, 0);
+
     find_entry = gtk_entry_new();
     gtk_widget_show(find_entry);
-    gtk_box_pack_start(GTK_BOX(search_hbox), find_entry, TRUE, TRUE, 1);
+
+    widget = find_entry;
+    gtk_widget_set_hexpand(widget, TRUE);
+    gtk_widget_set_halign(widget, GTK_ALIGN_FILL);
+    gtk_widget_set_margin_start(widget, 1);
+    gtk_widget_set_margin_end(widget, 1);
+    gtk_box_pack_start(GTK_BOX(search_hbox), widget, FALSE, FALSE, 0);
+
     gtk_widget_show(search_hbox);
     gtk_label_set_mnemonic_widget(GTK_LABEL(find_label), find_entry);
+
     button = gtk_button_new();
     gtk_container_add(GTK_CONTAINER(button),
                       gtk_image_new_from_icon_name("gtk-ok",
                                                    GTK_ICON_SIZE_BUTTON));
-    gtk_box_pack_start(GTK_BOX(search_hbox), button, FALSE, FALSE, 1);
+
+    widget = button;
+    gtk_widget_set_margin_start(widget, 1);
+    gtk_widget_set_margin_end(widget, 1);
+    gtk_box_pack_start(GTK_BOX(search_hbox), widget, FALSE, FALSE, 0);
 
     g_signal_connect(find_entry, "activate",
                      G_CALLBACK(bab_filter_entry_activate),
@@ -926,6 +943,7 @@ bab_window_new(GtkApplication * application)
     GtkWidget *browse_widget;
     GtkWidget *edit_widget;
     GtkEventController *key_controller;
+    GtkWidget *widget;
 
     contacts_app.window =
         GTK_WINDOW(wnd = gtk_application_window_new(application));
@@ -938,20 +956,33 @@ bab_window_new(GtkApplication * application)
     gtk_container_add(GTK_CONTAINER(wnd), main_vbox);
 
     contacts_app.notebook = gtk_notebook_new();
-    gtk_box_pack_start(GTK_BOX(main_vbox),
-                      contacts_app.notebook, TRUE, TRUE, 1);
+
+    widget = contacts_app.notebook;
+    gtk_widget_set_vexpand(widget, TRUE);
+    gtk_widget_set_valign(widget, GTK_ALIGN_FILL);
+    gtk_widget_set_margin_top(widget, 1);
+    gtk_widget_set_margin_bottom(widget, 1);
+    gtk_container_add(GTK_CONTAINER(main_vbox), widget);
 
     browse_widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
 
     /* Entry widget for finding an address */
-    gtk_box_pack_start(GTK_BOX(browse_widget),
-                       bab_get_filter_box(), FALSE, FALSE, 1);
+    widget = bab_get_filter_box();
+    gtk_widget_set_margin_top(widget, 1);
+    gtk_widget_set_margin_bottom(widget, 1);
+    gtk_box_pack_start(GTK_BOX(browse_widget), widget, FALSE, FALSE, 0);
 
     scroll = gtk_scrolled_window_new(NULL, NULL);
     gtk_widget_show(scroll);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-    gtk_box_pack_start(GTK_BOX(browse_widget), scroll, TRUE, TRUE, 1);
+
+    widget = scroll;
+    gtk_widget_set_vexpand(widget, TRUE);
+    gtk_widget_set_valign(widget, GTK_ALIGN_FILL);
+    gtk_widget_set_margin_top(widget, 1);
+    gtk_widget_set_margin_bottom(widget, 1);
+    gtk_container_add(GTK_CONTAINER(browse_widget), widget);
 
     contacts_app.entry_list = bab_window_list_new();
     gtk_container_add(GTK_CONTAINER(scroll), contacts_app.entry_list);
@@ -964,11 +995,16 @@ bab_window_new(GtkApplication * application)
         libbalsa_address_get_edit_widget(NULL, contacts_app.entries,
                                          G_CALLBACK(address_changed_cb),
                                          &contacts_app);
-    gtk_box_pack_start(GTK_BOX(edit_widget), contacts_app.edit_widget,
-                       FALSE, FALSE, 1);
-    gtk_box_pack_start(GTK_BOX(edit_widget),
-                       bab_get_edit_button_box(&contacts_app),
-                       FALSE, FALSE, 1);
+
+    widget = contacts_app.edit_widget;
+    gtk_widget_set_margin_top(widget, 1);
+    gtk_widget_set_margin_bottom(widget, 1);
+    gtk_box_pack_start(GTK_BOX(edit_widget), widget, FALSE, FALSE, 0);
+
+    widget = bab_get_edit_button_box(&contacts_app);
+    gtk_widget_set_margin_top(widget, 1);
+    gtk_widget_set_margin_bottom(widget, 1);
+    gtk_box_pack_start(GTK_BOX(edit_widget), widget, FALSE, FALSE, 0);
 
     gtk_notebook_append_page(GTK_NOTEBOOK(contacts_app.notebook), edit_widget,
                             gtk_label_new(_("Edit")));
diff --git a/src/ab-window.c b/src/ab-window.c
index af57a1e8c..e089cb24b 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -285,7 +285,9 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     grid = gtk_grid_new();
     gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
     gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
-    gtk_box_pack_start(GTK_BOX(vbox), grid, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(grid, TRUE);
+    gtk_widget_set_valign(grid, GTK_ALIGN_FILL);
+    gtk_box_pack_start(GTK_BOX(vbox), grid, FALSE, FALSE, 0);
     gtk_widget_show(grid);
 
     /* -- grid column 1 -- */
@@ -303,7 +305,9 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     box2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
     gtk_grid_attach(GTK_GRID(grid), box2, 0, 0, 1, 1);
     gtk_box_pack_start(GTK_BOX(box2), find_label, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(box2), ab->filter_entry, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(ab->filter_entry, TRUE);
+    gtk_widget_set_valign(ab->filter_entry, GTK_ALIGN_FILL);
+    gtk_box_pack_start(GTK_BOX(box2), ab->filter_entry, FALSE, FALSE, 0);
     gtk_widget_show(GTK_WIDGET(box2));
 
 
@@ -350,7 +354,8 @@ balsa_ab_window_init(BalsaAbWindow *ab)
 
     w = gtk_button_new_from_icon_name("go-next-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
-    gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, TRUE, FALSE, 0);
+    gtk_widget_set_vexpand(w, TRUE);
+    gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, FALSE, FALSE, 0);
     gtk_widget_show(w);
     g_signal_connect(w, "clicked",
                     G_CALLBACK(balsa_ab_window_move_to_recipient_list),
@@ -358,7 +363,8 @@ balsa_ab_window_init(BalsaAbWindow *ab)
 
     w = gtk_button_new_from_icon_name("go-previous-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
-    gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, TRUE, FALSE, 0);
+    gtk_widget_set_vexpand(w, TRUE);
+    gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, FALSE, FALSE, 0);
     gtk_widget_show(w);
     g_signal_connect(w, "clicked",
                     G_CALLBACK(balsa_ab_window_remove_from_recipient_list),
@@ -382,9 +388,6 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_widget_set_size_request(ab->send_to_list, 300, 250);
 
     /* mode switching stuff */
-    frame = gtk_frame_new(_("Treat multiple addresses as:"));
-    gtk_widget_show(frame);
-
     ab->single_address_mode_radio = gtk_radio_button_new_with_label
        (NULL, _("alternative addresses for the same person"));
     gtk_widget_show(ab->single_address_mode_radio);
@@ -407,13 +410,24 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     /* Pack them into a box  */
     box2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
     gtk_box_set_homogeneous(GTK_BOX(box2), TRUE);
-    gtk_container_add(GTK_CONTAINER(frame), box2);
-    gtk_box_pack_start(GTK_BOX(box2), ab->single_address_mode_radio,
-                      FALSE, FALSE, 1);
-    gtk_box_pack_start(GTK_BOX(box2), ab->dist_address_mode_radio,
-                      FALSE, FALSE, 1);
+
+    gtk_widget_set_margin_top(ab->single_address_mode_radio, 1);
+    gtk_widget_set_margin_bottom(ab->single_address_mode_radio, 1);
+    gtk_box_pack_start(GTK_BOX(box2), ab->single_address_mode_radio, FALSE, FALSE, 0);
+
+    gtk_widget_set_margin_top(ab->dist_address_mode_radio, 1);
+    gtk_widget_set_margin_bottom(ab->dist_address_mode_radio, 1);
+    gtk_box_pack_start(GTK_BOX(box2), ab->dist_address_mode_radio, FALSE, FALSE, 0);
+
     gtk_widget_show(box2);
-    gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 1);
+
+    frame = gtk_frame_new(_("Treat multiple addresses as:"));
+    gtk_container_add(GTK_CONTAINER(frame), box2);
+    gtk_widget_show(frame);
+
+    gtk_widget_set_margin_top(frame, 1);
+    gtk_widget_set_margin_bottom(frame, 1);
+    gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
     gtk_widget_grab_focus(ab->filter_entry);
 }
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index 9bb94f654..ba6879228 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -1892,9 +1892,9 @@ bmbl_mru_show_tree(GtkWidget * widget, gpointer data)
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, mru->window);
 #endif
-    gtk_box_pack_start(GTK_BOX
-                      (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                      scroll, TRUE, TRUE, 0);
+    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);
 
     g_signal_connect(dialog, "size-allocate",
                      G_CALLBACK(bmbl_mru_size_allocate_cb), NULL);
diff --git a/src/balsa-message.c b/src/balsa-message.c
index f2584d66b..e9266d161 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -561,8 +561,7 @@ bm_find_bar_new(BalsaMessage * balsa_message)
     gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-    gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(_("Find:")),
-                       FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(_("Find:")), FALSE, FALSE, 0);
     balsa_message->find_entry = gtk_search_entry_new();
     g_signal_connect(balsa_message->find_entry, "search-changed",
                      G_CALLBACK(bm_find_entry_changed_cb), balsa_message);
@@ -676,7 +675,10 @@ balsa_message_init(BalsaMessage * balsa_message)
     gtk_stack_set_transition_type(stack,
                                   GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
     gtk_stack_switcher_set_stack(GTK_STACK_SWITCHER(balsa_message->switcher), stack);
-    gtk_box_pack_start(GTK_BOX(balsa_message), balsa_message->stack, TRUE, TRUE, 0);
+
+    gtk_widget_set_vexpand(balsa_message->stack, TRUE);
+    gtk_widget_set_valign(balsa_message->stack, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(balsa_message), balsa_message->stack);
 
     /* Box to hold the scrolled window and the find bar */
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
@@ -692,7 +694,9 @@ balsa_message_init(BalsaMessage * balsa_message)
     g_signal_connect(key_controller, "key-pressed",
                     G_CALLBACK(balsa_mime_widget_key_pressed), balsa_message);
 
-    gtk_box_pack_start(GTK_BOX(vbox), scroll, TRUE, TRUE, 0);
+    gtk_widget_set_vexpand(scroll, TRUE);
+    gtk_widget_set_valign(scroll, GTK_ALIGN_FILL);
+    gtk_container_add(GTK_CONTAINER(vbox), scroll);
 
     /* Widget to hold headers */
     buttons = bm_header_tl_buttons(balsa_message);
@@ -2194,7 +2198,8 @@ add_part(BalsaMessage * balsa_message, BalsaPartInfo * info, GtkWidget * contain
     if (info->mime_widget == NULL)
        part_info_init(balsa_message, info);
 
-    gtk_box_pack_start(GTK_BOX(container), GTK_WIDGET(info->mime_widget), FALSE, TRUE, 0);
+    gtk_widget_set_valign(GTK_WIDGET(info->mime_widget), TRUE);
+    gtk_box_pack_start(GTK_BOX(container), GTK_WIDGET(info->mime_widget), FALSE, FALSE, 0);
 
     info_container = balsa_mime_widget_get_container(info->mime_widget);
     body = add_multipart(balsa_message, info->body,
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index ce11f0992..e5ef4a41d 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -132,7 +132,10 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
         hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
         gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_EXPAND);
         gtk_box_set_spacing(GTK_BOX(hbox), BMW_HBOX_SPACE);
-        gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
+
+        gtk_widget_set_vexpand(hbox, TRUE);
+        gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
+        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
         if (g_mime_gpgme_sigstat_status(mime_body->sig_info) == GPG_ERR_NO_PUBKEY) {
 #ifdef ENABLE_AUTOCRYPT
                GBytes *autocrypt_key;
@@ -142,7 +145,9 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
                        button = gtk_button_new_with_mnemonic(_("_Import Autocrypt key"));
                        g_object_set_data_full(G_OBJECT(button), "autocrypt_key", autocrypt_key, 
(GDestroyNotify) g_bytes_unref);
                        g_signal_connect(button, "clicked", G_CALLBACK(on_key_import_button), NULL);
-                       gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+                        gtk_widget_set_hexpand(button, TRUE);
+                        gtk_widget_set_halign(button, GTK_ALIGN_FILL);
+                       gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
                }
 #endif
             button = gtk_button_new_with_mnemonic(_("_Search key server for this key"));
@@ -152,7 +157,10 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
         g_signal_connect(button, "clicked",
                          G_CALLBACK(on_gpg_key_button),
                          (gpointer) g_mime_gpgme_sigstat_fingerprint(mime_body->sig_info));
-        gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+
+        gtk_widget_set_hexpand(button, TRUE);
+        gtk_widget_set_halign(button, GTK_ALIGN_FILL);
+        gtk_container_add(GTK_CONTAINER(hbox), button);
     }
 
     /* Hack alert: if we omit the box below and use the expander as signature widget
@@ -357,8 +365,13 @@ create_import_keys_widget(GtkBox *box, const gchar *key_buf, GError **error)
                                                gtk_box_pack_start(box, import_btn, FALSE, FALSE, 0);
 
                                                if (item->next != NULL) {
-                                                       gtk_box_pack_start(box, 
gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE,
-                                                               BMW_VBOX_SPACE);
+                                                    GtkWidget *separator =
+                                                        gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
+                                                    gtk_widget_set_margin_top(separator,
+                                                                              BMW_VBOX_SPACE);
+                                                    gtk_widget_set_margin_bottom(separator,
+                                                                                 BMW_VBOX_SPACE);
+                                                    gtk_box_pack_start(box, separator, FALSE, FALSE, 0);
                                                }
                                        }
                                }
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index 79812591e..0a6a8d607 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -244,13 +244,14 @@ bmw_message_extbody_url(LibBalsaMessageBody * mime_body,
     gtk_container_set_border_width(GTK_CONTAINER(mw),
                                   BMW_CONTAINER_BORDER);
 
-    gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg->str), FALSE,
-                      FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg->str), FALSE, FALSE, 0);
     g_string_free(msg, TRUE);
 
     button = gtk_button_new_with_label(url);
-    gtk_box_pack_start(GTK_BOX(mw), button, FALSE, FALSE,
-                      BMW_BUTTON_PACK_SPACE);
+    gtk_widget_set_margin_top(button, BMW_BUTTON_PACK_SPACE);
+    gtk_widget_set_margin_bottom(button, BMW_BUTTON_PACK_SPACE);
+    gtk_box_pack_start(GTK_BOX(mw), button, FALSE, FALSE, 0);
+
     g_object_set_data_full(G_OBJECT(button), "call_url", url,
                           (GDestroyNotify) g_free);
     g_signal_connect(button, "clicked",
@@ -290,15 +291,15 @@ bmw_message_extbody_mail(LibBalsaMessageBody * mime_body)
     gtk_container_set_border_width(GTK_CONTAINER(mw),
                                   BMW_CONTAINER_BORDER);
 
-    gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg->str), FALSE,
-                      FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg->str), FALSE, FALSE, 0);
     g_string_free(msg, TRUE);
 
     button =
        gtk_button_new_with_mnemonic(_
                                     ("Se_nd message to obtain this part"));
-    gtk_box_pack_start(GTK_BOX(mw), button, FALSE, FALSE,
-                      BMW_BUTTON_PACK_SPACE);
+    gtk_widget_set_margin_top(button, BMW_BUTTON_PACK_SPACE);
+    gtk_widget_set_margin_bottom(button, BMW_BUTTON_PACK_SPACE);
+    gtk_box_pack_start(GTK_BOX(mw), button, FALSE, FALSE, 0);
     g_signal_connect(button, "clicked",
                     G_CALLBACK(extbody_send_mail), (gpointer) mime_body);
 
@@ -418,8 +419,11 @@ balsa_mime_widget_new_message_tl(BalsaMessage * bm,
     container = gtk_box_new(GTK_ORIENTATION_VERTICAL, BMW_MESSAGE_PADDING);
     balsa_mime_widget_set_container(mw, container);
 
-    gtk_box_pack_start(GTK_BOX(mw), container, TRUE, TRUE,
-                      BMW_CONTAINER_BORDER - BMW_MESSAGE_PADDING);
+    gtk_widget_set_vexpand(container, TRUE);
+    gtk_widget_set_valign(container, GTK_ALIGN_FILL);
+    gtk_widget_set_margin_top(container, BMW_CONTAINER_BORDER - BMW_MESSAGE_PADDING);
+    gtk_widget_set_margin_bottom(container, BMW_CONTAINER_BORDER - BMW_MESSAGE_PADDING);
+    gtk_box_pack_start(GTK_BOX(mw), container, FALSE, FALSE, 0);
 
     return mw;
 }
@@ -503,7 +507,9 @@ bm_header_widget_new(BalsaMessage * bm, GtkWidget * const * buttons)
     action_area = gtk_button_box_new(GTK_ORIENTATION_VERTICAL);
     gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area),
                               GTK_BUTTONBOX_START);
-    gtk_box_pack_end(GTK_BOX(hbox), action_area, FALSE, TRUE, 0);
+
+    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);
diff --git a/src/balsa-mime-widget.c b/src/balsa-mime-widget.c
index 65ea90d6f..27d6cba27 100644
--- a/src/balsa-mime-widget.c
+++ b/src/balsa-mime-widget.c
@@ -204,8 +204,7 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
 
     if (mime_body->filename) {
        msg = g_strdup_printf(_("File name: %s"), mime_body->filename);
-       gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg), FALSE,
-                          FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg), FALSE, FALSE, 0);
        g_free(msg);
     }
 
@@ -265,17 +264,22 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
     gtk_box_set_homogeneous(GTK_BOX(hbox), TRUE);
     if ((button = libbalsa_vfs_mime_button(mime_body, use_content_type,
                                            G_CALLBACK(balsa_mime_widget_ctx_menu_cb),
-                                           (gpointer) mime_body)))
-       gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
-    else
+                                           (gpointer) mime_body))) {
+        gtk_widget_set_hexpand(button, TRUE);
+        gtk_widget_set_halign(button, GTK_ALIGN_FILL);
+       gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+    } else {
        gtk_box_pack_start(GTK_BOX(mw),
                           gtk_label_new(_("No open or view action "
                                           "defined for this content type")),
                           FALSE, FALSE, 0);
+    }
     g_free(use_content_type);
 
     button = gtk_button_new_with_mnemonic(_("S_ave part"));
-    gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+    gtk_widget_set_hexpand(button, TRUE);
+    gtk_widget_set_halign(button, GTK_ALIGN_FILL);
+    gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
     g_signal_connect(button, "clicked",
                     G_CALLBACK(balsa_mime_widget_ctx_menu_save),
                     (gpointer) mime_body);


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