[evolution/wip/webkit-composer: 682/966] EMsgComposer: Subclass GtkWindow instead of EEditorWindow.



commit b0758bc871c1bb276f1172e159458bef8343610c
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Feb 8 15:42:42 2013 -0500

    EMsgComposer: Subclass GtkWindow instead of EEditorWindow.

 composer/e-composer-private.c |   52 ++++++++++++++++++++++++++++++++--------
 composer/e-msg-composer.c     |    4 +-
 composer/e-msg-composer.h     |    4 +-
 3 files changed, 45 insertions(+), 15 deletions(-)
---
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 136a41e..24e05e9 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -172,17 +172,27 @@ e_composer_private_constructed (EMsgComposer *composer)
 
        priv->focus_tracker = focus_tracker;
 
-       container = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-       gtk_widget_set_vexpand (container, FALSE);
-       gtk_widget_show (container);
-       e_editor_window_pack_above (E_EDITOR_WINDOW (composer), container);
+       widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+       gtk_container_add (GTK_CONTAINER (composer), widget);
+       gtk_widget_show (widget);
+
+       container = widget;
+
+       /* Construct the main menu and toolbar. */
+
+       widget = e_editor_get_managed_widget (editor, "/main-menu");
+       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+       gtk_widget_show (widget);
+
+       widget = e_editor_get_managed_widget (editor, "/main-toolbar");
+       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+       gtk_widget_show (widget);
 
        /* Construct the header table. */
 
        widget = e_composer_header_table_new (client_cache);
        gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
-       gtk_widget_set_hexpand (widget, TRUE);
-       gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
        priv->header_table = g_object_ref (widget);
        gtk_widget_show (widget);
 
@@ -191,9 +201,6 @@ e_composer_private_constructed (EMsgComposer *composer)
                widget, "sensitive",
                G_BINDING_SYNC_CREATE);
 
-       priv->header_table = g_object_ref (widget);
-       gtk_widget_show (widget);
-
        header = e_composer_header_table_get_header (
                E_COMPOSER_HEADER_TABLE (widget),
                E_COMPOSER_HEADER_SUBJECT);
@@ -202,6 +209,13 @@ e_composer_private_constructed (EMsgComposer *composer)
                header->input_widget, "spell-checker",
                G_BINDING_SYNC_CREATE);
 
+       /* Construct the editing toolbars.  We'll have to reparent
+        * the embedded EEditorWidget a little further down. */
+
+       widget = GTK_WIDGET (editor);
+       gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+       gtk_widget_show (widget);
+
        /* Construct the attachment paned. */
 
        widget = e_attachment_paned_new ();
@@ -214,6 +228,15 @@ e_composer_private_constructed (EMsgComposer *composer)
                widget, "sensitive",
                G_BINDING_SYNC_CREATE);
 
+       container = e_attachment_paned_get_content_area (
+               E_ATTACHMENT_PANED (priv->attachment_paned));
+
+       widget = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
+       gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+       gtk_widget_show (widget);
+
+       container = widget;
+
        widget = gtk_scrolled_window_new (NULL, NULL);
        gtk_scrolled_window_set_policy (
                GTK_SCROLLED_WINDOW (widget),
@@ -221,9 +244,16 @@ e_composer_private_constructed (EMsgComposer *composer)
        gtk_scrolled_window_set_shadow_type (
                GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
        gtk_widget_set_size_request (widget, -1, GALLERY_INITIAL_HEIGHT);
+       gtk_paned_pack1 (GTK_PANED (container), widget, FALSE, FALSE);
        priv->gallery_scrolled_window = g_object_ref (widget);
-       container = priv->gallery_scrolled_window;
-       e_editor_window_pack_inside (E_EDITOR_WINDOW (composer), container);
+       gtk_widget_show (widget);
+
+       /* Reparent the scrolled window containing the web view
+        * widget into the content area of the top attachment pane. */
+
+       widget = GTK_WIDGET (editor_widget);
+       widget = gtk_widget_get_parent (widget);
+       gtk_widget_reparent (widget, container);
 
        /* Construct the picture gallery. */
 
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index fba456b..b0a857b 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -153,7 +153,7 @@ static void handle_multipart_signed         (EMsgComposer *composer,
 G_DEFINE_TYPE_WITH_CODE (
        EMsgComposer,
        e_msg_composer,
-       E_TYPE_EDITOR_WINDOW,
+       GTK_TYPE_WINDOW,
        G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
 
 static void
@@ -2578,7 +2578,7 @@ e_msg_composer_get_editor (EMsgComposer *composer)
 {
        g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
 
-       return e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+       return composer->priv->editor;
 }
 
 EFocusTracker *
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 4e3e189..6776b2b 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -56,12 +56,12 @@ typedef struct _EMsgComposerClass EMsgComposerClass;
 typedef struct _EMsgComposerPrivate EMsgComposerPrivate;
 
 struct _EMsgComposer {
-       EEditorWindow parent;
+       GtkWindow parent;
        EMsgComposerPrivate *priv;
 };
 
 struct _EMsgComposerClass {
-       EEditorWindowClass parent_class;
+       GtkWindowClass parent_class;
 
        /* Signals */
        gboolean        (*presend)              (EMsgComposer *composer);


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