[evolution/webkit] Embed EWebViews in EMailDisplay into their own GtkScrolledWindows.



commit 164107ee8d0f286e363ec91a62497c7127a05ae3
Author: Dan VrÃtil <dvratil redhat com>
Date:   Wed Sep 14 12:28:21 2011 +0200

    Embed EWebViews in EMailDisplay into their own GtkScrolledWindows.
    
    This allows EWebViews to be shrunked (otherwise they can be only
    enlarged).
    
    This is still buggy, the webviews are too small and don't expand their
    height to height of their content despite the fact that scrolling of
    webviews is explicitly disabled.

 mail/e-mail-display.c    |    6 +++---
 mail/e-mail-display.h    |    7 ++-----
 mail/e-mail-paned-view.c |   14 +++++++++++---
 3 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index a4dc7fd..47df733 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -457,7 +457,6 @@ mail_display_insert_web_view (EMailDisplay *display,
 			      EWebView *web_view,
 			      gboolean expandable)
 {
-#if 0
 	GtkWidget *scrolled_window;
 
 	display->priv->webviews = g_list_append (display->priv->webviews, web_view);
@@ -472,10 +471,11 @@ mail_display_insert_web_view (EMailDisplay *display,
 
 	gtk_box_pack_start (GTK_BOX (display->priv->vbox), scrolled_window, expandable, TRUE, 0);
 	gtk_widget_show_all (scrolled_window);
-#endif
 
+#if 0
 	gtk_box_pack_start (GTK_BOX (display->priv->vbox), GTK_WIDGET (web_view), expandable, TRUE, 0);
 	gtk_widget_show_all (GTK_WIDGET (web_view));
+#endif
 }
 
 static void
@@ -568,7 +568,7 @@ e_mail_display_get_type (void)
 		};
 
 		type = g_type_register_static (
-			GTK_TYPE_SCROLLED_WINDOW, "EMailDisplay", &type_info, 0);
+			GTK_TYPE_VIEWPORT, "EMailDisplay", &type_info, 0);
 	}
 
 	return type;
diff --git a/mail/e-mail-display.h b/mail/e-mail-display.h
index d81dd1b..5efb975 100644
--- a/mail/e-mail-display.h
+++ b/mail/e-mail-display.h
@@ -58,15 +58,12 @@ typedef enum {
 } EMailDisplayMode;
 
 struct _EMailDisplay {
-	GtkScrolledWindow parent;
+	GtkViewport parent;
 	EMailDisplayPrivate *priv;
-
-	GtkWidget *headers;	/* EWebView */
-	GList *widgets;
 };
 
 struct _EMailDisplayClass {
-	GtkScrolledWindowClass parent_class;
+	GtkViewportClass parent_class;
 
 	/* TODO WEBKIT: popup-event signal */
 	/* TODO WEBKIT: status-message signal */
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index b802a19..11cd55b 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -55,6 +55,7 @@ struct _EMailPanedViewPrivate {
 	GtkWidget *message_list;
 	GtkWidget *search_bar;
 
+	GtkWidget *display_scrolled_window;
 	EMailDisplay *display;
 	GalViewInstance *view_instance;
 
@@ -614,6 +615,15 @@ mail_paned_view_constructed (GObject *object)
 	priv = E_MAIL_PANED_VIEW (object)->priv;
 
 	priv->display = g_object_new (E_TYPE_MAIL_DISPLAY, NULL);
+	widget = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
+		GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+	gtk_scrolled_window_set_shadow_type (
+		GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_NONE);
+	gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (priv->display));
+	priv->display_scrolled_window = widget;
+	gtk_widget_show (GTK_WIDGET (priv->display));
+
 
 	view = E_MAIL_VIEW (object);
 	shell_view = e_mail_view_get_shell_view (view);
@@ -664,9 +674,7 @@ mail_paned_view_constructed (GObject *object)
 
 	container = priv->paned;
 
-	gtk_widget_show (GTK_WIDGET (priv->display));
-
-	widget = GTK_WIDGET (priv->display);
+	widget = GTK_WIDGET (priv->display_scrolled_window);
 	gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE);
 	gtk_widget_show (widget);
 



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