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



commit 323f1a05055af0aaec19075fcab90ffc5c58ec35
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 b71446b..a26913f 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -462,7 +462,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);
@@ -477,10 +476,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
@@ -572,7 +572,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 8ddcc99..134dae5 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -59,6 +59,7 @@ struct _EMailPanedViewPrivate {
 	GtkWidget *preview_pane;
 	GtkWidget *search_bar;
 
+	GtkWidget *display_scrolled_window;
 	EMailDisplay *display;
 	GalViewInstance *view_instance;
 
@@ -628,6 +629,15 @@ mail_paned_view_constructed (GObject *object)
 	priv = E_MAIL_PANED_VIEW_GET_PRIVATE (object);
 
 	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);
@@ -682,9 +692,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);
 	priv->preview_pane = g_object_ref (widget);
 	gtk_widget_show (widget);



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