[evolution/webkit-composer: 74/130] Fix runtime warnings and widget layouting



commit 06a06500e934b3b76ad3af1e3dd042d47a6bc417
Author: Dan VrÃtil <dvratil redhat com>
Date:   Wed Aug 29 15:43:41 2012 +0200

    Fix runtime warnings and widget layouting

 composer/e-composer-actions.c             |    6 +++---
 composer/e-composer-private.c             |   19 ++++++++++---------
 plugins/external-editor/external-editor.c |    6 ++++--
 3 files changed, 17 insertions(+), 14 deletions(-)
---
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c
index 55f859c..df2ebb4 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -532,17 +532,17 @@ e_composer_actions_init (EMsgComposer *composer)
 	/* FIXME WEBKIT Make sure this works */
 	g_object_bind_property (
 		editor_widget, "editable",
-		e_editor_get_action (editor, "edit"), "sensitive",
+		e_editor_get_action (editor, "edit-menu"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 	g_object_bind_property (
 		editor_widget, "editable",
-		e_editor_get_action (editor, "format"), "sensitive",
+		e_editor_get_action (editor, "format-menu"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 	g_object_bind_property (
 		editor_widget, "editable",
-		e_editor_get_action (editor, "insert"), "sensitive",
+		e_editor_get_action (editor, "insert-menu"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 #if defined (HAVE_NSS)
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 5f9371e..3b512dc 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -262,28 +262,27 @@ e_composer_private_constructed (EMsgComposer *composer)
 	priv->focus_tracker = focus_tracker;
 
 	container = gtk_hbox_new (FALSE, 0);
+	gtk_widget_set_hexpand (container, TRUE);
+	gtk_widget_show (container);
 	e_editor_window_pack_above (E_EDITOR_WINDOW (composer), container);
 
 	/* Construct the activity bar. */
-
 	widget = e_activity_bar_new ();
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	priv->activity_bar = g_object_ref (widget);
 	/* EActivityBar controls its own visibility. */
 
 	/* Construct the alert bar for errors. */
-
 	widget = e_alert_bar_new ();
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	priv->alert_bar = g_object_ref (widget);
 	/* EAlertBar controls its own visibility. */
 
 	/* Construct the header table. */
-
 	widget = e_composer_header_table_new (shell, registry);
 	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
-	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
-	e_editor_window_pack_above (E_EDITOR_WINDOW (composer), widget);
+	gtk_widget_set_hexpand (widget, TRUE);
+	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
 	/* FIXME WEBKIT
 	if (small_screen_mode)
 		gtk_box_reorder_child (GTK_BOX (container), widget, 1);
@@ -408,14 +407,16 @@ e_composer_private_constructed (EMsgComposer *composer)
 	priv->gallery_icon_view = g_object_ref (widget);
 	g_free (gallery_path);
 
-	g_signal_connect (
-		composer, "notify::html-mode",
-		G_CALLBACK (composer_update_gallery_visibility), NULL);
-
+	g_signal_connect_swapped (
+		editor_widget, "notify::mode",
+		G_CALLBACK (composer_update_gallery_visibility), composer);
 	g_signal_connect_swapped (
 		ACTION (PICTURE_GALLERY), "toggled",
 		G_CALLBACK (composer_update_gallery_visibility), composer);
 
+	/* Initial sync */
+	composer_update_gallery_visibility (composer);
+
 	/* XXX What is this for? */
 	/* FIXME WEBKIT Yes, what is this for?
 	g_object_set_data (G_OBJECT (composer), "vbox", editor->vbox);
diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c
index dd95134..f5ce1e3 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -150,17 +150,19 @@ enable_disable_composer (EMsgComposer *composer,
                          gboolean enable)
 {
 	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GtkAction *action;
 	GtkActionGroup *action_group;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
 	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
 
 	if (enable) {
-		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor), TRUE);
+		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), TRUE);
 	} else {
-		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor), FALSE);
+		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), FALSE);
 	}
 
 	action = E_EDITOR_ACTION_EDIT_MENU (editor);



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