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:
Owen W. Taylor
2010-03-10 18:32:10 -05:00
parent 163b2d0403
commit 89173544d4
4 changed files with 84 additions and 230 deletions

View File

@ -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");
}
/**