[libdazzle] example: add some panels



commit 2e1e46dec75c6de395eed1d528d9c9613ff34d9a
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jun 17 16:23:59 2017 -0700

    example: add some panels
    
    This is just a quick test so that we can ensure the panels work as expected.

 examples/app/example-window.c  |    8 +++++
 examples/app/example-window.ui |   60 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 0 deletions(-)
---
diff --git a/examples/app/example-window.c b/examples/app/example-window.c
index 3951a1f..8986cff 100644
--- a/examples/app/example-window.c
+++ b/examples/app/example-window.c
@@ -135,6 +135,8 @@ static void
 example_window_init (ExampleWindow *self)
 {
   DzlShortcutController *controller;
+  g_autoptr(GPropertyAction) left = NULL;
+  g_autoptr(GPropertyAction) right = NULL;
 
   gtk_widget_init_template (GTK_WIDGET (self));
   dzl_shortcut_manager_add_shortcut_entries (NULL, shortcuts, G_N_ELEMENTS (shortcuts), GETTEXT_PACKAGE);
@@ -152,6 +154,12 @@ example_window_init (ExampleWindow *self)
                             dzl_shortcut_manager_get_default ());
 
   g_action_map_add_action_entries (G_ACTION_MAP (self), actions, G_N_ELEMENTS (actions), self);
+
+  left = g_property_action_new ("show-left-panel", self->dockbin, "left-visible");
+  right = g_property_action_new ("show-right-panel", self->dockbin, "right-visible");
+
+  g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (left));
+  g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (right));
 }
 
 GtkWidget *
diff --git a/examples/app/example-window.ui b/examples/app/example-window.ui
index 28198bd..cf80227 100644
--- a/examples/app/example-window.ui
+++ b/examples/app/example-window.ui
@@ -20,6 +20,41 @@
             <property name="pack-type">start</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">true</property>
+            <style>
+              <class name="linked"/>
+            </style>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="visible">true</property>
+                <property name="action-name">win.show-left-panel</property>
+                <child>
+                  <object class="GtkImage">
+                    <property name="icon-name">panel-left-pane-symbolic</property>
+                    <property name="visible">true</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToggleButton">
+                <property name="visible">true</property>
+                <property name="action-name">win.show-right-panel</property>
+                <child>
+                  <object class="GtkImage">
+                    <property name="icon-name">panel-right-pane-symbolic</property>
+                    <property name="visible">true</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack-type">end</property>
+          </packing>
+        </child>
       </object>
     </child>
     <child>
@@ -44,6 +79,7 @@
             </child>
             <child>
               <object class="GtkNotebook" id="notebook">
+                <property name="show-border">false</property>
                 <property name="visible">true</property>
               </object>
               <packing>
@@ -52,6 +88,30 @@
             </child>
           </object>
         </child>
+        <child type="left">
+          <object class="GtkBox">
+            <property name="orientation">vertical</property>
+            <property name="visible">true</property>
+            <child>
+              <object class="GtkLabel">
+                <property name="label">Left</property>
+                <property name="visible">true</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="right">
+          <object class="GtkBox">
+            <property name="orientation">vertical</property>
+            <property name="visible">true</property>
+            <child>
+              <object class="GtkLabel">
+                <property name="label">Right</property>
+                <property name="visible">true</property>
+              </object>
+            </child>
+          </object>
+        </child>
       </object>
     </child>
   </template>


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