After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 651866 - st-scroll-view-fade: Don't fade horizontal scrollbar
st-scroll-view-fade: Don't fade horizontal scrollbar
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-06-04 18:58 UTC by drago01
Modified: 2011-06-29 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
st-scroll-view-fade: Don't fade horizontal scrollbar (3.70 KB, patch)
2011-06-04 18:58 UTC, drago01
none Details | Review
st-scroll-view-fade: Don't fade horizontal scrollbar (3.70 KB, patch)
2011-06-04 19:09 UTC, drago01
none Details | Review
StScrollView: Expose scrollbars visibility as property (2.43 KB, patch)
2011-06-04 21:36 UTC, drago01
needs-work Details | Review
StScrollViewFade: Fix scrollbar size handling (4.29 KB, patch)
2011-06-04 21:36 UTC, drago01
none Details | Review
StScrollViewFade: Fix scrollbar size handling (4.18 KB, patch)
2011-06-04 21:40 UTC, drago01
committed Details | Review
StScrollView: Expose scrollbars visibility as property (3.08 KB, patch)
2011-06-29 16:09 UTC, drago01
committed Details | Review

Description drago01 2011-06-04 18:58:27 UTC
See patch.
Comment 1 drago01 2011-06-04 18:58:30 UTC
Created attachment 189229 [details] [review]
st-scroll-view-fade: Don't fade horizontal scrollbar

Take the height of the horizontal scrollbar into account when calculating
the fade area, so that only the scrollview's content is faded but not
the horizontal scrollbar.
Comment 2 drago01 2011-06-04 19:09:26 UTC
Created attachment 189230 [details] [review]
st-scroll-view-fade: Don't fade horizontal scrollbar

Take the height of the horizontal scrollbar into account when calculating
the fade area, so that only the scrollview's content is faded but not
the horizontal scrollbar.

---

Whitespace fix.
Comment 3 drago01 2011-06-04 21:36:48 UTC
Created attachment 189237 [details] [review]
StScrollView: Expose scrollbars visibility as property

Add two boolean readonly properties that tell whether
the scrollbars are visible or not.
Comment 4 drago01 2011-06-04 21:36:59 UTC
Created attachment 189238 [details] [review]
StScrollViewFade: Fix scrollbar size handling

Only skip the areas of the scrollbars when they are invisible
and add take the horizontal scrollbar into account as well
when calculating the faded area.
Comment 5 drago01 2011-06-04 21:40:05 UTC
Created attachment 189239 [details] [review]
StScrollViewFade: Fix scrollbar size handling

Only skip the areas of the scrollbars when they are invisible
and add take the horizontal scrollbar into account as well
when calculating the faded area.
Comment 6 Dan Winship 2011-06-27 13:39:28 UTC
Comment on attachment 189237 [details] [review]
StScrollView: Expose scrollbars visibility as property

You should notify on property changes. (ie, call g_object_notify(scrollbar, "hscrollbar-visible") when the value of that property changes)
Comment 7 Dan Winship 2011-06-27 13:42:22 UTC
Comment on attachment 189239 [details] [review]
StScrollViewFade: Fix scrollbar size handling

looks right, although I'm not sure how to test since I don't know where we have both horizontal scrollbars and vertical fading.

>+    cogl_program_set_uniform_1f (self->program, self->scrollbar_width_uniform, v_scroll_visible ? clutter_actor_get_width (vscroll) : 0);

fwiw, I think you could use "CLUTTER_ACTOR_IS_VISIBLE (vscroll)" rather than adding the new properties
Comment 8 drago01 2011-06-27 13:55:17 UTC
(In reply to comment #7)
> (From update of attachment 189239 [details] [review])
> looks right, although I'm not sure how to test since I don't know where we have
> both horizontal scrollbars and vertical fading.

I tested it with tests/interactive/scroll-view-sizing.js

> >+    cogl_program_set_uniform_1f (self->program, self->scrollbar_width_uniform, v_scroll_visible ? clutter_actor_get_width (vscroll) : 0);
> 
> fwiw, I think you could use "CLUTTER_ACTOR_IS_VISIBLE (vscroll)" rather than
> adding the new properties

I initially had that but it didn't work (neither did IS_MAPPED) so I ended up doing it that way.
Comment 9 Dan Winship 2011-06-29 15:34:03 UTC
Comment on attachment 189239 [details] [review]
StScrollViewFade: Fix scrollbar size handling

ok, yeah, this one is fine. the other still should get some g_object_notify()s
Comment 10 drago01 2011-06-29 16:09:43 UTC
Created attachment 190939 [details] [review]
StScrollView: Expose scrollbars visibility as property

Add two boolean readonly properties that tell whether
the scrollbars are visible or not.

---

*) Add g_object_notify()
Comment 11 Dan Winship 2011-06-29 16:20:51 UTC
Comment on attachment 190939 [details] [review]
StScrollView: Expose scrollbars visibility as property

>+     case PROP_VSCROLLBAR_VISIBLE:

indented one space too many

>+  if (priv->hscrollbar_visible != hscrollbar_visible)
>+    {
>+      priv->hscrollbar_visible = hscrollbar_visible;
>+      g_object_notify (G_OBJECT (actor), "hscrollbar-visible");
>+    }
>+
>+  if (priv->vscrollbar_visible != vscrollbar_visible)
>+    {
>+      priv->vscrollbar_visible = vscrollbar_visible;
>+      g_object_notify (G_OBJECT (actor), "vscrollbar-visible");
>+    }

put g_object_freeze_notify (G_OBJECT (actor)) before that, and g_object_thaw_notify (G_OBJECT (actor)) after (so that it's not possible for a signal handler to run in between the two sections).

>+  pspec = g_param_spec_boolean ("vscrollbar-visible",
>+                                "Horizontal Scrollbar Visibility",

s/Horizontal/Vertical/

ok to commit with those fixes
Comment 12 drago01 2011-06-29 16:50:21 UTC
Attachment 189239 [details] pushed as 620330d - StScrollViewFade: Fix scrollbar size handling
Attachment 190939 [details] pushed as 3765acc - StScrollView: Expose scrollbars visibility as property