[gtk+/wip/matthiasc/help-overlay] Major changes



commit d99f2be837c3b4e6e3d062ec049cf54a370301c3
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 14 01:15:04 2015 -0400

    Major changes
    
    Drop the explicit page and column classes and markup, and create
    the necessary structures on the fly. Also drop the custom markup
    and just use standard GtkBuilder markup for everything.

 demos/gtk-demo/shortcuts.ui      |  877 +++++++++++++++++++++++++-------------
 gtk/Makefile.am                  |    4 -
 gtk/gtkshortcutscolumn.c         |   47 --
 gtk/gtkshortcutscolumnprivate.h  |   42 --
 gtk/gtkshortcutsgesture.c        |   86 +++-
 gtk/gtkshortcutsgroup.c          |   95 ++++-
 gtk/gtkshortcutspage.c           |   47 --
 gtk/gtkshortcutspageprivate.h    |   42 --
 gtk/gtkshortcutssection.c        |  104 ++++-
 gtk/gtkshortcutssectionprivate.h |    3 +
 gtk/gtkshortcutsshortcut.c       |   66 ++-
 gtk/gtkshortcutswindow.c         |  584 +++++---------------------
 12 files changed, 967 insertions(+), 1030 deletions(-)
---
diff --git a/demos/gtk-demo/shortcuts.ui b/demos/gtk-demo/shortcuts.ui
index b2cefac..cf41360 100644
--- a/demos/gtk-demo/shortcuts.ui
+++ b/demos/gtk-demo/shortcuts.ui
@@ -53,486 +53,759 @@
     <property name="transient-for">window1</property>
     <property name="modal">1</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
-    <sections>
-      <section name="editor">
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">editor</property>
         <property name="title" translatable="yes">Editor Shortcuts</property>
-        <page>
-          <column>
-            <group>
-              <property name="title" translatable="yes">General</property>
-              <shortcut>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">General</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Global Search</property>
                 <property name="accelerator">&lt;ctrl&gt;period</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Preferences</property>
                 <property name="accelerator">&lt;ctrl&gt;comma</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Command Bar</property>
                 <property name="accelerator">&lt;ctrl&gt;Return</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Terminal</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;t</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Keyboard Shortcuts</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;question</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Panels</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Panels</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Toggle left panel</property>
                 <property name="accelerator">F9</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Toggle right panel</property>
                 <property name="accelerator">&lt;shift&gt;F9</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Toggle bottom panel</property>
                 <property name="accelerator">&lt;ctrl&gt;F9</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Touchpad gestures</property>
-              <gesture>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Touchpad gestures</property>
+            <child>
+              <object class="GtkShortcutsGesture">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Switch to the next document</property>
                 <property name="subtitle" translatable="yes">Two finger swipe right</property>
-                <property name="gicon">right-swipe-icon</property>
-              </gesture>
-              <gesture>
+                <property name="icon">right-swipe-icon</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsGesture">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Switch to the previous document</property>
                 <property name="subtitle" translatable="yes">Two finger swipe left</property>
-                <property name="gicon">left-swipe-icon</property>
-              </gesture>
-            </group>
-          </column>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Files</property>
-              <shortcut>
+                <property name="icon">left-swipe-icon</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Files</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;n</property>
                 <property name="title" translatable="yes">Create new document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;o</property>
                 <property name="title" translatable="yes">Open a document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;s</property>
                 <property name="title" translatable="yes">Save the document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;w</property>
                 <property name="title" translatable="yes">Close the document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;alt&gt;Page_Down</property>
                 <property name="title" translatable="yes">Switch to the next document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;alt&gt;Page_Up</property>
                 <property name="title" translatable="yes">Switch to the previous document</property>
-              </shortcut>
-              <shortcut>
-                <property name="accelerator">&lt;ctrl&gt;k</property>
-                <property name="title" translatable="yes">Show list of open files</property>
-              </shortcut>
-              <shortcut>
-                <property name="accelerator">F4</property>
-                <property name="title" translatable="yes">Switch to source or header</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Find and replace</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Find and replace</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;f</property>
                 <property name="title" translatable="yes">Find</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;g</property>
                 <property name="title" translatable="yes">Find the next match</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;g</property>
                 <property name="title" translatable="yes">Find the previous match</property>
-              </shortcut>
-              <!-- not implemented
-              <shortcut>
-                <property name="accelerator">&lt;ctrl&gt;h</property>
-                <property name="title" translatable="yes">Find and replace</property>
-              </shortcut>
-              -->
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;k</property>
                 <property name="title" translatable="yes">Clear highlight</property>
-              </shortcut>
-              <!-- not implemented
-              <shortcut>
-                <property name="accelerator">&lt;ctrl&gt;l</property>
-                <property name="title" translatable="yes">Go to line</property>
-              </shortcut>
-              -->
-            </group>
-          </column>
-        </page>
-        <page>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Copy and Paste</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Copy and Paste</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;c</property>
                 <property name="title" translatable="yes">Copy selected text to clipboard</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;x</property>
                 <property name="title" translatable="yes">Cut selected text to clipboard</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;v</property>
                 <property name="title" translatable="yes">Paste text from clipboard</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Undo and Redo</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Undo and Redo</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;z</property>
                 <property name="title" translatable="yes">Undo previous command</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;z</property>
                 <property name="title" translatable="yes">Redo previous command</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Editing</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Editing</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;a</property>
                 <property name="title" translatable="yes">Increment number at cursor</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;x</property>
                 <property name="title" translatable="yes">Decrement number at cursor</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;j</property>
                 <property name="title" translatable="yes">Join selected lines</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;space</property>
                 <property name="title" translatable="yes">Show completion window</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">Insert</property>
                 <property name="title" translatable="yes">Toggle overwrite</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;alt&gt;i</property>
                 <property name="title" translatable="yes">Reindent line</property>
-              </shortcut>
-            </group>
-          </column>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Navigation</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Navigation</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;n</property>
                 <property name="title" translatable="yes">Move to next error in file</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;p</property>
                 <property name="title" translatable="yes">Move to previous error in file</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;shift&gt;&lt;alt&gt;Left</property>
                 <property name="title" translatable="yes">Move to previous edit location</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;shift&gt;&lt;alt&gt;Right</property>
                 <property name="title" translatable="yes">Move to next edit location</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;period</property>
                 <property name="title" translatable="yes">Jump to definition of symbol</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Up</property>
                 <property name="title" translatable="yes">Move sectionport up within the file</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Down</property>
                 <property name="title" translatable="yes">Move sectionport down within the file</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;End</property>
                 <property name="title" translatable="yes">Move sectionport to end of file</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Home</property>
                 <property name="title" translatable="yes">Move sectionport to beginning of file</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;percent</property>
                 <property name="title" translatable="yes">Move to matching bracket</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Selections</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Selections</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;a</property>
                 <property name="title" translatable="yes">Select all</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;backslash</property>
                 <property name="title" translatable="yes">Unselect all</property>
-              </shortcut>
-            </group>
-          </column>
-        </page>
-      </section>
-      <section name="terminal">
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">terminal</property>
         <property name="title" translatable="yes">Terminal Shortcuts</property>
-        <page>
-          <column>
-            <group>
-              <property name="title" translatable="yes">General</property>
-              <shortcut>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">General</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Global Search</property>
                 <property name="accelerator">&lt;ctrl&gt;period</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Preferences</property>
                 <property name="accelerator">&lt;ctrl&gt;comma</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Command Bar</property>
                 <property name="accelerator">&lt;ctrl&gt;Return</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Terminal</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;t</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Keyboard Shortcuts</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;question</property>
