[gtk+/wip/baedert/gtkimageview: 194/232] demo: Use switches instead of checkbuttons



commit b256ba0e680a1d9a9b18a965d3920cd7fe0328f0
Author: Timm Bäder <mail baedert org>
Date:   Mon Feb 8 14:57:54 2016 +0100

    demo: Use switches instead of checkbuttons

 demos/gtk-demo/image_view.c  |    4 ++--
 demos/gtk-demo/image_view.ui |   37 +++++++++++++++++++++++--------------
 2 files changed, 25 insertions(+), 16 deletions(-)
---
diff --git a/demos/gtk-demo/image_view.c b/demos/gtk-demo/image_view.c
index 9ef020b..651e78f 100644
--- a/demos/gtk-demo/image_view.c
+++ b/demos/gtk-demo/image_view.c
@@ -214,7 +214,7 @@ do_image_view (GtkWidget *do_widget)
   GtkWidget *window   = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   GtkBuilder *builder = gtk_builder_new_from_resource ("/imageview/image_view.ui");
   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 *snap_angle_switch = GTK_WIDGET (gtk_builder_get_object (builder, "snap_angle_switch"));
   GtkWidget *fit_allocation_switch = GTK_WIDGET (gtk_builder_get_object (builder, "fit_allocation_switch"));
   GtkWidget *rotate_gesture_switch = GTK_WIDGET (gtk_builder_get_object (builder, "rotate_gesture_switch"));
   GtkWidget *zoom_gesture_switch = GTK_WIDGET (gtk_builder_get_object (builder, "zoom_gesture_switch"));
@@ -237,7 +237,7 @@ do_image_view (GtkWidget *do_widget)
 
 
 
-  g_object_bind_property (image_view, "snap-angle", snap_angle_button, "active",
+  g_object_bind_property (image_view, "snap-angle", snap_angle_switch, "active",
                           G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
   g_object_bind_property (image_view, "fit-allocation", fit_allocation_switch, "active",
                           G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
diff --git a/demos/gtk-demo/image_view.ui b/demos/gtk-demo/image_view.ui
index a22af29..9041080 100644
--- a/demos/gtk-demo/image_view.ui
+++ b/demos/gtk-demo/image_view.ui
@@ -133,7 +133,6 @@
           <packing>
             <property name="left_attach">0</property>
             <property name="top_attach">6</property>
-            <property name="width">1</property>
           </packing>
         </child>
 
@@ -160,7 +159,6 @@
           <packing>
             <property name="left_attach">0</property>
             <property name="top_attach">7</property>
-            <property name="width">1</property>
           </packing>
         </child>
 
@@ -186,7 +184,6 @@
           <packing>
             <property name="left_attach">0</property>
             <property name="top_attach">8</property>
-            <property name="width">1</property>
           </packing>
         </child>
 
@@ -211,7 +208,6 @@
           <packing>
             <property name="left_attach">0</property>
             <property name="top_attach">9</property>
-            <property name="width">1</property>
           </packing>
         </child>
 
@@ -224,29 +220,40 @@
            <property name="left_attach">1</property>
            <property name="top_attach">9</property>
          </packing>
-        </child>
-
+       </child>
 
+       <child>
+         <object class="GtkLabel">
+           <property name="visible">true</property>
+           <property name="label" translatable="yes">Snap Angle</property>
+           <property name="halign">start</property>
+         </object>
+         <packing>
+           <property name="left_attach">0</property>
+           <property name="top_attach">10</property>
+         </packing>
+       </child>
 
         <child>
-          <object class="GtkLabel">
+          <object class="GtkSwitch" id="snap_angle_switch">
             <property name="visible">true</property>
-            <property name="label" translatable="yes">Angle</property>
-            <property name="margin_top">12</property>
-            <property name="halign">start</property>
           </object>
           <packing>
-            <property name="left_attach">0</property>
+            <property name="left_attach">1</property>
             <property name="top_attach">10</property>
-            <property name="width">2</property>
           </packing>
         </child>
 
 
         <child>
-          <object class="GtkCheckButton" id="snap_angle_check_button">
+          <object class="GtkLabel">
             <property name="visible">true</property>
-            <property name="label" translatable="yes">Snap angle</property>
+            <property name="label" translatable="yes">Angle</property>
+            <property name="margin_top">12</property>
+            <property name="halign">start</property>
+            <attributes>
+              <attribute name="weight" value="bold" />
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">0</property>
@@ -256,6 +263,8 @@
         </child>
 
 
+
+
         <child>
           <object class="GtkScale" id="angle_spin_button">
             <property name="visible">true</property>


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