Adding a patch from Tommi Komulainen to pass the correct timestamp and button to...
[hildon] / src / hildon-seekbar.c
index 9182a49..0fe4fe4 100644 (file)
@@ -8,7 +8,7 @@
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; version 2.1 of
- * the License.
+ * the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,7 +24,7 @@
 
 /**
  * SECTION:hildon-seekbar
- * @short_description: A widget used to identify a place from a content
+ * @short_description: A widget used to identify a place from a content.
  *
  * HildonSeekbar allows seeking in media with a range widget.  It
  * supports for setting or getting the length (total time) of the media,
@@ -423,7 +423,11 @@ hildon_seekbar_get_fraction                     (HildonSeekbar *seekbar)
 {
     g_return_val_if_fail (HILDON_IS_SEEKBAR (seekbar), 0);
 
-    return osso_gtk_range_get_stream_position (GTK_RANGE(seekbar));
+#ifdef MAEMO_GTK
+    return gtk_range_get_fill_level (GTK_RANGE (seekbar));
+#else
+    return 0;
+#endif
 }
 
 /**
@@ -447,13 +451,15 @@ hildon_seekbar_set_fraction                     (HildonSeekbar *seekbar,
             fraction >= range->adjustment->lower);
 
     /* Set to show stream indicator. */
-    g_object_set (G_OBJECT (seekbar), "stream_indicator", TRUE, NULL);
+    g_object_set (G_OBJECT (seekbar), "show-fill-level", TRUE, NULL);
 
     fraction = CLAMP (fraction, range->adjustment->lower,
             range->adjustment->upper);
 
+#ifdef MAEMO_GTK 
     /* Update stream position of range widget */
-    osso_gtk_range_set_stream_position (range, fraction);
+    gtk_range_set_fill_level (range, fraction);
+#endif
 
     if (fraction < hildon_seekbar_get_position(seekbar))
         hildon_seekbar_set_position(seekbar, fraction);
@@ -504,7 +510,12 @@ hildon_seekbar_set_position                     (HildonSeekbar *seekbar,
     value = floor (adj->value);
     if (time != value) {
         value = (time < adj->upper) ? time : adj->upper;
-        if (value <= osso_gtk_range_get_stream_position (range)) {
+
+#ifdef MAEMO_GTK 
+        if (value <= gtk_range_get_fill_level (range)) {
+#else
+        if (value) {
+#endif
             adj->value = value;
             gtk_adjustment_value_changed (adj);