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 642510 - StScrollViewFade: Make fade-offset a property rather than a hardocded constant
StScrollViewFade: Make fade-offset a property rather than a hardocded constant
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-02-16 21:24 UTC by drago01
Modified: 2011-02-16 22:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
StScrollViewFade: Make fade-offset a property rather than a hardocded constant (5.12 KB, patch)
2011-02-16 21:24 UTC, drago01
reviewed Details | Review
StScrollViewFade: Make fade-offset a property rather than a hardcoded constant (5.27 KB, patch)
2011-02-16 21:45 UTC, drago01
committed Details | Review
use _init rather than _constructed, and fix indentation (2.63 KB, patch)
2011-02-16 22:03 UTC, Dan Winship
committed Details | Review

Description drago01 2011-02-16 21:24:07 UTC
See patch.
Comment 1 drago01 2011-02-16 21:24:10 UTC
Created attachment 181060 [details] [review]
StScrollViewFade: Make fade-offset a property rather than a hardocded constant
Comment 2 Dan Winship 2011-02-16 21:30:35 UTC
Comment on attachment 181060 [details] [review]
StScrollViewFade: Make fade-offset a property rather than a hardocded constant

>-#define FADE_OFFSET 68.0f

you might as well keep that, renamed to DEFAULT_FADE_OFFSET, rather than hardcoding "68.0f" in two places.

>+    case PROP_FADE_OFFSET:
>+      st_scroll_view_fade_set_offset (self, g_value_get_int (value));

should be get_float()

>+static void
>+st_scroll_view_fade_constructed (GObject *object)
>+{
>+  StScrollViewFade *self = ST_SCROLL_VIEW_FADE (object);
>+  self->fade_offset = 68.0f;
>+}

you can do that from st_scroll_view_fade_init()
Comment 3 Dan Winship 2011-02-16 21:31:00 UTC
oh, and there's a typo in the summary ("hardocded")
Comment 4 drago01 2011-02-16 21:45:20 UTC
(In reply to comment #2)
> (From update of attachment 181060 [details] [review])
> >-#define FADE_OFFSET 68.0f
> 
> you might as well keep that, renamed to DEFAULT_FADE_OFFSET, rather than
> hardcoding "68.0f" in two places.

OK makes sense.

> >+    case PROP_FADE_OFFSET:
> >+      st_scroll_view_fade_set_offset (self, g_value_get_int (value));
> 
> should be get_float()

Oops.

> >+static void
> >+st_scroll_view_fade_constructed (GObject *object)
> >+{
> >+  StScrollViewFade *self = ST_SCROLL_VIEW_FADE (object);
> >+  self->fade_offset = 68.0f;
> >+}
> 
> you can do that from st_scroll_view_fade_init()

Yes I can with the small difference that it is a nop (so I went with _constructed).

(In reply to comment #3)
> oh, and there's a typo in the summary ("hardocded")

Oops.
Comment 5 drago01 2011-02-16 21:45:35 UTC
Created attachment 181062 [details] [review]
StScrollViewFade: Make fade-offset a property rather than a hardcoded constant
Comment 6 Dan Winship 2011-02-16 22:03:09 UTC
Created attachment 181070 [details] [review]
use _init rather than _constructed, and fix indentation
Comment 7 drago01 2011-02-16 22:07:30 UTC
Attachment 181062 [details] pushed as 07bde82 - StScrollViewFade: Make fade-offset a property rather than a hardcoded constant