[gnome-shell/gnome-3-8] st-scroll-view: Unconditionally allocate scrollbars



commit 52417a8363cdb5b57af744cd4ca311c7f068403e
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sat Aug 10 22:09:33 2013 +0200

    st-scroll-view: Unconditionally allocate scrollbars
    
    Commit cfecd063c9ca3d18cd changed the allocation logic to not allocate
    scrollbars when the *_visible booleans are false. This breaks the
    fade effect as well as the NEVER policy. We do not paint scrollbars
    when they are not supposed to be visible, so not allocating them
    and thus leaving them in a "needs allocation" state just causes problems.
    
    I am not convinced that it solved any problem to begin with (we don't paint
    them anyway).
    
    As the previous condition has basically always been true, just do it
    unconditionally.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705664

 src/st/st-scroll-view.c |   58 +++++++++++++++++++++--------------------------
 1 files changed, 26 insertions(+), 32 deletions(-)
---
diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c
index 04e263f..f59ae93 100644
--- a/src/st/st-scroll-view.c
+++ b/src/st/st-scroll-view.c
@@ -598,42 +598,36 @@ st_scroll_view_allocate (ClutterActor          *actor,
    */
 
   /* Vertical scrollbar */
-  if (vscrollbar_visible)
-    {
-      if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
-        {
-          child_box.x1 = content_box.x1;
-          child_box.x2 = content_box.x1 + sb_width;
-        }
-      else
-        {
-          child_box.x1 = content_box.x2 - sb_width;
-          child_box.x2 = content_box.x2;
-        }
-      child_box.y1 = content_box.y1;
-      child_box.y2 = content_box.y2 - (hscrollbar_visible ? sb_height : 0);
+    if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
+      {
+        child_box.x1 = content_box.x1;
+        child_box.x2 = content_box.x1 + sb_width;
+      }
+    else
+      {
+        child_box.x1 = content_box.x2 - sb_width;
+        child_box.x2 = content_box.x2;
+      }
+    child_box.y1 = content_box.y1;
+    child_box.y2 = content_box.y2 - (hscrollbar_visible ? sb_height : 0);
 
-      clutter_actor_allocate (priv->vscroll, &child_box, flags);
-    }
+    clutter_actor_allocate (priv->vscroll, &child_box, flags);
 
   /* Horizontal scrollbar */
-  if (hscrollbar_visible)
-    {
-      if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
-        {
-          child_box.x1 = content_box.x1 + (vscrollbar_visible ? sb_width : 0);
-          child_box.x2 = content_box.x2;
-        }
-      else
-        {
-          child_box.x1 = content_box.x1;
-          child_box.x2 = content_box.x2 - (vscrollbar_visible ? sb_width : 0);
-        }
-      child_box.y1 = content_box.y2 - sb_height;
-      child_box.y2 = content_box.y2;
+    if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
+      {
+        child_box.x1 = content_box.x1 + (vscrollbar_visible ? sb_width : 0);
+        child_box.x2 = content_box.x2;
+      }
+    else
+      {
+        child_box.x1 = content_box.x1;
+        child_box.x2 = content_box.x2 - (vscrollbar_visible ? sb_width : 0);
+      }
+    child_box.y1 = content_box.y2 - sb_height;
+    child_box.y2 = content_box.y2;
 
-      clutter_actor_allocate (priv->hscroll, &child_box, flags);
-    }
+    clutter_actor_allocate (priv->hscroll, &child_box, flags);
 
   /* In case the scrollbar policy is NEVER or scrollbars should be
    * overlayed, we don't trim the content box allocation by the


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