st: Notify on BoxLayout property changes

We didn't do this before, but it might come in handy eventually,
so add change notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=703810
This commit is contained in:
Florian Müllner 2013-07-07 00:11:02 +02:00
parent 741b204fc7
commit 6a19b7c1b0

View File

@ -544,6 +544,18 @@ st_box_layout_style_changed (StWidget *self)
ST_WIDGET_CLASS (st_box_layout_parent_class)->style_changed (self);
}
static void
layout_notify (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
GObject *self = user_data;
const char *prop_name = g_param_spec_get_name (pspec);
if (g_object_class_find_property (G_OBJECT_GET_CLASS (self), prop_name))
g_object_notify (self, prop_name);
}
static void
st_box_layout_class_init (StBoxLayoutClass *klass)
{
@ -602,6 +614,7 @@ st_box_layout_init (StBoxLayout *self)
layout = clutter_box_layout_new ();
g_signal_connect_swapped (layout, "layout-changed",
G_CALLBACK (clutter_actor_queue_relayout), self);
g_signal_connect (layout, "notify", G_CALLBACK (layout_notify), self);
clutter_actor_set_layout_manager (CLUTTER_ACTOR (self), layout);
}