[gtk+/wip/baedert/gtkimageview: 142/228] demo: Add scale spinbutton back



commit 3ae65332d7cf62cdcb8b91d5961abb39c154e549
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 18 18:22:12 2016 +0100

    demo: Add scale spinbutton back

 demos/gtk-demo/image_view.c  |    4 +-
 demos/gtk-demo/image_view.ui |   76 ++++++++++++++++--------------------------
 2 files changed, 31 insertions(+), 49 deletions(-)
---
diff --git a/demos/gtk-demo/image_view.c b/demos/gtk-demo/image_view.c
index 1cc8a33..45a9258 100644
--- a/demos/gtk-demo/image_view.c
+++ b/demos/gtk-demo/image_view.c
@@ -222,7 +222,7 @@ do_image_view (GtkWidget *do_widget)
   GtkAdjustment *angle_adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "angle_adjustment"));
 
 
-  gtk_window_set_title (GTK_WINDOW (window), "blue: current, green: anchor");
+  /*gtk_window_set_title (GTK_WINDOW (window), "blue: current, green: anchor");*/
 
   g_object_bind_property (scale_adjustment, "value", image_view, "scale",
                           G_BINDING_BIDIRECTIONAL);
@@ -237,7 +237,7 @@ do_image_view (GtkWidget *do_widget)
   gtk_container_add (GTK_CONTAINER (window), box);
   gtk_builder_connect_signals (builder, NULL);
 
-  /*gtk_window_resize (GTK_WINDOW (window), 800, 600);*/
+  gtk_window_resize (GTK_WINDOW (window), 800, 600);
   gtk_widget_show_all (window);
   return window;
 }
diff --git a/demos/gtk-demo/image_view.ui b/demos/gtk-demo/image_view.ui
index a0ee884..c7df2c9 100644
--- a/demos/gtk-demo/image_view.ui
+++ b/demos/gtk-demo/image_view.ui
@@ -9,8 +9,8 @@
   <object class="GtkAdjustment" id="angle_adjustment">
     <property name="upper">360</property>
     <property name="value">3</property>
-    <!--<property name="step_increment">0.1</property>-->
-    <property name="step_increment">1</property>
+    <property name="step_increment">0.1</property>
+    <!--<property name="step_increment">1</property>-->
     <!--<property name="step_increment">45</property>-->
   </object>
 
@@ -193,20 +193,34 @@
         </child>
 
 
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">Scale</property>
+            <property name="halign">start</property>
+            <property name="xalign">0.0</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">12</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+
+        <child>
+          <object class="GtkSpinButton" id="scale_spin_button">
+            <property name="visible">true</property>
+            <property name="digits">2</property>
+            <property name="numeric">true</property>
+            <property name="adjustment">scale_adjustment</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">13</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
 
-        <!--<child>-->
-          <!--<object class="GtkScale" id="angle_scale">-->
-            <!--<property name="visible">true</property>-->
-            <!--<property name="draw_value">true</property>-->
-            <!--<property name="adjustment">angle_adjustment</property>-->
-            <!--<signal name="format-value" handler="angle_scale_format_value_cb" />-->
-          <!--</object>-->
-          <!--<packing>-->
-            <!--<property name="left_attach">0</property>-->
-            <!--<property name="top_attach">11</property>-->
-            <!--<property name="width">2</property>-->
-          <!--</packing>-->
-        <!--</child>-->
 
         <child>
           <object class="GtkBox">
@@ -246,43 +260,11 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">12</property>
-            <property name="width">2</property>
-          </packing>
-        </child>
-
-
-        <child>
-          <object class="GtkLabel">
-            <property name="visible">false</property>
-            <property name="no_show_all">true</property>
-            <property name="label" translatable="yes">Scale</property>
-            <property name="margin_top">12</property>
-            <property name="halign">start</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">13</property>
-            <property name="width">2</property>
-          </packing>
-        </child>
-
-        <child>
-          <object class="GtkScale" id="scale_scale">
-            <property name="visible">false</property>
-            <property name="no_show_all">true</property>
-            <property name="draw_value">true</property>
-            <property name="adjustment">scale_adjustment</property>
-            <signal name="format-value" handler="scale_scale_format_value_cb" />
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
             <property name="top_attach">14</property>
             <property name="width">2</property>
           </packing>
         </child>
 
-
       </object>
 
     </child>


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