[balsa/gtk4: 85/312] Various: Stop using GtkBox child properties
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk4: 85/312] Various: Stop using GtkBox child properties
- Date: Tue, 5 Oct 2021 20:00:56 +0000 (UTC)
commit b5736540d569cc4007a0c406c6dce8b26c1bb637
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sat Jun 6 17:40:54 2020 -0400
Various: Stop using GtkBox child properties
Stop using GtkBox padding, fill and expand child properties
Apparently, when the child is a GtkScrolledWindow, we must use
container_add(…) instead of pack_start(…, FALSE, FALSE, 0).
* libbalsa/address.c (libbalsa_address_get_edit_widget):
* libbalsa/autocrypt.c (autocrypt_db_dialog_run):
* libbalsa/html.c (libbalsa_html_new):
ChangeLog | 8 ++++++++
libbalsa/address.c | 6 ++++--
libbalsa/autocrypt.c | 4 +++-
libbalsa/html.c | 5 ++++-
4 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 729d65539..0c540b324 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -600,6 +600,14 @@
* src/filter-run-dialog.c (balsa_filter_run_dialog_new): call
prepare-threading to get ready for filtering.
+2020-06-06 Peter Bloomfield <pbloomfield bellsouth net>
+
+ Various: Stop using GtkBox padding, fill and expand child properties
+
+ * libbalsa/address.c (libbalsa_address_get_edit_widget):
+ * libbalsa/autocrypt.c (autocrypt_db_dialog_run):
+ * libbalsa/html.c (libbalsa_html_new):
+
2020-06-06 Peter Bloomfield <pbloomfield bellsouth net>
balsa-message: Do not crash
diff --git a/libbalsa/address.c b/libbalsa/address.c
index aa8e533ba..95008f8ff 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -982,8 +982,10 @@ libbalsa_address_get_edit_widget(LibBalsaAddress *address,
GtkWidget *tree_view;
entries[cnt] = lba_addr_list_widget(changed_cb, changed_data);
- gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 1);
- gtk_box_pack_start(GTK_BOX(box), but, FALSE, FALSE, 1);
+ g_object_set(label, "margin", 1, NULL);
+ gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+ g_object_set(but, "margin", 1, NULL);
+ gtk_box_pack_start(GTK_BOX(box), but, FALSE, FALSE, 0);
lhs = box;
tree_view = gtk_bin_get_child(GTK_BIN(entries[cnt]));
g_signal_connect(but, "clicked", G_CALLBACK(add_row), tree_view);
diff --git a/libbalsa/autocrypt.c b/libbalsa/autocrypt.c
index 8fab2305e..7aa44450d 100644
--- a/libbalsa/autocrypt.c
+++ b/libbalsa/autocrypt.c
@@ -456,7 +456,9 @@ autocrypt_db_dialog_run(const gchar *date_string, GtkWindow *parent)
gtk_container_set_border_width(GTK_CONTAINER(scrolled_window), 12U);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
+ gtk_widget_set_vexpand(scrolled_window, TRUE);
+ gtk_widget_set_valign(scrolled_window, GTK_ALIGN_FILL);
+ gtk_container_add(GTK_CONTAINER(vbox), scrolled_window);
model = gtk_list_store_new(AC_DB_VIEW_COLUMNS, G_TYPE_STRING, /* address */
G_TYPE_INT64,
/* last seen timestamp value (for sorting) */
diff --git a/libbalsa/html.c b/libbalsa/html.c
index 3458e250f..2efb95bdd 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -781,7 +781,6 @@ libbalsa_html_new(LibBalsaMessageBody * body,
G_CALLBACK(lbh_context_menu_cb), info);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_end(GTK_BOX(vbox), GTK_WIDGET(info->web_view), TRUE, TRUE, 0);
/* Simple check for possible resource requests: */
if (have_src_oth) {
@@ -790,6 +789,10 @@ libbalsa_html_new(LibBalsaMessageBody * body,
g_debug("%s shows info_bar", __func__);
}
+ gtk_widget_set_vexpand(GTK_WIDGET(info->web_view), TRUE);
+ gtk_widget_set_valign(GTK_WIDGET(info->web_view), GTK_ALIGN_FILL);
+ gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(info->web_view), FALSE, FALSE, 0);
+
webkit_web_view_load_html(info->web_view, text, NULL);
g_free(text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]