[geary/wip/714104-refine-account-dialog] Implement decent keyboard nav for AccountsEditor and editor panes



commit 319c178c10f965bb5b8056b9e28dbe5e2036e5af
Author: Michael Gratton <mike vee net>
Date:   Thu Sep 6 20:05:42 2018 +1000

    Implement decent keyboard nav for AccountsEditor and editor panes
    
    Return to previous panes using escape/back/(left|right), navigate
    between settings list items using up/down.
    
    Implementation courtesy
    https://blogs.gnome.org/mclasen/2014/02/27/getting-the-details-right/

 src/client/accounts/accounts-editor-add-pane.vala  |  50 +++++++
 src/client/accounts/accounts-editor-edit-pane.vala |  45 ++++++-
 src/client/accounts/accounts-editor-list-pane.vala |  24 ++++
 .../accounts/accounts-editor-servers-pane.vala     |  34 +++++
 src/client/accounts/accounts-editor.vala           |  25 ++++
 ui/accounts_editor_add_pane.ui                     |  19 ++-
 ui/accounts_editor_edit_pane.ui                    | 150 +++++++++++----------
 ui/accounts_editor_list_pane.ui                    |  31 +++--
 ui/accounts_editor_remove_pane.ui                  |   7 +-
 ui/accounts_editor_servers_pane.ui                 | 122 +++++++++--------
 ui/geary.css                                       |   4 +-
 11 files changed, 363 insertions(+), 148 deletions(-)
---
diff --git a/src/client/accounts/accounts-editor-add-pane.vala 
b/src/client/accounts/accounts-editor-add-pane.vala
index 3e746be0..4b4c72f3 100644
--- a/src/client/accounts/accounts-editor-add-pane.vala
+++ b/src/client/accounts/accounts-editor-add-pane.vala
@@ -26,6 +26,12 @@ internal class Accounts.EditorAddPane : Gtk.Grid, EditorPane {
     [GtkChild]
     private Gtk.Overlay osd_overlay;
 
+    [GtkChild]
+    private Gtk.Grid pane_content;
+
+    [GtkChild]
+    private Gtk.Adjustment pane_adjustment;
+
     [GtkChild]
     private Gtk.ListBox details_list;
 
@@ -66,6 +72,8 @@ internal class Accounts.EditorAddPane : Gtk.Grid, EditorPane {
         this.accounts = application.controller.account_manager;
         this.engine = application.engine;
 
+        this.pane_content.set_focus_vadjustment(this.pane_adjustment);
+
         this.details_list.set_header_func(Editor.seperator_headers);
         this.receiving_list.set_header_func(Editor.seperator_headers);
         this.sending_list.set_header_func(Editor.seperator_headers);
@@ -331,6 +339,32 @@ internal class Accounts.EditorAddPane : Gtk.Grid, EditorPane {
         this.editor.pop();
     }
 
+    [GtkCallback]
+    private bool on_list_keynav_failed(Gtk.Widget widget,
+                                       Gtk.DirectionType direction) {
+        bool ret = Gdk.EVENT_PROPAGATE;
+        Gtk.Container? next = null;
+        if (direction == Gtk.DirectionType.DOWN) {
+            if (widget == this.details_list) {
+                next = this.receiving_list;
+            } else if (widget == this.receiving_list) {
+                next = this.sending_list;
+            }
+        } else if (direction == Gtk.DirectionType.UP) {
+            if (widget == this.sending_list) {
+                next = this.receiving_list;
+            } else if (widget == this.receiving_list) {
+                next = this.details_list;
+            }
+        }
+
+        if (next != null) {
+            next.child_focus(direction);
+            ret = Gdk.EVENT_STOP;
+        }
+        return ret;
+    }
+
 }
 
 
@@ -359,6 +393,22 @@ private abstract class Accounts.EntryRow : AddPaneRow<Gtk.Entry> {
         this.value.width_chars = 32;
     }
 
+    public override bool focus(Gtk.DirectionType direction) {
+        bool ret = Gdk.EVENT_PROPAGATE;
+        switch (direction) {
+        case Gtk.DirectionType.TAB_FORWARD:
+        case Gtk.DirectionType.TAB_BACKWARD:
+            ret = this.value.child_focus(direction);
+            break;
+
+        default:
+            ret = base.focus(direction);
+            break;
+        }
+
+        return ret;
+    }
+
 }
 
 
