GNOME Bugzilla – Bug 648284
giggle-graph-renderer: removing deprecated use of GtkStyle
Last modified: 2020-11-11 19:39:42 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.
Created attachment 186342 [details] [review] GtkStyle to GtkStyleContext
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?
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 :)
Oh, You have to divide by 65535.0 to convert from GdkColor to GdkRGBA so the value should be in the [0,1] range
You are absolutely right, fixed. Thanks :)
Created attachment 186396 [details] [review] context
Comment on attachment 186396 [details] [review] context commit 42b0ee39367f6b68796b0089146f8addd4195247
(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.
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.
Mass-fixing incorrect QA contact scheme for giggle so interested people can follow its development. (See 564922#c1 for ref.)
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).