[evolution/wip/webkit-composer: 280/966] Fix runtime warnings and widget layouting



commit 4f79ea63468ece99991cce15d9d24b3b3e3159fa
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             |   20 +++++++++++---------
 plugins/external-editor/external-editor.c |    6 ++++--
 3 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c
index 2f8d6df..09b3e12 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -513,17 +513,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 cbe4edf..3551194 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -242,17 +242,17 @@ 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_sink (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_sink (widget);
@@ -262,9 +262,9 @@ e_composer_private_constructed (EMsgComposer *composer)
 
        widget = e_composer_header_table_new (client_cache);
        gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
-       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
-       gtk_box_reorder_child (GTK_BOX (container), widget, 2);
-       priv->header_table = g_object_ref_sink (widget);
+       gtk_widget_set_hexpand (widget, TRUE);
+       gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+       priv->header_table = g_object_ref (widget);
        gtk_widget_show (widget);
 
        g_signal_connect_swapped (
@@ -315,14 +315,16 @@ e_composer_private_constructed (EMsgComposer *composer)
        priv->gallery_icon_view = g_object_ref_sink (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 7ee8f9b..ed5b0ae 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -151,17 +151,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]