gtkrange: Add some checks to gtk_range_set_slider_size_fixed()

Recalculate layout only if the range is already mapped and
adjustment is not NULL.
This commit is contained in:
Javier Jardón 2010-08-13 17:06:10 +02:00
parent 65a28efc15
commit d38bf4825a

View File

@ -961,9 +961,12 @@ gtk_range_set_slider_size_fixed (GtkRange *range,
{
range->slider_size_fixed = size_fixed ? TRUE : FALSE;
range->need_recalc = TRUE;
gtk_range_calc_layout (range, range->adjustment->value);
gtk_widget_queue_draw (GTK_WIDGET (range));
if (range->adjustment && gtk_widget_get_mapped (GTK_WIDGET (range)))
{
range->need_recalc = TRUE;
gtk_range_calc_layout (range, gtk_adjustment_get_value (range->adjustment));
gtk_widget_queue_draw (GTK_WIDGET (range));
}
}
}