diff --git a/src/client/accounts/accounts-editor-edit-pane.vala 
b/src/client/accounts/accounts-editor-edit-pane.vala
index 473ddd14..ee2fb119 100644
--- a/src/client/accounts/accounts-editor-edit-pane.vala
+++ b/src/client/accounts/accounts-editor-edit-pane.vala
@@ -24,6 +24,12 @@ internal class Accounts.EditorEditPane : Gtk.Grid, EditorPane, AccountPane {
     [GtkChild]
     private Gtk.HeaderBar header;
 
+    [GtkChild]
+    private Gtk.Grid pane_content;
+
+    [GtkChild]
+    private Gtk.Adjustment pane_adjustment;
+
     [GtkChild]
     private Gtk.ListBox details_list;
 
@@ -47,6 +53,8 @@ internal class Accounts.EditorEditPane : Gtk.Grid, EditorPane, AccountPane {
         this.editor = editor;
         this.account = account;
 
+        this.pane_content.set_focus_vadjustment(this.pane_adjustment);
+
         this.details_list.set_header_func(Editor.seperator_headers);
         this.details_list.add(new NicknameRow(account));
 
@@ -64,21 +72,14 @@ internal class Accounts.EditorEditPane : Gtk.Grid, EditorPane, AccountPane {
             this.signature_preview.events | Gdk.EventType.FOCUS_CHANGE
         );
         this.signature_preview.content_loaded.connect(() => {
-                debug("Signature loaded");
                 // Only enable editability after the content has fully
                 // loaded to avoid the WebProcess crashing.
                 this.signature_preview.set_editable.begin(true, null);
             });
         this.signature_preview.document_modified.connect(() => {
-                debug("Signature changed");
                 this.signature_changed = true;
             });
-        this.signature_preview.focus_in_event.connect(() => {
-                debug("Sig focus in");
-                return Gdk.EVENT_PROPAGATE;
-            });
         this.signature_preview.focus_out_event.connect(() => {
-                debug("Sig focus out");
                 // This event will also be fired if the top-level
                 // window loses focus, e.g. if the user alt-tabs away,
                 // so don't execute the command if the signature web
@@ -196,6 +197,36 @@ internal class Accounts.EditorEditPane : Gtk.Grid, EditorPane, AccountPane {
         this.editor.pop();
     }
 
+    [GtkCallback]
+    private bool on_list_keynav_failed(Gtk.Widget widget,
+                                       Gtk.DirectionType direction) {
+        bool ret = Gdk.EVENT_PROPAGATE;
+        Gtk.Container? next = null;
+        if (direction == Gtk.DirectionType.DOWN) {
+            if (widget == this.details_list) {
+                next = this.senders_list;
+            } else if (widget == this.senders_list) {
+                this.signature_preview.grab_focus();
+            } else if (widget == this.signature_preview) {
+                next = this.settings_list;
+            }
+        } else if (direction == Gtk.DirectionType.UP) {
+            if (widget == this.settings_list) {
+                this.signature_preview.grab_focus();
+            } else if (widget == this.signature_preview) {
+                next = this.senders_list;
+            } else if (widget == this.senders_list) {
+                next = this.details_list;
+            }
+        }
+
+        if (next != null) {
+            next.child_focus(direction);
+            ret = Gdk.EVENT_STOP;
+        }
+        return ret;
+    }
+
 }
 
 
diff --git a/src/client/accounts/accounts-editor-list-pane.vala 
b/src/client/accounts/accounts-editor-list-pane.vala
index 9136ebcf..f5798bde 100644
--- a/src/client/accounts/accounts-editor-list-pane.vala
+++ b/src/client/accounts/accounts-editor-list-pane.vala
@@ -40,6 +40,12 @@ internal class Accounts.EditorListPane : Gtk.Grid, EditorPane {
     [GtkChild]
     private Gtk.Overlay osd_overlay;
 
+    [GtkChild]
+    private Gtk.Grid pane_content;
+
+    [GtkChild]
+    private Gtk.Adjustment pane_adjustment;
+
     [GtkChild]
     private Gtk.Grid welcome_panel;
 
@@ -64,6 +70,8 @@ internal class Accounts.EditorListPane : Gtk.Grid, EditorPane {
         this.accounts =
             ((GearyApplication) editor.application).controller.account_manager;
 
+        this.pane_content.set_focus_vadjustment(this.pane_adjustment);
+
         this.accounts_list.set_header_func(Editor.seperator_headers);
         this.accounts_list.set_sort_func(ordinal_sort);
         foreach (Geary.AccountInformation account in this.accounts.iterable()) {
@@ -238,6 +246,22 @@ internal class Accounts.EditorListPane : Gtk.Grid, EditorPane {
         }
     }
 
+    [GtkCallback]
+    private bool on_list_keynav_failed(Gtk.Widget widget,
+                                       Gtk.DirectionType direction) {
+        bool ret = Gdk.EVENT_PROPAGATE;
+        if (direction == Gtk.DirectionType.DOWN &&
+            widget == this.accounts_list) {
+            this.service_list.child_focus(direction);
+            ret = Gdk.EVENT_STOP;
+        } else if (direction == Gtk.DirectionType.UP &&
+            widget == this.service_list) {
+            this.accounts_list.child_focus(direction);
+            ret = Gdk.EVENT_STOP;
+        }
+        return ret;
+    }
+
 }
 
 
diff --git a/src/client/accounts/accounts-editor-servers-pane.vala 
b/src/client/accounts/accounts-editor-servers-pane.vala
index 8ac599b6..43cd001d 100644
--- a/src/client/accounts/accounts-editor-servers-pane.vala
+++ b/src/client/accounts/accounts-editor-servers-pane.vala
@@ -20,6 +20,12 @@ internal class Accounts.EditorServersPane : Gtk.Grid, EditorPane, AccountPane {
     [GtkChild]
     private Gtk.HeaderBar header;
 
+    [GtkChild]
+    private Gtk.Grid pane_content;
+
+    [GtkChild]
+    private Gtk.Adjustment pane_adjustment;
+
     [GtkChild]
     private Gtk.ListBox details_list;
 
@@ -34,6 +40,8 @@ internal class Accounts.EditorServersPane : Gtk.Grid, EditorPane, AccountPane {
         this.editor = editor;
         this.account = account;
 
+        this.pane_content.set_focus_vadjustment(this.pane_adjustment);
+
         this.details_list.set_header_func(Editor.seperator_headers);
         this.details_list.add(
             new ServiceProviderRow<EditorServersPane>(
@@ -81,6 +89,32 @@ internal class Accounts.EditorServersPane : Gtk.Grid, EditorPane, AccountPane {
     private void on_apply_button_clicked() {
     }
 
+    [GtkCallback]
+    private bool on_list_keynav_failed(Gtk.Widget widget,
+                                       Gtk.DirectionType direction) {
+        bool ret = Gdk.EVENT_PROPAGATE;
+        Gtk.Container? next = null;
+        if (direction == Gtk.DirectionType.DOWN) {
+            if (widget == this.details_list) {
+                next = this.receiving_list;
+            } else if (widget == this.receiving_list) {
+                next = this.sending_list;
+            }
+        } else if (direction == Gtk.DirectionType.UP) {
+            if (widget == this.sending_list) {
+                next = this.receiving_list;
+            } else if (widget == this.receiving_list) {
+                next = this.details_list;
+            }
+        }
+
+        if (next != null) {
+            next.child_focus(direction);
+            ret = Gdk.EVENT_STOP;
+        }
+        return ret;
+    }
+
     private void on_account_changed() {
         update_header();
     }
diff --git a/src/client/accounts/accounts-editor.vala b/src/client/accounts/accounts-editor.vala
index 0079fa08..f69c116e 100644
--- a/src/client/accounts/accounts-editor.vala
+++ b/src/client/accounts/accounts-editor.vala
@@ -65,6 +65,31 @@ public class Accounts.Editor : Gtk.Dialog {
         push(this.editor_list_pane);
     }
 
+    public override bool key_press_event(Gdk.EventKey event) {
+        bool ret = Gdk.EVENT_PROPAGATE;
+
+        if (get_current_pane() != this.editor_list_pane) {
+            Gdk.ModifierType state = (
+                event.state & Gtk.accelerator_get_default_mod_mask()
+            );
+            bool is_ltr = (get_direction() == Gtk.TextDirection.LTR);
+            if (event.keyval == Gdk.Key.Escape ||
+                event.keyval == Gdk.Key.Back ||
+                (state == Gdk.ModifierType.MOD1_MASK &&
+                 (is_ltr && event.keyval == Gdk.Key.Left) ||
+                 (!is_ltr && event.keyval == Gdk.Key.Right))) {
+                pop();
+                ret = Gdk.EVENT_STOP;
+            }
+        }
+
+        if (ret != Gdk.EVENT_STOP) {
+            ret = base.key_press_event(event);
+        }
+
+        return ret;
+    }
+
     public override void destroy() {
         this.editor_panes.notify["visible-child"].disconnect(on_pane_changed);
         base.destroy();
diff --git a/ui/accounts_editor_add_pane.ui b/ui/accounts_editor_add_pane.ui
index fb381c9c..1b27d776 100644
--- a/ui/accounts_editor_add_pane.ui
+++ b/ui/accounts_editor_add_pane.ui
@@ -1,7 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.20"/>
+  <object class="GtkAdjustment" id="pane_adjustment">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <template class="AccountsEditorAddPane" parent="GtkGrid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -15,6 +20,8 @@
             <property name="can_focus">True</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
+            <property name="vadjustment">pane_adjustment</property>
+            <property name="hscrollbar_policy">never</property>
             <property name="shadow_type">in</property>
             <child>
               <object class="GtkViewport">
@@ -22,7 +29,7 @@
                 <property name="can_focus">False</property>
                 <property name="shadow_type">none</property>
                 <child>
-                  <object class="GtkGrid">
+                  <object class="GtkGrid" id="pane_content">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
@@ -36,6 +43,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="selection_mode">none</property>
+                            <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                           </object>
                         </child>
                       </object>
@@ -77,6 +85,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="selection_mode">none</property>
+                                <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                               </object>
                             </child>
                           </object>
@@ -124,6 +133,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="selection_mode">none</property>
+                                <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                               </object>
                             </child>
                           </object>
@@ -139,7 +149,7 @@
                       </packing>
                     </child>
                     <style>
-                      <class name="geary-account-view"/>
+                      <class name="geary-accounts-editor-pane-content"/>
                     </style>
                   </object>
                 </child>
@@ -156,6 +166,9 @@
         <property name="top_attach">0</property>
       </packing>
     </child>
+    <style>
+      <class name="geary-accounts-editor-pane"/>
+    </style>
   </template>
   <object class="GtkHeaderBar" id="header">
     <property name="visible">True</property>
diff --git a/ui/accounts_editor_edit_pane.ui b/ui/accounts_editor_edit_pane.ui
index 83a616eb..cd02476b 100644
--- a/ui/accounts_editor_edit_pane.ui
+++ b/ui/accounts_editor_edit_pane.ui
@@ -1,7 +1,76 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.20"/>
+  <object class="GtkHeaderBar" id="header">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="title">Edit Account</property>
+    <property name="subtitle">Account Name</property>
+    <property name="has_subtitle">False</property>
+    <property name="show_close_button">True</property>
+    <child>
+      <object class="GtkGrid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkButton" id="back_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <signal name="clicked" handler="on_back_button_clicked" swapped="no"/>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="icon_name">go-previous-symbolic</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkGrid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkButton" id="undo_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="action_name">win.undo</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="icon_name">edit-undo-symbolic</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkAdjustment" id="pane_adjustment">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <template class="AccountsEditorEditPane" parent="GtkGrid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -11,6 +80,7 @@
         <property name="can_focus">True</property>
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
+        <property name="vadjustment">pane_adjustment</property>
         <property name="hscrollbar_policy">never</property>
         <property name="min_content_height">400</property>
         <child>
@@ -18,7 +88,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkGrid" id="pane_content">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
@@ -33,6 +103,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="selection_mode">none</property>
+                        <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                         <signal name="row-activated" handler="on_setting_activated" swapped="no"/>
                       </object>
                     </child>
@@ -72,6 +143,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="selection_mode">none</property>
+                        <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                         <signal name="row-activated" handler="on_setting_activated" swapped="no"/>
                       </object>
                     </child>
@@ -148,6 +220,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="selection_mode">none</property>
+                        <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                         <signal name="row-activated" handler="on_setting_activated" swapped="no"/>
                       </object>
                     </child>
@@ -170,7 +243,7 @@
                         <property name="label" translatable="yes" comments="This is a button in the account 
settings to show server settings.">Server Settings</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="receives_default">False</property>
                         <signal name="clicked" handler="on_server_settings_clicked" swapped="no"/>
                       </object>
                       <packing>
@@ -185,7 +258,7 @@
                         <property name="label" translatable="yes" comments="This is the remove account 
button in the account settings.">Remove Account</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="receives_default">False</property>
                         <property name="tooltip_text" translatable="yes">Remove this account from 
Geary</property>
                         <signal name="clicked" handler="on_remove_account_clicked" swapped="no"/>
                         <style>
@@ -210,7 +283,7 @@
                   </packing>
                 </child>
                 <style>
-                  <class name="geary-account-view"/>
+                  <class name="geary-accounts-editor-pane-content"/>
                 </style>
               </object>
             </child>
@@ -222,69 +295,8 @@
         <property name="top_attach">0</property>
       </packing>
     </child>
+    <style>
+      <class name="geary-accounts-editor-pane"/>
+    </style>
   </template>
-  <object class="GtkHeaderBar" id="header">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="title">Edit Account</property>
-    <property name="subtitle">Account Name</property>
-    <property name="has_subtitle">False</property>
-    <property name="show_close_button">True</property>
-    <child>
-      <object class="GtkGrid">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <child>
-          <object class="GtkButton" id="back_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <signal name="clicked" handler="on_back_button_clicked" swapped="no"/>
-            <child>
-              <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="no_show_all">True</property>
-                <property name="icon_name">go-previous-symbolic</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <child>
-      <object class="GtkGrid">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <child>
-          <object class="GtkButton" id="undo_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="action_name">win.undo</property>
-            <child>
-              <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="no_show_all">True</property>
-                <property name="icon_name">edit-undo-symbolic</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-          </packing>
-        </child>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-        <property name="position">1</property>
-      </packing>
-    </child>
-  </object>
 </interface>
diff --git a/ui/accounts_editor_list_pane.ui b/ui/accounts_editor_list_pane.ui
index 96e9bbec..a85d978e 100644
--- a/ui/accounts_editor_list_pane.ui
+++ b/ui/accounts_editor_list_pane.ui
@@ -1,7 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.20"/>
+  <object class="GtkHeaderBar" id="header">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="title">Accounts</property>
+    <property name="has_subtitle">False</property>
+    <property name="show_close_button">True</property>
+  </object>
+  <object class="GtkAdjustment" id="pane_adjustment">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <template class="AccountsEditorListPane" parent="GtkGrid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -17,6 +29,7 @@
             <property name="can_focus">True</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
+            <property name="vadjustment">pane_adjustment</property>
             <property name="hscrollbar_policy">never</property>
             <property name="min_content_height">400</property>
             <child>
@@ -24,7 +37,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkGrid">
+                  <object class="GtkGrid" id="pane_content">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
@@ -98,6 +111,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="selection_mode">none</property>
+                            <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                             <signal name="row-activated" handler="on_row_activated" swapped="no"/>
                           </object>
                         </child>
@@ -144,6 +158,7 @@
                             <property name="can_focus">False</property>
                             <property name="valign">start</property>
                             <property name="selection_mode">none</property>
+                            <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                             <signal name="row-activated" handler="on_row_activated" swapped="no"/>
                           </object>
                         </child>
@@ -157,7 +172,7 @@
                       </packing>
                     </child>
                     <style>
-                      <class name="geary-account-view"/>
+                      <class name="geary-accounts-editor-pane-content"/>
                     </style>
                   </object>
                 </child>
@@ -174,12 +189,8 @@
         <property name="top_attach">0</property>
       </packing>
     </child>
+    <style>
+      <class name="geary-accounts-editor-pane"/>
+    </style>
   </template>
-  <object class="GtkHeaderBar" id="header">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="title">Accounts</property>
-    <property name="has_subtitle">False</property>
-    <property name="show_close_button">True</property>
-  </object>
 </interface>
diff --git a/ui/accounts_editor_remove_pane.ui b/ui/accounts_editor_remove_pane.ui
index e11dd170..05b4c916 100644
--- a/ui/accounts_editor_remove_pane.ui
+++ b/ui/accounts_editor_remove_pane.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.20"/>
   <template class="AccountsEditorRemovePane" parent="GtkGrid">
@@ -104,7 +104,7 @@
           </packing>
         </child>
         <style>
-          <class name="geary-account-view"/>
+          <class name="geary-accounts-editor-pane-content"/>
         </style>
       </object>
       <packing>
@@ -112,6 +112,9 @@
         <property name="top_attach">0</property>
       </packing>
     </child>
+    <style>
+      <class name="geary-accounts-editor-pane"/>
+    </style>
   </template>
   <object class="GtkHeaderBar" id="header">
     <property name="visible">True</property>
diff --git a/ui/accounts_editor_servers_pane.ui b/ui/accounts_editor_servers_pane.ui
index 8dfa598a..f2e5da9f 100644
--- a/ui/accounts_editor_servers_pane.ui
+++ b/ui/accounts_editor_servers_pane.ui
@@ -1,7 +1,64 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.20"/>
+  <object class="GtkHeaderBar" id="header">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="title">Server Settings</property>
+    <property name="subtitle">Account Name</property>
+    <property name="show_close_button">True</property>
+    <child>
+      <object class="GtkGrid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkButton" id="cancel_button">
+            <property name="label" translatable="yes">Cancel</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkGrid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkButton" id="apply_button">
+            <property name="label" translatable="yes">Apply</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
+            <style>
+              <class name="suggested-action"/>
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkAdjustment" id="pane_adjustment">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <template class="AccountsEditorServersPane" parent="GtkGrid">
     <property name="name">1</property>
     <property name="visible">True</property>
@@ -12,6 +69,7 @@
         <property name="can_focus">True</property>
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
+        <property name="vadjustment">pane_adjustment</property>
         <property name="hscrollbar_policy">never</property>
         <property name="min_content_height">400</property>
         <child>
@@ -19,7 +77,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkGrid" id="pane_content">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
@@ -34,6 +92,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="selection_mode">none</property>
+                        <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                       </object>
                     </child>
                     <child type="label_item">
@@ -72,6 +131,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="selection_mode">none</property>
+                        <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                       </object>
                     </child>
                     <child type="label_item">
@@ -110,6 +170,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="selection_mode">none</property>
+                        <signal name="keynav-failed" handler="on_list_keynav_failed" swapped="no"/>
                       </object>
                     </child>
                     <child type="label_item">
@@ -122,7 +183,7 @@
                   </packing>
                 </child>
                 <style>
-                  <class name="geary-account-view"/>
+                  <class name="geary-accounts-editor-pane-content"/>
                 </style>
               </object>
             </child>
@@ -134,57 +195,8 @@
         <property name="top_attach">0</property>
       </packing>
     </child>
+    <style>
+      <class name="geary-accounts-editor-pane"/>
+    </style>
   </template>
-  <object class="GtkHeaderBar" id="header">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="title">Server Settings</property>
-    <property name="subtitle">Account Name</property>
-    <property name="show_close_button">True</property>
-    <child>
-      <object class="GtkGrid">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <child>
-          <object class="GtkButton" id="cancel_button">
-            <property name="label" translatable="yes">Cancel</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <child>
-      <object class="GtkGrid">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <child>
-          <object class="GtkButton" id="apply_button">
-            <property name="label" translatable="yes">Apply</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
-            <style>
-              <class name="suggested-action"/>
-            </style>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-          </packing>
-        </child>
-      </object>
-      <packing>
-        <property name="pack_type">end</property>
-        <property name="position">1</property>
-      </packing>
-    </child>
-  </object>
 </interface>
diff --git a/ui/geary.css b/ui/geary.css
index d01150d3..9fee378e 100644
--- a/ui/geary.css
+++ b/ui/geary.css
@@ -183,8 +183,8 @@ grid.geary-message-summary {
 
 /* Accounts.Editor */
 
-grid.geary-account-view {
-  margin: 32px 128px;
+grid.geary-accounts-editor-pane-content {
+  padding: 32px 128px;
 }
 
 grid.geary-account-view image:dir(ltr) {



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