Simplify handling of adjustments
The relationship between adjustments and scrollbars and scrollable widgets was much more complex than it needed to be. StScrollView: Have the scroll view own a pair of adjustments, set them on the child on add(), remove unnecessary change notification signal connections. StBoxLayout: Remove auto-create of adjustments, just take the adjustments from the scrollbars and set them on the scrollable child. Notify for hadjustment/vadjustment properties. StScrollBar: Notify adjustment property. StScrollable: Document how adjustment setting works. https://bugzilla.gnome.org/show_bug.cgi?id=611740
This commit is contained in:
@ -1143,6 +1143,10 @@ st_scroll_bar_set_adjustment (StScrollBar *bar,
|
||||
g_return_if_fail (ST_IS_SCROLL_BAR (bar));
|
||||
|
||||
priv = bar->priv;
|
||||
|
||||
if (adjustment == priv->adjustment)
|
||||
return;
|
||||
|
||||
if (priv->adjustment)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
||||
@ -1168,6 +1172,8 @@ st_scroll_bar_set_adjustment (StScrollBar *bar,
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (bar));
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (bar), "adjustment");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user