[gtk+] gtk-demo: Add another shortcuts window example



commit 5d3f28192c4af8261ca467ea09ddd73383d545b5
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 15 18:39:39 2015 -0500

    gtk-demo: Add another shortcuts window example
    
    The boxes shortcuts, taken straight from boxes.
    This demonstrates a problem with view filtering.

 demos/gtk-demo/demo.gresource.xml |    1 +
 demos/gtk-demo/shortcuts-boxes.ui |  167 +++++++++++++++++++++++++++++++++++++
 demos/gtk-demo/shortcuts.c        |   21 +++++
 demos/gtk-demo/shortcuts.ui       |   21 +++++
 4 files changed, 210 insertions(+), 0 deletions(-)
---
diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml
index 4dea3a0..d0e80f2 100644
--- a/demos/gtk-demo/demo.gresource.xml
+++ b/demos/gtk-demo/demo.gresource.xml
@@ -96,6 +96,7 @@
     <file>shortcuts-builder.ui</file>
     <file>shortcuts-gedit.ui</file>
     <file>shortcuts-clocks.ui</file>
+    <file>shortcuts-boxes.ui</file>
   </gresource>
   <gresource prefix="/revealer">
     <file>revealer.ui</file>
diff --git a/demos/gtk-demo/shortcuts-boxes.ui b/demos/gtk-demo/shortcuts-boxes.ui
new file mode 100644
index 0000000..6bcaf8a
--- /dev/null
+++ b/demos/gtk-demo/shortcuts-boxes.ui
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+
+  <object class="GtkShortcutsWindow" id="shortcuts-boxes">
+    <property name="modal">1</property>
+    
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <property name="max-height">12</property>
+
+        <!-- Overview shortcuts -->
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Overview</property>
+            <property name="view">overview</property>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F1</property>
+                <property name="title" translatable="yes">Help</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;n</property>
+                <property name="title" translatable="yes">Create a new box</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;f</property>
+                <property name="title" translatable="yes">Search</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;k</property>
+                <property name="title" translatable="yes">Keyboard shortcuts</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;q</property>
+                <property name="title" translatable="yes">Close Window/Quit Boxes</property>
+              </object>
+            </child>
+          </object>
+        </child>
+
+        <!-- Wizard and Properties shortcuts -->
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Box Creation and Properties</property>
+            <property name="view">wizard</property>
+
+            <!-- LTR -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">ltr</property>
+                <property name="accelerator">&lt;Alt&gt;Right</property>
+                <property name="title" translatable="yes">Switch to the next page</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">ltr</property>
+                <property name="accelerator">&lt;Alt&gt;Left</property>
+                <property name="title" translatable="yes">Switch to the previous page</property>
+              </object>
+            </child>
+
+            <!-- RTL -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">rtl</property>
+                <property name="accelerator">&lt;Alt&gt;Left</property>
+                <property name="title" translatable="yes">Switch to the next page</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">rtl</property>
+                <property name="accelerator">&lt;Alt&gt;Right</property>
+                <property name="title" translatable="yes">Switch to the previous page</property>
+              </object>
+            </child>
+          </object>
+        </child>
+
+        <!-- Display shortcuts -->
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Box Display</property>
+            <property name="view">display</property>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">Control_L+Alt_L</property>
+                <property name="title" translatable="yes">Grab/Ungrab keyboard</property>
+              </object>
+            </child>
+
+            <!-- LTR -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">ltr</property>
+                <property name="accelerator">&lt;Alt&gt;Left</property>
+                <property name="title" translatable="yes">Back to overview</property>
+              </object>
+            </child>
+
+            <!-- RTL -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">rtl</property>
+                <property name="accelerator">&lt;Alt&gt;Right</property>
+                <property name="title" translatable="yes">Back to overview</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;q</property>
+                <property name="title" translatable="yes">Close window/Quit Boxes</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F11</property>
+                <property name="title" translatable="yes">Fullscreen/Restore from fullscreen</property>
+              </object>
+            </child>
+          </object>
+        </child>
+
+      </object>
+    </child>
+  </object>
+
+</interface>
diff --git a/demos/gtk-demo/shortcuts.c b/demos/gtk-demo/shortcuts.c
index 6729984..dbe02f6 100644
--- a/demos/gtk-demo/shortcuts.c
+++ b/demos/gtk-demo/shortcuts.c
@@ -49,6 +49,24 @@ clocks_shortcuts_stopwatch (GtkWidget *window)
   show_shortcuts (window, "shortcuts-clocks", "stopwatch");
 }
 
+static void
+boxes_shortcuts (GtkWidget *window)
+{
+  show_shortcuts (window, "shortcuts-boxes", NULL);
+}
+
+static void
+boxes_shortcuts_wizard (GtkWidget *window)
+{
+  show_shortcuts (window, "shortcuts-boxes", "wizard");
+}
+
+static void
+boxes_shortcuts_display (GtkWidget *window)
+{
+  show_shortcuts (window, "shortcuts-boxes", "display");
+}
+
 GtkWidget *
 do_shortcuts (GtkWidget *do_widget)
 {
@@ -73,6 +91,9 @@ do_shortcuts (GtkWidget *do_widget)
                                         "gedit_shortcuts", G_CALLBACK (gedit_shortcuts),
                                         "clocks_shortcuts", G_CALLBACK (clocks_shortcuts),
                                         "clocks_shortcuts_stopwatch", G_CALLBACK 
(clocks_shortcuts_stopwatch),
+                                        "boxes_shortcuts", G_CALLBACK (boxes_shortcuts),
+                                        "boxes_shortcuts_wizard", G_CALLBACK (boxes_shortcuts_wizard),
+                                        "boxes_shortcuts_display", G_CALLBACK (boxes_shortcuts_display),
                                         NULL);
       gtk_builder_connect_signals (builder, NULL);
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
diff --git a/demos/gtk-demo/shortcuts.ui b/demos/gtk-demo/shortcuts.ui
index da480c7..cb64e1e 100644
--- a/demos/gtk-demo/shortcuts.ui
+++ b/demos/gtk-demo/shortcuts.ui
@@ -38,6 +38,27 @@
             <signal name="clicked" handler="clocks_shortcuts_stopwatch" swapped="1" object="window1"/>
           </object>
         </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Boxes</property>
+            <signal name="clicked" handler="boxes_shortcuts" swapped="1" object="window1"/>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Boxes - Wizard</property>
+            <signal name="clicked" handler="boxes_shortcuts_wizard" swapped="1" object="window1"/>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Boxes - Display</property>
+            <signal name="clicked" handler="boxes_shortcuts_display" swapped="1" object="window1"/>
+          </object>
+        </child>
       </object>
     </child>
   </object>


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