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 747942 - chatView: selectedColor declared using deprecated get_background_color()
chatView: selectedColor declared using deprecated get_background_color()
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-15 19:05 UTC by Bastian Ilsø
Modified: 2015-04-15 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
chatView: switch away from deprecated API (1.30 KB, patch)
2015-04-15 19:05 UTC, Bastian Ilsø
none Details | Review
chatView: switch away from deprecated API (1.30 KB, patch)
2015-04-15 19:49 UTC, Bastian Ilsø
none Details | Review
chatView: switch away from deprecated API (1.46 KB, patch)
2015-04-15 19:51 UTC, Bastian Ilsø
accepted-commit_now Details | Review

Description Bastian Ilsø 2015-04-15 19:05:12 UTC
Polari is currently using GtkStyleContext.get_background_color() to colorpick of the Gtk.StateFlags.SELECTED. Attached patch uses Gtk.StateFlags.LINK instead, removing the need to use the deprecated GtkStyleContext.get_background_color() function.
Comment 1 Bastian Ilsø 2015-04-15 19:05:55 UTC
Created attachment 301671 [details] [review]
chatView: switch away from deprecated API
Comment 2 Florian Müllner 2015-04-15 19:39:54 UTC
Review of attachment 301671 [details] [review]:

Some nits on the commit message:
 - start should be capitalized (unless the first word is a lower-case name
   like gtk_style_context_get_background_color)
 - "via the 'view' class from Adwaita css" sounds cludgy and isn't necessarily
   correct - it comes from the theme, which may or may not be Adwaita; how about
 - GNOME 3.16 should really be GTK+ 3.16
With those comments, how about something like:
"The chat view is currently using the selection background color for nick names.
However as gtk_style_context_get_background_color() has been deprecated in GTK+ 3.16,
use the foreground color for the LINK state instead, which should be identical for
the default theme."

::: src/chatView.js
@@ +188,3 @@
         context.restore();
 
+        let selectedColor = context.get_color(Gtk.StateFlags.LINK);

"selectedColor" becomes a misnomer when you use the link color, and having both selectedColor and linkColor for the exact same color is silly.
Comment 3 Bastian Ilsø 2015-04-15 19:49:17 UTC
Created attachment 301680 [details] [review]
chatView: switch away from deprecated API
Comment 4 Bastian Ilsø 2015-04-15 19:51:28 UTC
Created attachment 301681 [details] [review]
chatView: switch away from deprecated API

woops, this one should be good
Comment 5 Florian Müllner 2015-04-15 19:56:35 UTC
Review of attachment 301681 [details] [review]:

(In reply to Bastian from comment #4)
> woops, this one should be good

Yup, thanks. Feel free to push to gnome-3-16 as well.