[gnome-shell] st: Make st_scroll_view_update_fade_effect() public



commit 6fb044f3512bddf4fca2ddeec1562e153f270a78
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Sep 4 13:28:31 2013 +0200

    st: Make st_scroll_view_update_fade_effect() public
    
    Using fixed fade offsets is not always appropriate, this will allow
    to set them from code instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707409

 src/st/st-scroll-view.c |   14 +++++++-------
 src/st/st-scroll-view.h |    3 +++
 2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c
index f59ae93..eb35928 100644
--- a/src/st/st-scroll-view.c
+++ b/src/st/st-scroll-view.c
@@ -160,19 +160,19 @@ st_scroll_view_get_property (GObject    *object,
 
 /**
  * st_scroll_view_update_fade_effect:
- * @self: a #StScrollView
+ * @scroll: a #StScrollView
  * @vfade_offset: The length of the veritcal fade effect, in pixels.
  * @hfade_offset: The length of the horizontal fade effect, in pixels.
  *
  * Sets the height of the fade area area in pixels. A value of 0
  * disables the effect.
  */
-static void
-st_scroll_view_update_fade_effect (StScrollView *self,
+void
+st_scroll_view_update_fade_effect (StScrollView *scroll,
                                    float vfade_offset,
                                    float hfade_offset)
 {
-  StScrollViewPrivate *priv = ST_SCROLL_VIEW (self)->priv;
+  StScrollViewPrivate *priv = ST_SCROLL_VIEW (scroll)->priv;
 
   /* A fade amount of more than 0 enables the effect. */
   if (vfade_offset > 0. || hfade_offset > 0.)
@@ -180,7 +180,7 @@ st_scroll_view_update_fade_effect (StScrollView *self,
       if (priv->fade_effect == NULL) {
         priv->fade_effect = g_object_new (ST_TYPE_SCROLL_VIEW_FADE, NULL);
 
-        clutter_actor_add_effect_with_name (CLUTTER_ACTOR (self), "fade",
+        clutter_actor_add_effect_with_name (CLUTTER_ACTOR (scroll), "fade",
                                             CLUTTER_EFFECT (priv->fade_effect));
       }
 
@@ -194,12 +194,12 @@ st_scroll_view_update_fade_effect (StScrollView *self,
    else
     {
       if (priv->fade_effect != NULL) {
-        clutter_actor_remove_effect (CLUTTER_ACTOR (self), CLUTTER_EFFECT (priv->fade_effect));
+        clutter_actor_remove_effect (CLUTTER_ACTOR (scroll), CLUTTER_EFFECT (priv->fade_effect));
         priv->fade_effect = NULL;
       }
     }
 
-  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
+  clutter_actor_queue_redraw (CLUTTER_ACTOR (scroll));
 }
 
 static void
diff --git a/src/st/st-scroll-view.h b/src/st/st-scroll-view.h
index 517e7dc..02dabab 100644
--- a/src/st/st-scroll-view.h
+++ b/src/st/st-scroll-view.h
@@ -87,6 +87,9 @@ gboolean      st_scroll_view_get_overlay_scrollbars (StScrollView *scroll);
 void          st_scroll_view_set_policy          (StScrollView   *scroll,
                                                   GtkPolicyType   hscroll,
                                                   GtkPolicyType   vscroll);
+void          st_scroll_view_update_fade_effect  (StScrollView *scroll,
+                                                  float vfade_offset,
+                                                  float hfade_offset);
 
 G_END_DECLS
 


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