[gnome-shell] Revert "st/scrollview: Add ::content-padding property to StScrollView"



commit 078aca220d3cc094186d9715874007de0b2e4062
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jun 29 14:32:47 2022 -0300

    Revert "st/scrollview: Add ::content-padding property to StScrollView"
    
    This reverts commit 0d62dadfbc4532953668a976a2585369d753ae01.
    
    The only consumer of such API is now gone.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2335>

 src/st/st-scroll-view-fade.c |  8 --------
 src/st/st-scroll-view.c      | 39 ---------------------------------------
 2 files changed, 47 deletions(-)
---
diff --git a/src/st/st-scroll-view-fade.c b/src/st/st-scroll-view-fade.c
index 4cf45af1f2..77b1d0b120 100644
--- a/src/st/st-scroll-view-fade.c
+++ b/src/st/st-scroll-view-fade.c
@@ -99,7 +99,6 @@ st_scroll_view_fade_paint_target (ClutterOffscreenEffect *effect,
   gboolean h_scroll_visible, v_scroll_visible, rtl;
 
   ClutterActorBox allocation, content_box, paint_box;
-  ClutterMargin *content_padding;
 
   float fade_area_topleft[2];
   float fade_area_bottomright[2];
@@ -111,13 +110,6 @@ st_scroll_view_fade_paint_target (ClutterOffscreenEffect *effect,
   clutter_actor_get_allocation_box (self->actor, &allocation);
   st_theme_node_get_content_box (st_widget_get_theme_node (ST_WIDGET (self->actor)),
                                 (const ClutterActorBox *)&allocation, &content_box);
-  g_object_get (self->actor, "content-padding", &content_padding, NULL);
-
-  content_box.x1 += content_padding->left;
-  content_box.x2 -= content_padding->right;
-  content_box.y1 += content_padding->top;
-  content_box.y2 -= content_padding->bottom;
-  clutter_margin_free (content_padding);
 
   /*
    * The FBO is based on the paint_volume's size which can be larger then the actual
diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c
index cf13ccee0f..50de481944 100644
--- a/src/st/st-scroll-view.c
+++ b/src/st/st-scroll-view.c
@@ -84,8 +84,6 @@ struct _StScrollViewPrivate
   StAdjustment *vadjustment;
   ClutterActor *vscroll;
 
-  ClutterMargin content_padding;
-
   StPolicyType hscrollbar_policy;
   StPolicyType vscrollbar_policy;
 
@@ -118,7 +116,6 @@ enum {
   PROP_VSCROLLBAR_VISIBLE,
   PROP_MOUSE_SCROLL,
   PROP_OVERLAY_SCROLLBARS,
-  PROP_CONTENT_PADDING,
 
   N_PROPS
 };
@@ -159,9 +156,6 @@ st_scroll_view_get_property (GObject    *object,
     case PROP_OVERLAY_SCROLLBARS:
       g_value_set_boolean (value, priv->overlay_scrollbars);
       break;
-    case PROP_CONTENT_PADDING:
-      g_value_set_boxed (value, &priv->content_padding);
-      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -208,23 +202,6 @@ st_scroll_view_update_fade_effect (StScrollView  *scroll,
     }
 }
 
-static void
-st_scroll_view_set_content_padding (StScrollView  *scroll,
-                                    ClutterMargin *content_padding)
-{
-  StScrollViewPrivate *priv = ST_SCROLL_VIEW (scroll)->priv;
-
-  if (priv->content_padding.left == content_padding->left &&
-      priv->content_padding.right == content_padding->right &&
-      priv->content_padding.top == content_padding->top &&
-      priv->content_padding.bottom == content_padding->bottom)
-    return;
-
-  priv->content_padding = *content_padding;
-
-  g_object_notify_by_pspec (G_OBJECT (scroll), props[PROP_CONTENT_PADDING]);
-}
-
 static void
 st_scroll_view_set_property (GObject      *object,
                              guint         property_id,
@@ -254,10 +231,6 @@ st_scroll_view_set_property (GObject      *object,
                                  priv->hscrollbar_policy,
                                  g_value_get_enum (value));
       break;
-    case PROP_CONTENT_PADDING:
-      st_scroll_view_set_content_padding (self,
-                                          (ClutterMargin *)g_value_get_boxed (value));
-      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -570,11 +543,6 @@ st_scroll_view_allocate (ClutterActor          *actor,
 
   st_theme_node_get_content_box (theme_node, box, &content_box);
 
-  content_box.x1 += priv->content_padding.left;
-  content_box.x2 -= priv->content_padding.right;
-  content_box.y1 += priv->content_padding.top;
-  content_box.y2 += priv->content_padding.bottom;
-
   avail_width = content_box.x2 - content_box.x1;
   avail_height = content_box.y2 - content_box.y1;
 
@@ -966,13 +934,6 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                           FALSE,
                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
-  props[PROP_CONTENT_PADDING] =
-    g_param_spec_boxed ("content-padding",
-                        "Content padding",
-                        "Content padding",
-                        CLUTTER_TYPE_MARGIN,
-                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
-
   g_object_class_install_properties (object_class, N_PROPS, props);
 }
 


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