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 648284 - giggle-graph-renderer: removing deprecated use of GtkStyle
giggle-graph-renderer: removing deprecated use of GtkStyle
Status: RESOLVED OBSOLETE
Product: giggle
Classification: Other
Component: UI: General
HEAD
Other Linux
: Normal normal
: ---
Assigned To: giggle-maint
giggle-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-20 11:04 UTC by J.P. Lacerda
Modified: 2020-11-11 19:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkStyle to GtkStyleContext (1.56 KB, patch)
2011-04-20 11:04 UTC, J.P. Lacerda
needs-work Details | Review
context (1.68 KB, patch)
2011-04-20 22:19 UTC, J.P. Lacerda
committed Details | Review

Description J.P. Lacerda 2011-04-20 11:04:20 UTC
The function set_source_color still makes use of GtkStyle.
The patch that follows fixes the issue.

It might be a good idea to re-write some significant portions of graph-renderer to use GdkRGBA instead of GtkStyleContext.
Comment 1 J.P. Lacerda 2011-04-20 11:04:58 UTC
Created attachment 186342 [details] [review]
GtkStyle to GtkStyleContext
Comment 2 Javier Jardón (IRC: jjardon) 2011-04-20 21:38:24 UTC
Review of attachment 186342 [details] [review]:

Hello, thanks a lot for the patch.

Only a little question:

::: src/giggle-graph-renderer.c
@@ +265,3 @@
+		rgba.red   = (color.red / 100000.0   + 7 * rgba.red)   / 8;
+		rgba.green = (color.green / 100000.0 + 7 * rgba.green) / 8;
+		rgba.blue  = (color.blue / 100000.0  + 7 * rgba.blue)  / 8;

Why do you divide by 100000.0 here?
Comment 3 J.P. Lacerda 2011-04-20 21:42:48 UTC
Review of attachment 186342 [details] [review]:

Hi Javier.

We must divide by 100000.0 as GdkRGBA requires values between 0 and 1 (inclusive), for each channel.
As GdkColor accepts values between 0 and 65535, we must correct the order of magnitude.

Do you think that the whole of giggle-graph-renderer should be ported to GdkRGBA?
It should be a trivial fix.

Thanks :)
Comment 4 Javier Jardón (IRC: jjardon) 2011-04-20 21:49:53 UTC
Oh, You have  to divide by 65535.0 to convert from GdkColor to GdkRGBA so the value should be in the [0,1] range
Comment 5 J.P. Lacerda 2011-04-20 22:19:14 UTC
You are absolutely right, fixed.

Thanks :)
Comment 6 J.P. Lacerda 2011-04-20 22:19:39 UTC
Created attachment 186396 [details] [review]
context
Comment 7 Javier Jardón (IRC: jjardon) 2011-04-20 23:29:14 UTC
Comment on attachment 186396 [details] [review]
context

commit 42b0ee39367f6b68796b0089146f8addd4195247
Comment 8 Javier Jardón (IRC: jjardon) 2011-04-20 23:29:59 UTC
(In reply to comment #3)

> Do you think that the whole of giggle-graph-renderer should be ported to
> GdkRGBA?

Yeah, the ideal is to not use GdkColor at all.
Comment 9 J.P. Lacerda 2011-04-21 10:17:19 UTC
Cool, I will make the required changes.
What is the best way of doing this, however? I am particularly concerned about the GdkColor array: there seems to be no easy way of converting it to GdkRGBA (dividing all fields by 65535 barely seems acceptable!).

Should we introduce a color_to_rgba function? This might be a nice addition to Gdk?

J.P.
Comment 10 André Klapper 2012-04-04 10:12:40 UTC
Mass-fixing incorrect QA contact scheme for giggle so interested people can follow its development. (See 564922#c1 for ref.)
Comment 11 André Klapper 2020-11-11 19:39:42 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all
old bug reports and feature requests in GNOME Bugzilla which have not seen
updates for a long time.

If you still use giggle and if you still see this bug / want this feature in a recent and currently supported version, then please feel free to report it at
https://gitlab.gnome.org/GNOME/giggle/-/issues/

Thank you for creating this report and we are sorry it could not be implemented
(volunteer workforce and time is limited).