[geary/wip/728002-webkit2] Remove composer's scrolled window since WebView now scrolls internally.



commit 63b278e67aecf37307479fac0782a930be30ebb8
Author: Michael James Gratton <mike vee net>
Date:   Thu Jan 26 22:03:29 2017 +1100

    Remove composer's scrolled window since WebView now scrolls internally.
    
    We can't easily wrap ComposerWebView in a GtkScrolledWindow, since we
    don't any notifications that the cursor has moved offscreen and hence the
    view needs to be scrolled, so let the view do its own scrolling.
    
    * ui/composer-widget.ui: Replace editor_scrolled with editor_container,
      update uses.

 src/client/composer/composer-embed.vala  |    4 ----
 src/client/composer/composer-widget.vala |   14 +++++++++-----
 ui/composer-widget.ui                    |    6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/client/composer/composer-embed.vala b/src/client/composer/composer-embed.vala
index c16f99a..4294ca6 100644
--- a/src/client/composer/composer-embed.vala
+++ b/src/client/composer/composer-embed.vala
@@ -63,12 +63,9 @@ public class ComposerEmbed : Gtk.EventBox, ComposerContainer {
     private void on_realize() {
         update_style();
 
-        this.composer.editor_scrolled.get_vscrollbar().hide();
-
         //this.composer.editor.vadjustment.value_changed.connect(on_inner_scroll);
         //this.composer.editor.vadjustment.changed.connect(on_adjust_changed);
         //this.composer.editor.user_changed_contents.connect(on_inner_size_changed);
-
         reroute_scroll_handling(this);
     }
 
@@ -116,7 +113,6 @@ public class ComposerEmbed : Gtk.EventBox, ComposerContainer {
         //this.composer.editor.user_changed_contents.disconnect(on_inner_size_changed);
 
         disable_scroll_reroute(this);
-        this.composer.editor_scrolled.get_vscrollbar().show();
 
         remove(this.composer);
         close_container();
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 826d316..215fc07 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -245,15 +245,16 @@ public class ComposerWidget : Gtk.EventBox {
 
     public Configuration config { get; set; }
 
-    [GtkChild]
-    internal Gtk.ScrolledWindow editor_scrolled;
-
     private ContactListStore? contact_list_store = null;
 
     private string body_html = "";
 
     [GtkChild]
     private Gtk.Box composer_container;
+
+    [GtkChild]
+    internal Gtk.Grid editor_container;
+
     [GtkChild]
     private Gtk.Label from_label;
     [GtkChild]
@@ -435,6 +436,11 @@ public class ComposerWidget : Gtk.EventBox {
         this.to_entry.margin_top = this.cc_entry.margin_top = this.bcc_entry.margin_top = 
this.reply_to_entry.margin_top = 6;
 
         this.editor = new ComposerWebView(config);
+        this.editor.set_hexpand(true);
+        this.editor.set_vexpand(true);
+        this.editor.show();
+
+        this.editor_container.add(this.editor);
 
         // Initialize menus
         Gtk.Builder builder = new Gtk.Builder.from_resource(
@@ -499,8 +505,6 @@ public class ComposerWidget : Gtk.EventBox {
         this.editor.mouse_target_changed.connect(on_mouse_target_changed);
         this.editor.selection_changed.connect((has_selection) => { update_cursor_actions(); });
 
-        this.editor_scrolled.add(editor);
-
         // Place the message area before the compose toolbar in the focus chain, so that
         // the user can tab directly from the Subject: field to the message area.
         // TODO: after bumping the min. GTK+ version to 3.16, we can/should do this in the UI file.
diff --git a/ui/composer-widget.ui b/ui/composer-widget.ui
index ad5b0d6..0167f3c 100644
--- a/ui/composer-widget.ui
+++ b/ui/composer-widget.ui
@@ -714,10 +714,10 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
-                      <object class="GtkScrolledWindow" id="editor_scrolled">
+                      <object class="GtkGrid" id="editor_container">
+                        <property name="height_request">250</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="min_content_height">200</property>
+                        <property name="can_focus">False</property>
                         <child>
                           <placeholder/>
                         </child>


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