st/box-layout: Deprecate :pack-start property

A property for reversing the visible order of children is a bit odd.

It has also been unused by actual gnome-shell code since 2010, and the
somewhat related pack_start()/pack_end() API in GtkBox(Layout) is gone
in GTK4.

With that in mind, turn the property into a no-op and deprecate it,
so that it can be dropped next cycle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2085>
This commit is contained in:
Florian Müllner 2022-01-05 17:49:46 +01:00 committed by Marge Bot
parent f322e00ca5
commit 88a8bc7419

View File

@ -89,8 +89,7 @@ st_box_layout_get_property (GObject *object,
break; break;
case PROP_PACK_START: case PROP_PACK_START:
layout = clutter_actor_get_layout_manager (CLUTTER_ACTOR (object)); g_value_set_boolean (value, FALSE);
g_value_set_boolean (value, clutter_box_layout_get_pack_start (CLUTTER_BOX_LAYOUT (layout)));
break; break;
default: default:
@ -113,7 +112,6 @@ st_box_layout_set_property (GObject *object,
break; break;
case PROP_PACK_START: case PROP_PACK_START:
st_box_layout_set_pack_start (box, g_value_get_boolean (value));
break; break;
default: default:
@ -202,7 +200,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
"Pack Start", "Pack Start",
"Whether to pack items at the start of the box", "Whether to pack items at the start of the box",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
g_object_class_install_property (object_class, PROP_PACK_START, pspec); g_object_class_install_property (object_class, PROP_PACK_START, pspec);
} }
@ -282,37 +280,23 @@ st_box_layout_get_vertical (StBoxLayout *box)
* @box: A #StBoxLayout * @box: A #StBoxLayout
* @pack_start: %TRUE if the layout should use pack-start * @pack_start: %TRUE if the layout should use pack-start
* *
* Set the value of the #StBoxLayout:pack-start property. * Deprecated: No longer has any effect
*/ */
void void
st_box_layout_set_pack_start (StBoxLayout *box, st_box_layout_set_pack_start (StBoxLayout *box,
gboolean pack_start) gboolean pack_start)
{ {
ClutterBoxLayout *layout;
g_return_if_fail (ST_IS_BOX_LAYOUT (box));
layout = CLUTTER_BOX_LAYOUT (clutter_actor_get_layout_manager (CLUTTER_ACTOR (box)));
if (clutter_box_layout_get_pack_start (layout) != pack_start)
{
clutter_box_layout_set_pack_start (layout, pack_start);
g_object_notify (G_OBJECT (box), "pack-start");
}
} }
/** /**
* st_box_layout_get_pack_start: * st_box_layout_get_pack_start:
* @box: A #StBoxLayout * @box: A #StBoxLayout
* *
* Get the value of the #StBoxLayout:pack-start property. * Returns: the value of the #StBoxLayout:pack-start property,
* * always %FALSE
* Returns: %TRUE if pack-start is enabled
*/ */
gboolean gboolean
st_box_layout_get_pack_start (StBoxLayout *box) st_box_layout_get_pack_start (StBoxLayout *box)
{ {
g_return_val_if_fail (ST_IS_BOX_LAYOUT (box), FALSE); return FALSE;
return clutter_box_layout_get_pack_start (CLUTTER_BOX_LAYOUT (clutter_actor_get_layout_manager (CLUTTER_ACTOR (box))));
} }