2008-12-12 Claudio Saavedra <csaavedra@igalia.com>
authorClaudio Saavedra <csaavedra@igalia.com>
Fri, 12 Dec 2008 10:57:32 +0000 (10:57 +0000)
committerClaudio Saavedra <csaavedra@igalia.com>
Fri, 12 Dec 2008 10:57:32 +0000 (10:57 +0000)
Based on a patch by Christian Dywan (christian@imendio.com)

* src/hildon-gtk.c: (+hildon_gtk_hscale_new): Create a hildonized style
GtkHScale.
* src/hildon-gtk.h: Add definition.

Fixes: NB#93744 (Tapping should jump to location on GtkScale)

ChangeLog
src/hildon-gtk.c
src/hildon-gtk.h

index 002d8a8..e0d2805 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-12-12  Claudio Saavedra  <csaavedra@igalia.com>
+
+       Based on a patch by Christian Dywan (christian@imendio.com)
+
+       * src/hildon-gtk.c: (+hildon_gtk_hscale_new): Create a hildonized style
+       GtkHScale.
+       * src/hildon-gtk.h: Add definition.
+
+       Fixes: NB#93744 (Tapping should jump to location on GtkScale)
+
 2008-12-11  Claudio Saavedra  <csaavedra@igalia.com>
 
        * src/hildon-picker-button.c: (hildon_picker_button_init),
index 48949e7..368dd34 100644 (file)
@@ -308,3 +308,33 @@ hildon_gtk_window_set_progress_indicator        (GtkWindow    *window,
                    atom, XA_INTEGER, 32, PropModeReplace,
                    (guchar *)&state, 1);
 }
+
+/**
+ * hildon_gtk_hscale_new:
+ * @void: 
+ *
+ * Creates a new horizontal scale widget that lets the user select
+ * a value. The value is technically a double between 0.0 and 1.0.
+ * See gtk_adjustment_configure() for reconfiguring the adjustment.
+ *
+ * The scale is hildonized, which means that a click or tap immediately
+ * jumps to the desired position, see gtk_range_set_relative_steps().
+ * Further more the value is not displayed, see gtk_scale_set_draw_value().
+ *
+ * Returns: a new hildonized #GtkHScale
+ *
+ * Since: 2.2
+ **/
+GtkWidget*
+hildon_gtk_hscale_new                           (void)
+{
+  GtkWidget *scale = gtk_hscale_new_with_range (0.0, 1.0, 0.1);
+  g_object_set (scale,
+                "draw-value", FALSE,
+#ifdef MAEMO_GTK
+                "relative-steps", FALSE,
+#endif
+                NULL);
+
+  return scale;
+}
index 318b446..887637b 100644 (file)
@@ -66,6 +66,9 @@ void
 hildon_gtk_window_set_progress_indicator        (GtkWindow    *window,
                                                  guint        state);
 
+GtkWidget*
+hildon_gtk_hscale_new                           (void);
+
 G_END_DECLS
 
 #endif /* __HILDON_GTK_H__ */