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

This commit is contained in:
Mike Gorse 2010-09-10 06:11:08 -04:00
parent 88f54ea47d
commit e58f22a7ea

View File

@ -188,6 +188,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));
@ -197,8 +200,20 @@ gail_range_get_maximum_value (AtkValue *obj,
* Adjustment has not been specified
*/
return;
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