scale: Fix GTK_POS_TOP marks and value order
If both marks are set on top, and the value is drawn on top, the value should be drawn outside the marks for a horizontal scale. Currently, that order is incorrect, with the marks shifted up and the value drawn between the slider and the marks. This fixes that order.
This commit is contained in:
@@ -382,7 +382,7 @@ gtk_scale_allocate_value (GtkScale *scale)
|
||||
|
||||
case GTK_POS_TOP:
|
||||
value_alloc.x = slider_center_x - value_alloc.width / 2;
|
||||
value_alloc.y = slider_bounds.origin.y - value_alloc.height;
|
||||
value_alloc.y = 0;
|
||||
break;
|
||||
|
||||
case GTK_POS_BOTTOM:
|
||||
@@ -582,7 +582,7 @@ gtk_scale_size_allocate (GtkWidget *widget,
|
||||
&marks_height, NULL,
|
||||
NULL, NULL);
|
||||
marks_rect.x = 0;
|
||||
marks_rect.y = 0;
|
||||
marks_rect.y = range_rect.y - marks_height;
|
||||
marks_rect.width = range_rect.width;
|
||||
marks_rect.height = marks_height;
|
||||
gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect, -1);
|
||||
|
||||
Reference in New Issue
Block a user