]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkhscale.c
Fixes #75510
[~andy/gtk] / gtk / gtkhscale.c
index e940d50428ee98e0c187e35e837f4bf3acf04f38..3d8df65d6984814ecaad1814a7e2a57c93276234 100644 (file)
@@ -110,10 +110,10 @@ gtk_hscale_new (GtkAdjustment *adjustment)
  * @max: maximum value
  * @step: step increment (tick size) used with keyboard shortcuts
  * 
- * Creates a new horizontal scale widget that lets the user
- * input a number between @min and @max with the increment @step.
- * @step must be nonzero; it's the distance the slider moves when
- * using the arrow keys to adjust the scale value.
+ * Creates a new horizontal scale widget that lets the user input a
+ * number between @min and @max (including @min and @max) with the
+ * increment @step.  @step must be nonzero; it's the distance the
+ * slider moves when using the arrow keys to adjust the scale value.
  * 
  * Return value: a new #GtkHScale
  **/
@@ -129,7 +129,7 @@ gtk_hscale_new_with_range (gdouble min,
   g_return_val_if_fail (min < max, NULL);
   g_return_val_if_fail (step != 0.0, NULL);
 
-  adj = gtk_adjustment_new (min, min, max, step, 10 * step, step);
+  adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0);
   
   scale = g_object_new (GTK_TYPE_HSCALE,
                         "adjustment", adj,
@@ -159,7 +159,13 @@ gtk_hscale_expose (GtkWidget      *widget,
   range = GTK_RANGE (widget);
   scale = GTK_SCALE (widget);
   hscale = GTK_HSCALE (widget);
-  
+
+  /* We need to chain up _first_ so the various geometry members of
+   * GtkRange struct are updated.
+   */
+  if (GTK_WIDGET_CLASS (parent_class)->expose_event)
+    GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+
   if (scale->draw_value)
     {
       PangoLayout *layout;
@@ -211,6 +217,9 @@ gtk_hscale_expose (GtkWidget      *widget,
           y = 0;
           break;
         }
+
+      x += widget->allocation.x;
+      y += widget->allocation.y;
       
       state_type = GTK_STATE_NORMAL;
       if (!GTK_WIDGET_IS_SENSITIVE (scale))
@@ -228,6 +237,6 @@ gtk_hscale_expose (GtkWidget      *widget,
 
       g_object_unref (G_OBJECT (layout));
     }
-
-  return (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+  
+  return FALSE;
 }