-              </shortcut>
-            </group>
-          </column>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Copy and Paste</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Copy and Paste</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;c</property>
                 <property name="title" translatable="yes">Copy selected text to clipboard</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;v</property>
                 <property name="title" translatable="yes">Paste text from clipboard</property>
-              </shortcut>
-            </group>
-          </column>
-        </page>
-      </section>
-    </sections>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
   </object>
 
   <object class="GtkShortcutsWindow" id="clocks-shortcuts">
     <property name="transient-for">window1</property>
     <property name="modal">1</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
-    <sections>
-      <section name="shortcuts">
-        <page>
-          <column>
-            <group>
-              <property name="title" translatable="yes">General</property>
-              <shortcut>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">General</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;Page_Down</property>
                 <property name="title" translatable="yes">Go to the next section</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;Page_Up</property>
                 <property name="title" translatable="yes">Go to the previous section</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;Q</property>
                 <property name="title" translatable="yes">Quit</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;alt&gt;Left</property>
                 <property name="title" translatable="yes">Forward</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;Right</property>
                 <property name="title" translatable="yes">Back</property>
-              </shortcut>
-            </group>
-            <group view="world">
-              <property name="title" translatable="yes">World Clocks</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="view">world</property>
+            <property name="title" translatable="yes">World Clocks</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;N</property>
                 <property name="title" translatable="yes">Add a world clock</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;S</property>
                 <property name="title" translatable="yes">Select world clocks</property>
-              </shortcut>
-            </group>
-          </column>
-          <column>
-            <group view="alarm">
-              <property name="title" translatable="yes">Alarm</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="view">alarm</property>
+            <property name="title" translatable="yes">Alarm</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;N</property>
                 <property name="title" translatable="yes">Add an alarm</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;S</property>
                 <property name="title" translatable="yes">Select alarms</property>
-              </shortcut>
-            </group>
-            <group view="stopwatch">
-              <property name="title" translatable="yes">Stopwatch</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="view">stopwatch</property>
+            <property name="title" translatable="yes">Stopwatch</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">Return space</property>
                 <property name="title" translatable="yes">Start / Stop / Continue</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">L</property>
                 <property name="title" translatable="yes">Lap</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">Delete</property>
                 <property name="title" translatable="yes">Reset</property>
-              </shortcut>
-            </group>
-            <group view="timer">
-              <property name="title" translatable="yes">Timer</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="view">timer</property>
+            <property name="title" translatable="yes">Timer</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">Return space</property>
                 <property name="title" translatable="yes">Start / Stop / Pause</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">Delete</property>
                 <property name="title" translatable="yes">Reset</property>
-              </shortcut>
-            </group>
-          </column>
-        </page>
-      </section>
-    </sections>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
   </object>
 
   <object class="GtkShortcutsWindow" id="gedit-shortcuts">
     <property name="transient-for">window1</property>
     <property name="modal">1</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
-    <sections>
-      <section name="shortcuts">
-        <page>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Touchpad gestures</property>
-              <gesture>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <property name="max-height">12</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Touchpad gestures</property>
+            <child>
+              <object class="GtkShortcutsGesture">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Switch to the next document</property>
                 <property name="subtitle" translatable="yes">Two finger swipe right</property>
-                <property name="gicon">right-swipe-icon</property>
-              </gesture>
-              <gesture>
+                <property name="icon">right-swipe-icon</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsGesture">
+                <property name="visible">1</property>
                 <property name="title" translatable="yes">Switch to the previous document</property>
                 <property name="subtitle" translatable="yes">Two finger swipe left</property>
-                <property name="gicon">left-swipe-icon</property>
-              </gesture>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Documents</property>
-              <shortcut>
+                <property name="icon">left-swipe-icon</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Documents</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;N</property>
                 <property name="title" translatable="yes">Create new document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;O</property>
                 <property name="title" translatable="yes">Open a document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;S</property>
                 <property name="title" translatable="yes">Save the document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;W</property>
                 <property name="title" translatable="yes">Close the document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;Alt&gt;Page_Down</property>
                 <property name="title" translatable="yes">Switch to the next document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;Alt&gt;Page_Up</property>
                 <property name="title" translatable="yes">Switch to the previous document</property>
-              </shortcut>
-            </group>
-          </column>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Find and Replace</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Find and Replace</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;F</property>
                 <property name="title" translatable="yes">Find</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;G</property>
                 <property name="title" translatable="yes">Find the next match</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;Shift&gt;G</property>
                 <property name="title" translatable="yes">Find the previous match</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;H</property>
                 <property name="title" translatable="yes">Find and Replace</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;&lt;Shift&gt;K</property>
                 <property name="title" translatable="yes">Clear highlight</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;I</property>
                 <property name="title" translatable="yes">Go to line</property>
-              </shortcut>
-            </group>
-            <group>
-              <property name="title" translatable="yes">Tools</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Tools</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;shift&gt;F7</property>
                 <property name="title" translatable="yes">Check spelling</property>
-              </shortcut>
-            </group>
-          </column>
-        </page>
-        <page>
-          <column>
-            <group>
-              <property name="title" translatable="yes">Miscellaneous</property>
-              <shortcut>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Miscellaneous</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">F11</property>
                 <property name="title" translatable="yes">Fullscreen on / off</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;P</property>
                 <property name="title" translatable="yes">Print the document</property>
-              </shortcut>
-              <shortcut>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">Insert</property>
                 <property name="title" translatable="yes">Toggle insert / overwrite</property>
-              </shortcut>
-            </group>
-          </column>
-        </page>
-      </section>
-    </sections>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
   </object>
 
 </interface>
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 921bc26..13ec0dd 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -506,12 +506,10 @@ gtk_private_h_sources =           \
        gtkselectionprivate.h   \
        gtksidebarrowprivate.h  \
        gtksettingsprivate.h    \
-       gtkshortcutscolumnprivate.h     \
        gtkshortcutsgestureprivate.h    \
        gtkshortcutsgrouprivate.h       \
        gtkshortcutlabelprivate.h       \
        gtkshortcutsshortcutprivate.h   \
-       gtkshortcutspageprivate.h       \
        gtkshortcutssectionprivate.h    \
        gtksizegroup-private.h  \
        gtksizerequestcacheprivate.h    \
@@ -813,11 +811,9 @@ gtk_base_c_sources =               \
        gtkseparatormenuitem.c  \
        gtkseparatortoolitem.c  \
        gtksettings.c           \
-       gtkshortcutscolumn.c    \
        gtkshortcutsgesture.c   \
        gtkshortcutsgroup.c     \
        gtkshortcutlabel.c      \
-       gtkshortcutspage.c      \
        gtkshortcutsshortcut.c  \
        gtkshortcutssection.c   \
        gtkshortcutswindow.c    \
diff --git a/gtk/gtkshortcutsgesture.c b/gtk/gtkshortcutsgesture.c
index 8762ee2..c0c7f52 100644
--- a/gtk/gtkshortcutsgesture.c
+++ b/gtk/gtkshortcutsgesture.c
@@ -35,6 +35,9 @@ struct _GtkShortcutsGesture
   GtkLabel *title;
   GtkLabel *subtitle;
   GtkBox   *desc_box;
