[evolution/webkit: 83/171] Enable collapsable headers in paned view



commit db31cfe5e5eff0fa3d69c5e850cf6d78612d2598
Author: Dan VrÃtil <dvratil redhat com>
Date:   Thu Dec 15 17:12:49 2011 +0100

    Enable collapsable headers in paned view
    
    Fix handling of the 'headers-collapsed' event in EMailDisplay and
    bind it correctly to a gconf value

 mail/e-mail-display.c    |    4 ++--
 mail/e-mail-paned-view.c |   20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 6353f1e..07bf0c8 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -521,7 +521,7 @@ mail_display_headers_collapsed_state_changed (EWebView *web_view,
 	EMailDisplay *display = user_data;
 	JSGlobalContextRef ctx = e_web_view_get_global_context (web_view);
 
-	display->priv->headers_collapsed = JSValueToBoolean (ctx, args[0]);
+	e_mail_display_set_headers_collapsed (display, JSValueToBoolean (ctx, args[0]));
 }
 
 static void
@@ -877,7 +877,7 @@ mail_display_class_init (EMailDisplayClass *class)
 		object_class,
 		PROP_HEADERS_COLLAPSED,
 		g_param_spec_boolean (
-			"header-collapsed",
+			"headers-collapsed",
 			"Headers Collapsed",
 			NULL,
 			FALSE,
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 8a64b38..f132156 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -617,6 +617,8 @@ mail_paned_view_constructed (GObject *object)
 	EShellBackend *shell_backend;
 	EShellWindow *shell_window;
 	EShellView *shell_view;
+	EShell *shell;
+	EShellSettings *shell_settings;
 	ESearchBar *search_bar;
 	EMailReader *reader;
 	EMailBackend *backend;
@@ -628,7 +630,9 @@ mail_paned_view_constructed (GObject *object)
 
 	priv = E_MAIL_PANED_VIEW_GET_PRIVATE (object);
 
-	priv->display = g_object_new (E_TYPE_MAIL_DISPLAY, NULL);
+	priv->display = g_object_new (E_TYPE_MAIL_DISPLAY,
+		"headers-collapsable", TRUE, NULL);
+
 	widget = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
 		GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
@@ -643,19 +647,15 @@ mail_paned_view_constructed (GObject *object)
 	shell_view = e_mail_view_get_shell_view (view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	shell_backend = e_shell_view_get_shell_backend (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+	shell_settings = e_shell_get_shell_settings (shell);
 
 	backend = E_MAIL_BACKEND (shell_backend);
 	session = e_mail_backend_get_session (backend);
 
-	/* Make headers collapsable and store state of headers in config file */
-	/* FIXME WEBKIT */
-	/*em_format_html_set_headers_collapsable (EM_FORMAT_HTML (priv->formatter), TRUE);
-	g_object_bind_property (
-		shell_settings, "paned-view-headers-state",
-		priv->formatter, "headers-state",
-		G_BINDING_BIDIRECTIONAL |
-		G_BINDING_SYNC_CREATE);
-	*/
+	g_object_bind_property (shell_settings, "paned-view-headers-state",
+				priv->display, "headers-collapsed",
+				G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
 
 	/* Build content widgets. */
 



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