[balsa] More efforts to get HTML parts to fill the pane



commit 509a298991ebc1c5153a0398fd785323c7a51e6d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Oct 13 14:33:55 2019 -0400

    More efforts to get HTML parts to fill the pane
    
    * libbalsa/html.c (lbh_web_view_new): connect to "load-changed" signal;
      (lbh_load_changed_cb): call-back for it; if the load has finished,
      call gtk_widget_queue_resize();
    * src/balsa-message.c (add_part): pack the widget with expand=FALSE,
      so that an HTML part's v-expand takes precedence.

 ChangeLog           | 11 +++++++++++
 libbalsa/html.c     | 10 ++++++++++
 src/balsa-message.c |  2 +-
 3 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5937d6151..1c13651d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-10-13  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       More efforts to get HTML parts to fill the pane
+
+       * libbalsa/html.c (lbh_web_view_new): connect to "load-changed"
+       signal;
+       (lbh_load_changed_cb): call-back for it; if the load has
+       finished, call gtk_widget_queue_resize();
+       * src/balsa-message.c (add_part): pack the widget with
+       expand=FALSE, so that an HTML part's v-expand takes precedence.
+
 2019-10-13  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Do not use archaic 200px default height; now that we set
diff --git a/libbalsa/html.c b/libbalsa/html.c
index 656d8fa7e..3d9f5dc14 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -491,6 +491,15 @@ lbh_resource_load_started_cb(WebKitWebView     * web_view,
                      G_CALLBACK(lbh_resource_notify_response_cb), data);
 }
 
+static void
+lbh_load_changed_cb(WebKitWebView  *web_view,
+                    WebKitLoadEvent load_event,
+                    gpointer        user_data)
+{
+    if (load_event == WEBKIT_LOAD_FINISHED)
+        gtk_widget_queue_resize(GTK_WIDGET(web_view));
+}
+
 #if WEBKIT_CHECK_VERSION(2,20,0)
 /*
  * Callback for the "web-process-terminated" signal
@@ -635,6 +644,7 @@ lbh_web_view_new(LibBalsaWebKitInfo *info,
 #endif
     g_signal_connect(view, "decide-policy", G_CALLBACK(lbh_decide_policy_cb), info);
     g_signal_connect(view, "resource-load-started", G_CALLBACK(lbh_resource_load_started_cb), info);
+    g_signal_connect(view, "load-changed", G_CALLBACK(lbh_load_changed_cb), info);
 
        return view;
 }
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 295b07e2e..0790be0ac 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -2211,7 +2211,7 @@ 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), TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(container), GTK_WIDGET(info->mime_widget), FALSE, TRUE, 0);
 
     info_container = balsa_mime_widget_get_container(info->mime_widget);
     body = add_multipart(balsa_message, info->body,


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