[gtk+/wip/baedert/gtkimageview: 86/110] demo: Add rotate/scale gesture check buttons



commit 801ea657dc1c1f026b76a7ac50491b4d5b21139f
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 18 19:00:57 2016 +0100

    demo: Add rotate/scale gesture check buttons

 demos/gtk-demo/image_view.c  |   14 +++++++++++---
 demos/gtk-demo/image_view.ui |   39 +++++++++++++++++++++++++++++++++------
 2 files changed, 44 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/image_view.c b/demos/gtk-demo/image_view.c
index 45a9258..c339a66 100644
--- a/demos/gtk-demo/image_view.c
+++ b/demos/gtk-demo/image_view.c
@@ -214,9 +214,8 @@ do_image_view (GtkWidget *do_widget)
   GtkWidget *box      = GTK_WIDGET (gtk_builder_get_object (builder, "box"));
   GtkWidget *snap_angle_button = GTK_WIDGET (gtk_builder_get_object (builder, "snap_angle_check_button"));
   GtkWidget *fit_allocation_button = GTK_WIDGET (gtk_builder_get_object (builder, 
"fit_allocation_check_button"));
-  GtkWidget *header_bar = gtk_header_bar_new ();
-  gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header_bar), TRUE);
-  gtk_window_set_titlebar (GTK_WINDOW (window), header_bar);
+  GtkWidget *rotate_gesture_button = GTK_WIDGET (gtk_builder_get_object (builder, 
"rotate_gesture_check_button"));
+  GtkWidget *zoom_gesture_button = GTK_WIDGET (gtk_builder_get_object (builder, 
"zoom_gesture_check_button"));
 
   GtkAdjustment *scale_adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "scale_adjustment"));
   GtkAdjustment *angle_adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "angle_adjustment"));
@@ -233,6 +232,15 @@ do_image_view (GtkWidget *do_widget)
   g_object_bind_property (image_view, "fit-allocation", fit_allocation_button, "active",
                           G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
 
+  g_object_bind_property (image_view, "rotate-gesture-enabled",
+                          rotate_gesture_button, "active",
+                          G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+
+  g_object_bind_property (image_view, "zoom-gesture-enabled",
+                          zoom_gesture_button, "active",
+                          G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+
+
 
   gtk_container_add (GTK_CONTAINER (window), box);
   gtk_builder_connect_signals (builder, NULL);
diff --git a/demos/gtk-demo/image_view.ui b/demos/gtk-demo/image_view.ui
index c7df2c9..4438917 100644
--- a/demos/gtk-demo/image_view.ui
+++ b/demos/gtk-demo/image_view.ui
@@ -152,6 +152,33 @@
         </child>
 
         <child>
+          <object class="GtkCheckButton" id="zoom_gesture_check_button">
+            <property name="visible">true</property>
+            <property name="label">Zoom Gesture Enabled</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">8</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+
+        <child>
+          <object class="GtkCheckButton" id="rotate_gesture_check_button">
+            <property name="visible">true</property>
+            <property name="label">Rotate Gesture Enabled</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">9</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+
+
+
+
+        <child>
           <object class="GtkLabel">
             <property name="visible">true</property>
             <property name="label" translatable="yes">Angle</property>
@@ -160,7 +187,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">9</property>
+            <property name="top_attach">10</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -173,7 +200,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">10</property>
+            <property name="top_attach">11</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -187,7 +214,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">11</property>
+            <property name="top_attach">12</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -202,7 +229,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">12</property>
+            <property name="top_attach">13</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -216,7 +243,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">13</property>
+            <property name="top_attach">14</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -260,7 +287,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">14</property>
+            <property name="top_attach">15</property>
             <property name="width">2</property>
           </packing>
         </child>


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