+
+  GtkSizeGroup *desc_size_group;
+  GtkSizeGroup *icon_size_group;
 };
 
 struct _GtkShortcutsGestureClass
@@ -47,7 +50,7 @@ G_DEFINE_TYPE (GtkShortcutsGesture, gtk_shortcuts_gesture, GTK_TYPE_BOX)
 enum {
   PROP_0,
   PROP_DESC_SIZE_GROUP,
-  PROP_GICON,
+  PROP_ICON,
   PROP_ICON_SIZE_GROUP,
   PROP_SUBTITLE,
   PROP_TITLE,
@@ -57,8 +60,32 @@ enum {
 static GParamSpec *properties[LAST_PROP];
 
 static void
-gtk_shortcuts_gesture_set_gicon (GtkShortcutsGesture *self,
-                                 GIcon               *gicon)
+gtk_shortcuts_gesture_set_desc_size_group (GtkShortcutsGesture *self,
+                                           GtkSizeGroup       *group)
+{
+  if (self->desc_size_group)
+    gtk_size_group_remove_widget (self->desc_size_group, GTK_WIDGET (self->desc_box));
+  if (group)
+    gtk_size_group_add_widget (group, GTK_WIDGET (self->desc_box));
+
+  g_set_object (&self->desc_size_group, group);
+}
+
+static void
+gtk_shortcuts_gesture_set_icon_size_group (GtkShortcutsGesture *self,
+                                           GtkSizeGroup        *group)
+{
+  if (self->icon_size_group)
+    gtk_size_group_remove_widget (self->icon_size_group, GTK_WIDGET (self->image));
+  if (group)
+    gtk_size_group_add_widget (group, GTK_WIDGET (self->image));
+
+  g_set_object (&self->icon_size_group, group);
+}
+
+static void
+gtk_shortcuts_gesture_set_icon (GtkShortcutsGesture *self,
+                                GIcon               *gicon)
 {
   gtk_image_set_from_gicon (self->image, gicon, GTK_ICON_SIZE_DIALOG);
 }
@@ -81,6 +108,15 @@ gtk_shortcuts_gesture_get_property (GObject    *object,
       g_value_set_string (value, gtk_label_get_label (self->title));
       break;
 
+    case PROP_ICON:
+      {
+        GIcon *icon;
+
+        gtk_image_get_gicon (self->image, &icon, NULL);
+        g_value_set_object (value, icon);
+      }
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -97,26 +133,16 @@ gtk_shortcuts_gesture_set_property (GObject      *object,
   switch (prop_id)
     {
     case PROP_DESC_SIZE_GROUP:
-      {
-        GtkSizeGroup *group = g_value_get_object (value);
-
-        if (group != NULL)
-          gtk_size_group_add_widget (group, GTK_WIDGET (self->desc_box));
-        break;
-      }
+      gtk_shortcuts_gesture_set_desc_size_group (self, GTK_SIZE_GROUP (g_value_get_object (value)));
+      break;
 
-    case PROP_GICON:
-      gtk_shortcuts_gesture_set_gicon (self, g_value_get_object (value));
+    case PROP_ICON:
+      gtk_shortcuts_gesture_set_icon (self, g_value_get_object (value));
       break;
 
     case PROP_ICON_SIZE_GROUP:
-      {
-        GtkSizeGroup *group = g_value_get_object (value);
-
-        if (group != NULL)
-          gtk_size_group_add_widget (group, GTK_WIDGET (self->image));
-        break;
-      }
+      gtk_shortcuts_gesture_set_icon_size_group (self, GTK_SIZE_GROUP (g_value_get_object (value)));
+      break;
 
     case PROP_SUBTITLE:
       gtk_label_set_label (self->subtitle, g_value_get_string (value));
@@ -132,10 +158,22 @@ gtk_shortcuts_gesture_set_property (GObject      *object,
 }
 
 static void
+gtk_shortcuts_gesture_finalize (GObject *object)
+{
+  GtkShortcutsGesture *self = GTK_SHORTCUTS_GESTURE (object);
+
+  g_clear_object (&self->desc_size_group);
+  g_clear_object (&self->icon_size_group);
+
+  G_OBJECT_CLASS (gtk_shortcuts_gesture_parent_class)->finalize (object);
+}
+
+static void
 gtk_shortcuts_gesture_class_init (GtkShortcutsGestureClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  object_class->finalize = gtk_shortcuts_gesture_finalize;
   object_class->get_property = gtk_shortcuts_gesture_get_property;
   object_class->set_property = gtk_shortcuts_gesture_set_property;
 
@@ -146,12 +184,12 @@ gtk_shortcuts_gesture_class_init (GtkShortcutsGestureClass *klass)
                          GTK_TYPE_SIZE_GROUP,
                          (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
 
-  properties[PROP_GICON] =
-    g_param_spec_object ("gicon",
-                         P_("GIcon"),
-                         P_("GIcon"),
+  properties[PROP_ICON] =
+    g_param_spec_object ("icon",
+                         P_("Icon"),
+                         P_("Icon"),
                          G_TYPE_ICON,
-                         (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   properties[PROP_ICON_SIZE_GROUP] =
     g_param_spec_object ("icon-size-group",
diff --git a/gtk/gtkshortcutsgroup.c b/gtk/gtkshortcutsgroup.c
index ca8f3eb..a7cb08b 100644
--- a/gtk/gtkshortcutsgroup.c
+++ b/gtk/gtkshortcutsgroup.c
@@ -20,8 +20,11 @@
 
 #include "gtkshortcutsgroupprivate.h"
 
+#include "gtkshortcutsshortcutprivate.h"
+#include "gtkshortcutsgestureprivate.h"
 #include "gtklabel.h"
 #include "gtkorientable.h"
+#include "gtksizegroup.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -30,7 +33,8 @@ struct _GtkShortcutsGroup
   GtkBox    parent_instance;
 
   GtkLabel *title;
-  gchar *view;
+  gchar    *view;
+  guint     height;
 };
 
 struct _GtkShortcutsGroupClass
@@ -44,12 +48,70 @@ enum {
   PROP_0,
   PROP_TITLE,
   PROP_VIEW,
+  PROP_ACCEL_SIZE_GROUP,
+  PROP_TITLE_SIZE_GROUP,
+  PROP_HEIGHT,
   LAST_PROP
 };
 
 static GParamSpec *properties[LAST_PROP];
 
 static void
+gtk_shortcuts_group_set_accel_size_group (GtkShortcutsGroup *group,
+                                          GtkSizeGroup      *size_group)
+{
+  GList *children, *l;
+
+  children = gtk_container_get_children (GTK_CONTAINER (group));
+  for (l = children; l; l = l->next)
+    {
+      if (GTK_IS_SHORTCUTS_SHORTCUT (l->data))
+        g_object_set (l->data, "accel-size-group", size_group, NULL);
+      else if (GTK_IS_SHORTCUTS_GESTURE (l->data))
+        g_object_set (l->data, "icon-size-group", size_group, NULL);
+    }
+  g_list_free (children);
+}
+
+static void
+gtk_shortcuts_group_set_title_size_group (GtkShortcutsGroup *group,
+                                          GtkSizeGroup      *size_group)
+{
+  GList *children, *l;
+
+  children = gtk_container_get_children (GTK_CONTAINER (group));
+  for (l = children; l; l = l->next)
+    {
+      if (GTK_IS_SHORTCUTS_SHORTCUT (l->data))
+        g_object_set (l->data, "title-size-group", size_group, NULL);
+      else if (GTK_IS_SHORTCUTS_GESTURE (l->data))
+        g_object_set (l->data, "desc-size-group", size_group, NULL);
+    }
+  g_list_free (children);
+}
+
+static guint
+gtk_shortcuts_group_get_height (GtkShortcutsGroup *group)
+{
+  GList *children, *l;
+  guint height;
+
+  height = 1;
+
+  children = gtk_container_get_children (GTK_CONTAINER (group));
+  for (l = children; l; l = l->next)
+    {
+      if (GTK_IS_SHORTCUTS_SHORTCUT (l->data))
+        height += 1;
+      else if (GTK_IS_SHORTCUTS_GESTURE (l->data))
+        height += 2;
+    }
+  g_list_free (children);
+
+  return height;
+}
+
+static void
 gtk_shortcuts_group_get_property (GObject    *object,
                                   guint       prop_id,
                                   GValue     *value,
@@ -67,6 +129,10 @@ gtk_shortcuts_group_get_property (GObject    *object,
       g_value_set_string (value, self->view);
       break;
 
+    case PROP_HEIGHT:
+      g_value_set_uint (value, gtk_shortcuts_group_get_height (self));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -91,6 +157,14 @@ gtk_shortcuts_group_set_property (GObject      *object,
       self->view = g_value_dup_string (value);
       break;
 
+    case PROP_ACCEL_SIZE_GROUP:
+      gtk_shortcuts_group_set_accel_size_group (self, GTK_SIZE_GROUP (g_value_get_object (value)));
+      break;
+
+    case PROP_TITLE_SIZE_GROUP:
+      gtk_shortcuts_group_set_title_size_group (self, GTK_SIZE_GROUP (g_value_get_object (value)));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -124,6 +198,25 @@ gtk_shortcuts_group_class_init (GtkShortcutsGroupClass *klass)
                          NULL,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  properties[PROP_ACCEL_SIZE_GROUP] =
+    g_param_spec_object ("accel-size-group",
+                         P_("Accelerator Size Group"),
+                         P_("Accelerator Size Group"),
+                         GTK_TYPE_SIZE_GROUP,
+                         (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+
+  properties[PROP_TITLE_SIZE_GROUP] =
+    g_param_spec_object ("title-size-group",
+                         P_("Title Size Group"),
+                         P_("Title Size Group"),
+                         GTK_TYPE_SIZE_GROUP,
+                         (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+
+  properties[PROP_HEIGHT] =
+    g_param_spec_uint ("height", P_("Height"), P_("Height"),
+                       0, G_MAXUINT, 0,
+                       (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
   g_object_class_install_properties (object_class, LAST_PROP, properties);
 }
 
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index 6830957..2a361b4 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -20,13 +20,13 @@
 
 #include "gtkshortcutssectionprivate.h"
 
-#include "gtkshortcutspageprivate.h"
 #include "gtkshortcutsgroupprivate.h"
 #include "gtktogglebutton.h"
 #include "gtkstack.h"
 #include "gtkstackswitcher.h"
 #include "gtkstylecontext.h"
 #include "gtkorientable.h"
+#include "gtksizegroup.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
@@ -37,6 +37,7 @@ struct _GtkShortcutsSection
   gchar            *name;
   gchar            *title;
   gchar            *view_name;
+  guint             max_height;
 
   GtkStack         *stack;
   GtkStackSwitcher *switcher;
@@ -44,6 +45,11 @@ struct _GtkShortcutsSection
 
   gboolean          has_filtered_group;
   guint             last_page_num;
+
+  GtkWidget        *current_page;
+  GtkWidget        *current_column;
+  guint             n_columns;
+  guint             n_rows;
 };
 
 struct _GtkShortcutsSectionClass
@@ -58,6 +64,7 @@ enum {
   PROP_TITLE,
   PROP_SECTION_NAME,
   PROP_VIEW_NAME,
+  PROP_MAX_HEIGHT,
   LAST_PROP
 };
 
@@ -85,26 +92,10 @@ gtk_shortcuts_section_add (GtkContainer *container,
 {
   GtkShortcutsSection *self = (GtkShortcutsSection *)container;
 
-  if (GTK_IS_SHORTCUTS_PAGE (child))
-    {
-      gchar *title = NULL;
-      guint count = 0;
-
-      title = g_strdup_printf ("%u", ++self->last_page_num);
-      gtk_container_add_with_properties (GTK_CONTAINER (self->stack), child,
-                                         "title", title,
-                                         NULL);
-
-      gtk_container_foreach (GTK_CONTAINER (self->switcher), adjust_page_buttons, &count);
-      gtk_widget_set_visible (GTK_WIDGET (self->switcher), (count > 1));
-      if (count > 1)
-        gtk_widget_show (gtk_widget_get_parent (GTK_WIDGET (self->switcher)));
-      g_free (title);
-    }
+  if (GTK_IS_SHORTCUTS_GROUP (child))
+    gtk_shortcuts_section_add_group (self, GTK_SHORTCUTS_GROUP (child));
   else
-    {
-      GTK_CONTAINER_CLASS (gtk_shortcuts_section_parent_class)->add (container, child);
-    }
+    GTK_CONTAINER_CLASS (gtk_shortcuts_section_parent_class)->add (container, child);
 }
 
 static void
@@ -140,6 +131,10 @@ gtk_shortcuts_section_get_property (GObject    *object,
       g_value_set_string (value, self->title);
       break;
 
+    case PROP_MAX_HEIGHT:
+      g_value_set_uint (value, self->max_height);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -169,6 +164,10 @@ gtk_shortcuts_section_set_property (GObject      *object,
       self->title = g_value_dup_string (value);
       break;
 
+    case PROP_MAX_HEIGHT:
+      self->max_height = g_value_get_uint (value);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -201,6 +200,11 @@ gtk_shortcuts_section_class_init (GtkShortcutsSectionClass *klass)
                          NULL,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  properties[PROP_MAX_HEIGHT] =
+    g_param_spec_uint ("max-height", P_("Maximum Height"), P_("Maximum Height"),
+                       0, G_MAXUINT, 15,
+                       (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
   g_object_class_install_properties (object_class, LAST_PROP, properties);
 }
 
@@ -245,6 +249,8 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self)
 {
   GtkWidget *box;
 
+  self->max_height = 15;
+
   gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
   gtk_box_set_homogeneous (GTK_BOX (self), FALSE);
   gtk_box_set_spacing (GTK_BOX (self), 22);
@@ -309,3 +315,61 @@ gtk_shortcuts_section_set_view_name (GtkShortcutsSection *self,
 
   g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VIEW_NAME]);
 }
+
+void
+gtk_shortcuts_section_add_group (GtkShortcutsSection *self,
+                                 GtkShortcutsGroup   *group)
+{
+  guint height;
+
+  g_return_if_fail (GTK_IS_SHORTCUTS_SECTION (self));
+  g_return_if_fail (GTK_IS_SHORTCUTS_GROUP (group));
+
+  g_object_get (group, "height", &height, NULL);
+
+  if (self->n_rows == 0 || self->n_rows + height > self->max_height)
+    {
+      GtkWidget *column;
+
+      column = gtk_box_new (GTK_ORIENTATION_VERTICAL, 22);
+      gtk_widget_show (column);
+
+      g_object_set_data_full (G_OBJECT (column), "accel-size-group", gtk_size_group_new 
(GTK_SIZE_GROUP_HORIZONTAL), g_object_unref);
+      g_object_set_data_full (G_OBJECT (column), "title-size-group", gtk_size_group_new 
(GTK_SIZE_GROUP_HORIZONTAL), g_object_unref);
+
+      if (self->n_columns % 2 == 0)
+        {
+          GtkWidget *page;
+          gchar *title = NULL;
+          guint count = 0;
+
+          page = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 22);
+          gtk_widget_show (page);
+
+          title = g_strdup_printf ("%u", ++self->last_page_num);
+          gtk_container_add_with_properties (GTK_CONTAINER (self->stack), page,
+                                             "title", title,
+                                             NULL);
+
+          gtk_container_foreach (GTK_CONTAINER (self->switcher), adjust_page_buttons, &count);
+          gtk_widget_set_visible (GTK_WIDGET (self->switcher), (count > 1));
+          if (count > 1)
+            gtk_widget_show (gtk_widget_get_parent (GTK_WIDGET (self->switcher)));
+          g_free (title);
+
+          self->current_page = page;
+        }
+
+      gtk_container_add (GTK_CONTAINER (self->current_page), column);
+      self->current_column = column;
+      self->n_columns += 1;
+      self->n_rows = 0;
+    }
+
+  self->n_rows += height;
+
+  g_object_set (group, "accel-size-group", g_object_get_data (G_OBJECT (self->current_column), 
"accel-size-group"), NULL);
+  g_object_set (group, "title-size-group", g_object_get_data (G_OBJECT (self->current_column), 
"title-size-group"), NULL);
+
+  gtk_container_add (GTK_CONTAINER (self->current_column), GTK_WIDGET (group));
+}
diff --git a/gtk/gtkshortcutssectionprivate.h b/gtk/gtkshortcutssectionprivate.h
index 776790b..f5d4897 100644
--- a/gtk/gtkshortcutssectionprivate.h
+++ b/gtk/gtkshortcutssectionprivate.h
@@ -20,6 +20,7 @@
 #define __GTK_SHORTCUTS_SECTION_H__
 
 #include <gtk/gtkbox.h>
+#include <gtk/gtkshortcutsgroupprivate.h>
 
 G_BEGIN_DECLS
 
@@ -41,6 +42,8 @@ const gchar *gtk_shortcuts_section_get_section_name (GtkShortcutsSection *self);
 const gchar *gtk_shortcuts_section_get_title        (GtkShortcutsSection *self);
 void         gtk_shortcuts_section_set_view_name    (GtkShortcutsSection *self,
                                                      const gchar         *view_name);
+void         gtk_shortcuts_section_add_group        (GtkShortcutsSection *self,
+                                                     GtkShortcutsGroup   *group);
 
 G_END_DECLS
 
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c
index 78c35ee..c659674 100644
--- a/gtk/gtkshortcutsshortcut.c
+++ b/gtk/gtkshortcutsshortcut.c
@@ -31,6 +31,9 @@ struct _GtkShortcutsShortcut
 
   GtkShortcutLabel *accelerator;
   GtkLabel         *title;
+
+  GtkSizeGroup *accel_size_group;
+  GtkSizeGroup *title_size_group;
 };
 
 struct _GtkShortcutsShortcutClass
@@ -43,7 +46,7 @@ G_DEFINE_TYPE (GtkShortcutsShortcut, gtk_shortcuts_shortcut, GTK_TYPE_BOX)
 enum {
   PROP_0,
   PROP_ACCELERATOR,
-  PROP_ACCELERATOR_SIZE_GROUP,
+  PROP_ACCEL_SIZE_GROUP,
   PROP_TITLE,
   PROP_TITLE_SIZE_GROUP,
   LAST_PROP
@@ -52,6 +55,30 @@ enum {
 static GParamSpec *properties[LAST_PROP];
 
 static void
+gtk_shortcuts_shortcut_set_accel_size_group (GtkShortcutsShortcut *self,
+                                             GtkSizeGroup         *group)
+{
+  if (self->accel_size_group)
+    gtk_size_group_remove_widget (self->accel_size_group, GTK_WIDGET (self->accelerator));
+  if (group)
+    gtk_size_group_add_widget (group, GTK_WIDGET (self->accelerator));
+
+  g_set_object (&self->accel_size_group, group);
+}
+
+static void
+gtk_shortcuts_shortcut_set_title_size_group (GtkShortcutsShortcut *self,
+                                             GtkSizeGroup         *group)
+{
+  if (self->title_size_group)
+    gtk_size_group_remove_widget (self->title_size_group, GTK_WIDGET (self->accelerator));
+  if (group)
+    gtk_size_group_add_widget (group, GTK_WIDGET (self->title));
+
+  g_set_object (&self->title_size_group, group);
+}
+
+static void
 gtk_shortcuts_shortcut_get_property (GObject    *object,
                                      guint       prop_id,
                                      GValue     *value,
@@ -88,38 +115,41 @@ gtk_shortcuts_shortcut_set_property (GObject      *object,
       gtk_shortcut_label_set_accelerator (self->accelerator, g_value_get_string (value));
       break;
 
-    case PROP_ACCELERATOR_SIZE_GROUP:
-      {
-        GtkSizeGroup *group = g_value_get_object (value);
-
-        if (group != NULL)
-          gtk_size_group_add_widget (group, GTK_WIDGET (self->accelerator));
-        break;
-      }
+    case PROP_ACCEL_SIZE_GROUP:
+      gtk_shortcuts_shortcut_set_accel_size_group (self, GTK_SIZE_GROUP (g_value_get_object (value)));
+      break;
 
     case PROP_TITLE:
       gtk_label_set_label (self->title, g_value_get_string (value));
       break;
 
     case PROP_TITLE_SIZE_GROUP:
-      {
-        GtkSizeGroup *group = g_value_get_object (value);
-
-        if (group != NULL)
-          gtk_size_group_add_widget (group, GTK_WIDGET (self->title));
-        break;
-      }
+      gtk_shortcuts_shortcut_set_title_size_group (self, GTK_SIZE_GROUP (g_value_get_object (value)));
+      break;
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
     }
 }
 
 static void
+gtk_shortcuts_shortcut_finalize (GObject *object)
+{
+  GtkShortcutsShortcut *self = GTK_SHORTCUTS_SHORTCUT (object);
+
+  g_clear_object (&self->accel_size_group);
+  g_clear_object (&self->title_size_group);
+
+  G_OBJECT_CLASS (gtk_shortcuts_shortcut_parent_class)->finalize (object);
+}
+
+static void
 gtk_shortcuts_shortcut_class_init (GtkShortcutsShortcutClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  object_class->finalize = gtk_shortcuts_shortcut_finalize;
   object_class->get_property = gtk_shortcuts_shortcut_get_property;
   object_class->set_property = gtk_shortcuts_shortcut_set_property;
 
@@ -130,8 +160,8 @@ gtk_shortcuts_shortcut_class_init (GtkShortcutsShortcutClass *klass)
                          NULL,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
-  properties[PROP_ACCELERATOR_SIZE_GROUP] =
-    g_param_spec_object ("accelerator-size-group",
+  properties[PROP_ACCEL_SIZE_GROUP] =
+    g_param_spec_object ("accel-size-group",
                          P_("Accelerator Size Group"),
                          P_("Accelerator Size Group"),
                          GTK_TYPE_SIZE_GROUP,
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index c4c2353..f8305d1 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -20,10 +20,8 @@
 
 #include "gtkshortcutswindow.h"
 #include "gtkscrolledwindow.h"
-#include "gtkshortcutscolumnprivate.h"
 #include "gtkshortcutsgestureprivate.h"
 #include "gtkshortcutsgroupprivate.h"
-#include "gtkshortcutspageprivate.h"
 #include "gtkshortcutsshortcutprivate.h"
 #include "gtkshortcutssectionprivate.h"
 #include "gtkprivate.h"
@@ -69,18 +67,13 @@ typedef struct
   GtkShortcutsWindow *self;
   GtkBuilder        *builder;
   GQueue            *stack;
-  GtkWidget         *search_item;
-  GQueue            *column_image_size_groups;
-  GQueue            *column_desc_size_groups;
   gchar             *property_name;
   guint              translatable : 1;
 } ViewsParserData;
 
-static void gtk_buildable_iface_init (GtkBuildableIface *iface);
 
-G_DEFINE_TYPE_EXTENDED (GtkShortcutsWindow, gtk_shortcuts_window, GTK_TYPE_WINDOW, 0,
-                        G_ADD_PRIVATE (GtkShortcutsWindow)
-                        G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_buildable_iface_init))
+G_DEFINE_TYPE_WITH_PRIVATE (GtkShortcutsWindow, gtk_shortcuts_window, GTK_TYPE_WINDOW)
+
 
 enum {
   CLOSE,
@@ -140,6 +133,102 @@ update_title_stack (GtkShortcutsWindow *self)
 }
 
 static void
+gtk_shortcuts_window_add_search_item (GtkWidget *child, gpointer data)
+{
+  GtkShortcutsWindow *self = data;
+  GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
+  GtkWidget *item;
+  gchar *subtitle = NULL;
+  gchar *accelerator = NULL;
+  gchar *title = NULL;
+  gchar *hash_key = NULL;
+  GIcon *icon = NULL;
+  gchar *str;
+  gchar *keywords;
+
+  if (GTK_IS_SHORTCUTS_SHORTCUT (child))
+    {
+      g_object_get (child,
+                    "accelerator", &accelerator,
+                    "title", &title,
+                    NULL);
+
+      hash_key = g_strdup_printf ("%s-%s", title, accelerator);
+      if (g_hash_table_contains (priv->search_items_hash, hash_key))
+        {
+          g_free (hash_key);
+          g_free (title);
+          g_free (accelerator);
+          return;
+        }
+
+      g_hash_table_insert (priv->search_items_hash, hash_key, GINT_TO_POINTER (1));
+
+      item = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
+                           "visible", TRUE,
+                           "accelerator", accelerator,
+                           "title", title,
+                           "accel-size-group", priv->search_image_group,
+                           "title-size-group", priv->search_text_group,
+                           NULL);
+
+      str = g_strdup_printf ("%s %s", accelerator, title);
+      keywords = g_utf8_strdown (str, -1);
+
+      g_hash_table_insert (priv->keywords, item, keywords);
+      gtk_container_add (GTK_CONTAINER (priv->search_shortcuts), item);
+
+      g_free (title);
+      g_free (accelerator);
+      g_free (str);
+    }
+  else if (GTK_IS_SHORTCUTS_GESTURE (child))
+    {
+      g_object_get (child,
+                    "title", &title,
+                    "subtitle", &subtitle,
+                    "icon", &icon,
+                    NULL);
+
+      hash_key = g_strdup_printf ("%s-%s", title, subtitle);
+      if (g_hash_table_contains (priv->search_items_hash, hash_key))
+        {
+          g_free (subtitle);
+          g_free (title);
+          g_free (hash_key);
+          g_clear_object (&icon);
+          return;
+        }
+
+      g_hash_table_insert (priv->search_items_hash, hash_key, GINT_TO_POINTER (1));
+
+      item = g_object_new (GTK_TYPE_SHORTCUTS_GESTURE,
+                           "visible", TRUE,
+                           "title", title,
+                           "subtitle", subtitle,
+                           "icon", icon,
+                           "icon-size-group", priv->search_image_group,
+                           "desc-size-group", priv->search_text_group,
+                           NULL);
+
+      str = g_strdup_printf ("%s %s", title, subtitle);
+      keywords = g_utf8_strdown (str, -1);
+
+      g_hash_table_insert (priv->keywords, item, keywords);
+      gtk_container_add (GTK_CONTAINER (priv->search_gestures), item);
+
+      g_free (subtitle);
+      g_free (title);
+      g_clear_object (&icon);
+      g_free (str);
+    }
+  else if (GTK_IS_CONTAINER (child))
+    {
+      gtk_container_foreach (GTK_CONTAINER (child), gtk_shortcuts_window_add_search_item, self);
+    }
+}
+
+static void
 gtk_shortcuts_window_add_section (GtkShortcutsWindow  *self,
                                   GtkShortcutsSection *section)
 {
@@ -150,6 +239,8 @@ gtk_shortcuts_window_add_section (GtkShortcutsWindow  *self,
   const gchar *visible_section;
   GtkWidget *label;
 
+  gtk_container_foreach (GTK_CONTAINER (section), gtk_shortcuts_window_add_search_item, self);
+
   name = gtk_shortcuts_section_get_section_name (section);
   title = gtk_shortcuts_section_get_title (section);
 
@@ -238,92 +329,6 @@ gtk_shortcuts_window__list_box__row_activated (GtkShortcutsWindow *self,
 }
 
 static void
-gtk_shortcuts_window_add_search_item (GtkShortcutsWindow *self,
-                                      GtkWidget          *search_item)
-{
-  GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
-  GString *str;
-  gchar *downcase;
-
-  str = g_string_new (NULL);
-
-  if (GTK_IS_SHORTCUTS_SHORTCUT (search_item))
-    {
-      gchar *accelerator = NULL;
-      gchar *title = NULL;
-      gchar *hash_key = NULL;
-
-      g_object_get (search_item,
-                    "accelerator", &accelerator,
-                    "title", &title,
-                    NULL);
-
-      hash_key = g_strdup_printf ("%s-%s", title, accelerator);
-      if (g_hash_table_contains (priv->search_items_hash, hash_key))
-        {
-          g_free (hash_key);
-          g_free (title);
-          g_free (accelerator);
-
-          return;
-        }
-
-      g_hash_table_insert (priv->search_items_hash, hash_key, GINT_TO_POINTER (1));
-
-      g_object_set (search_item,
-                    "accelerator-size-group", priv->search_image_group,
-                    "title-size-group", priv->search_text_group,
-                    NULL);
-
-      g_string_append_printf (str, "%s %s", accelerator, title);
-
-      gtk_container_add (GTK_CONTAINER (priv->search_shortcuts), search_item);
-
-      g_free (title);
-      g_free (accelerator);
-    }
-  else if (GTK_IS_SHORTCUTS_GESTURE (search_item))
-    {
-      gchar *subtitle = NULL;
-      gchar *title = NULL;
-      gchar *hash_key = NULL;
-
-      g_object_get (search_item,
-                    "subtitle", &subtitle,
-                    "title", &title,
-                    NULL);
-
-      hash_key = g_strdup_printf ("%s-%s", title, subtitle);
-      if (g_hash_table_contains (priv->search_items_hash, hash_key))
-        {
-          g_free (subtitle);
-          g_free (title);
-          g_free (hash_key);
-
-          return;
-        }
-
-      g_hash_table_insert (priv->search_items_hash, hash_key, GINT_TO_POINTER (1));
-
-      g_object_set (search_item,
-                    "icon-size-group", priv->search_image_group,
-                    "desc-size-group", priv->search_text_group,
-                    NULL);
-
-      g_string_append_printf (str, "%s %s", title, subtitle);
-
-      gtk_container_add (GTK_CONTAINER (priv->search_gestures), search_item);
-
-      g_free (subtitle);
-      g_free (title);
-    }
-
-  downcase = g_utf8_strdown (str->str, str->len);
-  g_hash_table_insert (priv->keywords, search_item, downcase);
-  g_string_free (str, TRUE);
-}
-
-static void
 gtk_shortcuts_window__entry__changed (GtkShortcutsWindow *self,
                                      GtkSearchEntry      *search_entry)
 {
@@ -388,385 +393,7 @@ gtk_shortcuts_window__search_mode__changed (GtkShortcutsWindow *self)
   if (!gtk_search_bar_get_search_mode (priv->search_bar))
     {
       if (priv->last_section_name != NULL)
-        {
-          gtk_stack_set_visible_child_name (priv->stack, priv->last_section_name);
-          return;
-        }
-    }
-}
-
-static gboolean
-check_parent (GMarkupParseContext  *context,
-              const gchar          *element_name,
-              GError              **error)
-{
-  const GSList *stack;
-  const gchar *parent_name;
-  const gchar *our_name;
-
-  stack = g_markup_parse_context_get_element_stack (context);
-  our_name = stack->data;
-  parent_name = stack->next ? stack->next->data : "";
-
-  if (g_strcmp0 (parent_name, element_name) != 0)
-    {
-      gint line;
-      gint col;
-
-      g_markup_parse_context_get_position (context, &line, &col);
-      g_set_error (error,
-                   GTK_BUILDER_ERROR,
-                   GTK_BUILDER_ERROR_INVALID_TAG,
-                   "%d:%d: Element <%s> found in <%s>, expected <%s>.",
-                   line, col, our_name, parent_name, element_name);
-      return FALSE;
-    }
-
-  return TRUE;
-}
-
-static void
-sections_parser_start_element (GMarkupParseContext  *context,
-                            const gchar          *element_name,
-                            const gchar         **attribute_names,
-                            const gchar         **attribute_values,
-                            gpointer              user_data,
-                            GError              **error)
-{
-  ViewsParserData *parser_data = user_data;
-  GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (parser_data->self);
-  GtkWidget *item;
-
-  if (g_strcmp0 (element_name, "sections") == 0)
-    {
-    }
-  else if (g_strcmp0 (element_name, "section") == 0)
-    {
-      const gchar *name = NULL;
-
-      if (!check_parent (context, "sections", error))
-        return;
-
-      if (!g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
-                                        G_MARKUP_COLLECT_STRING, "name", &name,
-                                        G_MARKUP_COLLECT_INVALID))
-        return;
-
-      item = g_object_new (GTK_TYPE_SHORTCUTS_SECTION,
-                           "section-name", name,
-                           "visible", TRUE,
-                           "view-name", priv->view_name,
-                           NULL);
-      g_queue_push_head (parser_data->stack, g_object_ref_sink (item));
-    }
-  else if (g_strcmp0 (element_name, "page") == 0)
-    {
-      if (!check_parent (context, "section", error))
-        return;
-
-      item = g_object_new (GTK_TYPE_SHORTCUTS_PAGE,
-                           "visible", TRUE,
-                           NULL);
-      g_queue_push_head (parser_data->stack, g_object_ref_sink (item));
-    }
-  else if (g_strcmp0 (element_name, "column") == 0)
-    {
-      GtkSizeGroup *size_group;
-
-      if (!check_parent (context, "page", error))
-        return;
-
-      size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-      g_queue_push_head (parser_data->column_image_size_groups, size_group);
-
-      size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-      g_queue_push_head (parser_data->column_desc_size_groups, size_group);
-
-      item = g_object_new (GTK_TYPE_SHORTCUTS_COLUMN,
-                           "visible", TRUE,
-                           NULL);
-      g_queue_push_head (parser_data->stack, g_object_ref_sink (item));
-    }
-  else if (g_strcmp0 (element_name, "group") == 0)
-    {
-      const gchar *view = NULL;
-
-      if (!check_parent (context, "column", error))
-        return;
-
-      if (!g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
-                                        G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL, "view", &view,
-                                        G_MARKUP_COLLECT_INVALID))
-        return;
-
-      item = g_object_new (GTK_TYPE_SHORTCUTS_GROUP,
-                           "visible", TRUE,
-                           "view", view,
-                           NULL);
-      g_queue_push_head (parser_data->stack, g_object_ref_sink (item));
-    }
-  else if (g_strcmp0 (element_name, "shortcut") == 0)
-    {
-      GtkSizeGroup *accel_size_group;
-      GtkSizeGroup *desc_size_group;
-
-      if (!check_parent (context, "group", error))
-        return;
-
-      accel_size_group = g_queue_peek_head (parser_data->column_image_size_groups);
-      desc_size_group = g_queue_peek_head (parser_data->column_desc_size_groups);
-
-      parser_data->search_item = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
-                                               "visible", TRUE,
-                                               NULL);
-
-      item = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
-                           "accelerator-size-group", accel_size_group,
-                           "title-size-group", desc_size_group,
-                           "visible", TRUE,
-                           NULL);
-      g_queue_push_head (parser_data->stack, g_object_ref_sink (item));
-    }
-  else if (g_strcmp0 (element_name, "gesture") == 0)
-    {
-      GtkSizeGroup *accel_size_group;
-      GtkSizeGroup *desc_size_group;
-
-      if (!check_parent (context, "group", error))
-        return;
-
-      accel_size_group = g_queue_peek_head (parser_data->column_image_size_groups);
-      desc_size_group = g_queue_peek_head (parser_data->column_desc_size_groups);
-
-      parser_data->search_item = g_object_new (GTK_TYPE_SHORTCUTS_GESTURE,
-                                               "visible", TRUE,
-                                               NULL);
-
-      item = g_object_new (GTK_TYPE_SHORTCUTS_GESTURE,
-                           "desc-size-group", desc_size_group,
-                           "icon-size-group", accel_size_group,
-                           "visible", TRUE,
-                           NULL);
-      g_queue_push_head (parser_data->stack, g_object_ref_sink (item));
-    }
-  else if (g_strcmp0 (element_name, "property") == 0)
-    {
-      const gchar *name = NULL;
-      const gchar *translatable = NULL;
-
-      item = g_queue_peek_head (parser_data->stack);
-
-      if (item == NULL)
-        {
-          g_set_error (error,
-                       GTK_BUILDER_ERROR,
-                       GTK_BUILDER_ERROR_INVALID_TAG,
-                       "Property called without a parent object");
-          return;
-        }
-
-      if (!g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
-                                        G_MARKUP_COLLECT_STRING, "name", &name,
-                                        G_MARKUP_COLLECT_OPTIONAL | G_MARKUP_COLLECT_STRING, "translatable", 
&translatable,
-                                        G_MARKUP_COLLECT_INVALID))
-        return;
-
-      g_free (parser_data->property_name);
-      parser_data->property_name = g_strdup (name);
-      parser_data->translatable = (g_strcmp0 (translatable, "yes") == 0);
-    }
-  else
-    {
-      const GSList *stack;
-      const gchar *parent_name;
-      const gchar *our_name;
-      gint line;
-      gint col;
-
-      stack = g_markup_parse_context_get_element_stack (context);
-      our_name = stack->data;
-      parent_name = stack->next ? stack->next->data : "";
-
-      g_markup_parse_context_get_position (context, &line, &col);
-      g_set_error (error,
-                   GTK_BUILDER_ERROR,
-                   GTK_BUILDER_ERROR_INVALID_TAG,
-                   "%d:%d: Unknown element <%s> found in <%s>.",
-                   line, col, our_name, parent_name);
-    }
-}
-
-static void
-sections_parser_end_element (GMarkupParseContext  *context,
-                          const gchar          *element_name,
-                          gpointer              user_data,
-                          GError              **error)
-{
-  ViewsParserData *parser_data = user_data;
-  GtkWidget *item;
-
-  if (g_strcmp0 (element_name, "section") == 0)
-    {
-      item = g_queue_pop_head (parser_data->stack);
-      gtk_shortcuts_window_add_section (parser_data->self, GTK_SHORTCUTS_SECTION (item));
-      g_object_unref (item);
-    }
-  else if ((g_strcmp0 (element_name, "page") == 0) ||
-           (g_strcmp0 (element_name, "column") == 0) ||
-           (g_strcmp0 (element_name, "group") == 0) ||
-           (g_strcmp0 (element_name, "shortcut") == 0) ||
-           (g_strcmp0 (element_name, "gesture") == 0))
-    {
-      GtkWidget *parent;
-
-      item = g_queue_pop_head (parser_data->stack);
-      parent = g_queue_peek_head (parser_data->stack);
-      if (item != NULL && parent != NULL)
-        gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (item));
-      g_clear_object (&item);
-
-      if ((g_strcmp0 (element_name, "shortcut") == 0) ||
-          (g_strcmp0 (element_name, "gesture") == 0))
-        {
-          gtk_shortcuts_window_add_search_item (parser_data->self, parser_data->search_item);
-          parser_data->search_item = NULL;
-        }
-
-      if (g_strcmp0 (element_name, "column") == 0)
-        {
-          GtkSizeGroup *size_group;
-
-          size_group = g_queue_pop_head (parser_data->column_image_size_groups);
-          g_clear_object (&size_group);
-
-          size_group = g_queue_pop_head (parser_data->column_desc_size_groups);
-          g_clear_object (&size_group);
-        }
-    }
-  else if (g_strcmp0 (element_name, "property") == 0)
-    {
-      g_clear_pointer (&parser_data->property_name, g_free);
-    }
-}
-
-static void
-sections_parser_text (GMarkupParseContext  *context,
-                   const gchar          *text,
-                   gsize                 text_len,
-                   gpointer              user_data,
-                   GError              **error)
-{
-  ViewsParserData *parser_data = user_data;
-  GParamSpec *pspec;
-  GtkWidget *item;
-  GValue value = { 0 };
-
-  if (parser_data->property_name == NULL)
-    return;
-
-  item = g_queue_peek_head (parser_data->stack);
-
-  if (item == NULL)
-    return;
-
-  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (item), parser_data->property_name);
-
-  if (pspec == NULL)
-    {
-      g_set_error (error,
-                   GTK_BUILDER_ERROR,
-                   GTK_BUILDER_ERROR_INVALID_PROPERTY,
-                   "No such property: %s",
-                   parser_data->property_name);
-      return;
-    }
-
-  if (parser_data->translatable)
-    text = _(text);
-
-  if (g_type_is_a (pspec->value_type, G_TYPE_OBJECT))
-    {
-      GObject *relative;
-
-      relative = gtk_builder_get_object (parser_data->builder, text);
-
-      if (relative == NULL)
-        {
-          g_set_error (error,
-                       GTK_BUILDER_ERROR,
-                       GTK_BUILDER_ERROR_INVALID_VALUE,
-                       "Unknown object for property '%s': %s",
-                       parser_data->property_name,
-                       text);
-          return;
-        }
-
-      g_value_init (&value, pspec->value_type);
-      g_value_set_object (&value, relative);
-    }
-  else if (!gtk_builder_value_from_string (parser_data->builder,
-                                           pspec, text, &value, error))
-    return;
-
-  if (parser_data->search_item != NULL)
-    g_object_set_property (G_OBJECT (parser_data->search_item),
-                           parser_data->property_name,
-                           &value);
-  g_object_set_property (G_OBJECT (item), parser_data->property_name, &value);
-  g_value_unset (&value);
-}
-
-static GMarkupParser ViewsParser = {
-  sections_parser_start_element,
-  sections_parser_end_element,
-  sections_parser_text,
-};
-
-static gboolean
-gtk_shortcuts_window_custom_tag_start (GtkBuildable  *buildable,
-                                      GtkBuilder    *builder,
-                                      GObject       *child,
-                                      const gchar   *tagname,
-                                      GMarkupParser *parser,
-                                      gpointer      *data)
-{
-  if (g_strcmp0 (tagname, "sections") == 0)
-    {
-      ViewsParserData *parser_data;
-
-      parser_data = g_slice_new0 (ViewsParserData);
-      parser_data->self = g_object_ref (buildable);
-      parser_data->builder = g_object_ref (builder);
-      parser_data->stack = g_queue_new ();
-      parser_data->column_image_size_groups = g_queue_new ();
-      parser_data->column_desc_size_groups = g_queue_new ();
-
-      *parser = ViewsParser;
-      *data = parser_data;
-
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-static void
-gtk_shortcuts_window_custom_finished (GtkBuildable *buildable,
-                                     GtkBuilder   *builder,
-                                     GObject      *child,
-                                     const gchar  *tagname,
-                                     gpointer      user_data)
-{
-  if (g_strcmp0 (tagname, "sections") == 0)
-    {
-      ViewsParserData *parser_data = user_data;
-
-      g_object_unref (parser_data->self);
-      g_object_unref (parser_data->builder);
-      g_queue_free_full (parser_data->stack, (GDestroyNotify)g_object_unref);
-      g_queue_free_full (parser_data->column_image_size_groups, (GDestroyNotify)g_object_unref);
-      g_queue_free_full (parser_data->column_desc_size_groups, (GDestroyNotify)g_object_unref);
-      g_slice_free (ViewsParserData, parser_data);
+        gtk_stack_set_visible_child_name (priv->stack, priv->last_section_name);
     }
 }
 
@@ -807,13 +434,6 @@ gtk_shortcuts_window_finalize (GObject *object)
 }
 
 static void
-gtk_buildable_iface_init (GtkBuildableIface *iface)
-{
-  iface->custom_tag_start = gtk_shortcuts_window_custom_tag_start;
-  iface->custom_finished = gtk_shortcuts_window_custom_finished;
-}
-
-static void
 gtk_shortcuts_window_get_property (GObject    *object,
                                   guint       prop_id,
                                   GValue     *value,
@@ -908,8 +528,6 @@ gtk_shortcuts_window_class_init (GtkShortcutsWindowClass *klass)
                                  0);
   gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0);
 
-  g_type_ensure (GTK_TYPE_SHORTCUTS_PAGE);
-  g_type_ensure (GTK_TYPE_SHORTCUTS_COLUMN);
   g_type_ensure (GTK_TYPE_SHORTCUTS_GROUP);
   g_type_ensure (GTK_TYPE_SHORTCUTS_GESTURE);
   g_type_ensure (GTK_TYPE_SHORTCUTS_SHORTCUT);



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