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



commit 1f2495a8c461e2986ee548d99683cf009f39a43a
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             |   22 +++++++++++++---------
 plugins/external-editor/external-editor.c |    6 ++++--
 3 files changed, 20 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 6bc782f..6d30a20 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -237,17 +237,18 @@ 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);
 
-       container = widget;
-
-       /* Construct the main menu and toolbar. */
-
-       widget = e_editor_get_managed_widget (editor, "/main-menu");
+       /* Construct the activity bar. */
+       widget = e_activity_bar_new ();
        gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
-       gtk_widget_show (widget);
+       priv->activity_bar = g_object_ref (widget);
+       /* EActivityBar controls its own visibility. */
 
-       widget = e_editor_get_managed_widget (editor, "/main-toolbar");
+       /* Construct the alert bar for errors. */
+       widget = e_alert_bar_new ();
        gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
        gtk_widget_show (widget);
 
@@ -255,7 +256,8 @@ 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_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);
 
@@ -310,11 +312,13 @@ e_composer_private_constructed (EMsgComposer *composer)
        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]