[evolution-patches] [PATCH 06/22] Fix height of widgets in a better way. (cherry picked from commit 99348cfe1347fcdfab54cf0b45e725f0bdde59ff)



From: Srinivasa Ragavan <sragavan gnome org>


Signed-off-by: Yan Li <yanli infradead org>
---
 src/em-webkit-stream.c  |   12 +++++++++++-
 src/mail-message-view.c |    3 ---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/em-webkit-stream.c b/src/em-webkit-stream.c
index fda8b5e..db19b6f 100644
--- a/src/em-webkit-stream.c
+++ b/src/em-webkit-stream.c
@@ -118,11 +118,21 @@ emws_sync_flush(CamelStream *stream)
 static int
 emws_sync_close(CamelStream *stream)
 {
-#if HAVE_WEBKIT_PATCHED	
 	EMWebKitStream *emws = (EMWebKitStream *)stream;
 
+#if HAVE_WEBKIT_PATCHED	
+
 	if (emws->view && WEBKIT_IS_WEB_VIEW (emws->view)&&webkit_web_frame_get_height(webkit_web_view_get_main_frame(emws->view)))
 		gtk_widget_set_size_request ((GtkWidget *)emws->view, -1, webkit_web_frame_get_height(webkit_web_view_get_main_frame(emws->view)));
+#else
+	if (emws->view && WEBKIT_IS_WEB_VIEW (emws->view)) {
+		GtkRequisition req;
+
+		gtk_widget_size_request ((GtkWidget *)emws->view, &req);
+
+		gtk_widget_set_size_request ((GtkWidget *)emws->view, -1, req.height+10);
+	}
+
 #endif	
 	return 0;
 }
diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index 1ef7d76..da75364 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -688,9 +688,6 @@ mmv_finished_loading_webkit (WebKitWebView  *webkitwebview, WebKitWebFrame *arg1
 #if HAVE_WEBKIT_PATCHED	 
 	gtk_widget_set_size_request ((GtkWidget *)webkitwebview, -1, webkit_web_frame_get_height(arg1));
 #endif	 
-	gtk_widget_size_request ((GtkWidget *)webkitwebview, &req);
-	if (req.height > 200) /* Wierd reason, but webkit resizes if we set a smaller size, before the content is loaded.*/
-        	gtk_widget_set_size_request ((GtkWidget *)webkitwebview, req.width, req.height+10);
 	/* Connect on expose, and mark mail as read on expose, when the mail is actually seen */
 	g_signal_connect (webkitwebview, "expose-event" , G_CALLBACK(mark_mail_read), mmview);
 	g_signal_emit (mmview, signals[MESSAGE_LOADED], 0);
-- 
1.6.5.7



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