[gnome-shell] st/box-layout: Deprecate :pack-start property



commit 88a8bc7419c79c92ebd7c7af43861687cb871787
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jan 5 17:49:46 2022 +0100

    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>

 src/st/st-box-layout.c | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c
index 895e688acc..49eaa1948e 100644
--- a/src/st/st-box-layout.c
+++ b/src/st/st-box-layout.c
@@ -89,8 +89,7 @@ st_box_layout_get_property (GObject    *object,
       break;
 
     case PROP_PACK_START:
-      layout = clutter_actor_get_layout_manager (CLUTTER_ACTOR (object));
-      g_value_set_boolean (value, clutter_box_layout_get_pack_start (CLUTTER_BOX_LAYOUT (layout)));
+      g_value_set_boolean (value, FALSE);
       break;
 
     default:
@@ -113,7 +112,6 @@ st_box_layout_set_property (GObject      *object,
       break;
 
     case PROP_PACK_START:
-      st_box_layout_set_pack_start (box, g_value_get_boolean (value));
       break;
 
     default:
@@ -202,7 +200,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
                                 "Pack Start",
                                 "Whether to pack items at the start of the box",
                                 FALSE,
-                                ST_PARAM_READWRITE);
+                                ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
   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
  * @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
 st_box_layout_set_pack_start (StBoxLayout *box,
                               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:
  * @box: A #StBoxLayout
  *
- * Get the value of the #StBoxLayout:pack-start property.
- *
- * Returns: %TRUE if pack-start is enabled
+ * Returns: the value of the #StBoxLayout:pack-start property,
+ *   always %FALSE
  */
 gboolean
 st_box_layout_get_pack_start (StBoxLayout *box)
 {
-  g_return_val_if_fail (ST_IS_BOX_LAYOUT (box), FALSE);
-
-  return clutter_box_layout_get_pack_start (CLUTTER_BOX_LAYOUT (clutter_actor_get_layout_manager 
(CLUTTER_ACTOR (box))));
+  return FALSE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]