st/box-layout: Set layout manager type
Now that ClutterActor itself provides API to use a particular layout manager type, we can use that instead of our own mechanism. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3046>
This commit is contained in:
parent
e746b038ef
commit
ef2e96bb32
@ -158,13 +158,9 @@ on_layout_manager_notify (GObject *object,
|
|||||||
ClutterActor *actor = CLUTTER_ACTOR (object);
|
ClutterActor *actor = CLUTTER_ACTOR (object);
|
||||||
ClutterLayoutManager *layout = clutter_actor_get_layout_manager (actor);
|
ClutterLayoutManager *layout = clutter_actor_get_layout_manager (actor);
|
||||||
|
|
||||||
g_warn_if_fail (CLUTTER_IS_BOX_LAYOUT (layout));
|
|
||||||
|
|
||||||
if (layout == NULL)
|
if (layout == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_signal_connect_swapped (layout, "layout-changed",
|
|
||||||
G_CALLBACK (clutter_actor_queue_relayout), actor);
|
|
||||||
g_signal_connect (layout, "notify", G_CALLBACK (layout_notify), object);
|
g_signal_connect (layout, "notify", G_CALLBACK (layout_notify), object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +168,7 @@ static void
|
|||||||
st_box_layout_class_init (StBoxLayoutClass *klass)
|
st_box_layout_class_init (StBoxLayoutClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
||||||
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
|
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
|
||||||
|
|
||||||
object_class->get_property = st_box_layout_get_property;
|
object_class->get_property = st_box_layout_get_property;
|
||||||
@ -207,6 +204,8 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
|
|||||||
ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
|
ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, N_PROPS, props);
|
g_object_class_install_properties (object_class, N_PROPS, props);
|
||||||
|
|
||||||
|
clutter_actor_class_set_layout_manager_type (actor_class, CLUTTER_TYPE_BOX_LAYOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -216,7 +215,6 @@ st_box_layout_init (StBoxLayout *self)
|
|||||||
|
|
||||||
g_signal_connect (self, "notify::layout-manager",
|
g_signal_connect (self, "notify::layout-manager",
|
||||||
G_CALLBACK (on_layout_manager_notify), NULL);
|
G_CALLBACK (on_layout_manager_notify), NULL);
|
||||||
clutter_actor_set_layout_manager (CLUTTER_ACTOR (self), clutter_box_layout_new ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user