Commit da0975d5 authored by Mike Gorse's avatar Mike Gorse
Browse files

Gail: Take fill/page size into account when returning a range's maximum value

parent 6460fb6b
......@@ -190,6 +190,9 @@ gail_range_get_maximum_value (AtkValue *obj,
GValue *value)
GailRange *range;
GtkRange *gtk_range;
GtkAdjustment *gtk_adjustment;
gdouble max = 0;
g_return_if_fail (GAIL_IS_RANGE (obj));
......@@ -199,8 +202,20 @@ gail_range_get_maximum_value (AtkValue *obj,
* Adjustment has not been specified
atk_value_get_maximum_value (ATK_VALUE (range->adjustment), value);
gtk_range = GTK_RANGE (gtk_accessible_get_widget (GTK_ACCESSIBLE (range)));
g_return_if_fail (gtk_range);
gtk_adjustment = gtk_range_get_adjustment (gtk_range);
max = g_value_get_double (value);
max -= gtk_adjustment_get_page_size (gtk_adjustment);
if (gtk_range_get_restrict_to_fill_level (gtk_range))
max = MIN (max, gtk_range_get_fill_level (gtk_range));
g_value_set_double (value, max);
static void
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment