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 759032 - chatView: change color of status header on hover
chatView: change color of status header on hover
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-04 15:15 UTC by Bastian Ilsø
Modified: 2015-12-23 15:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
chatView: change color of status header on hover (2.67 KB, patch)
2015-12-06 12:15 UTC, Kunaal Jain
none Details | Review
chatView: change color of status header on hover (2.83 KB, patch)
2015-12-07 04:45 UTC, Kunaal Jain
none Details | Review
chatView: change color of status header on hover (3.67 KB, patch)
2015-12-08 18:39 UTC, Kunaal Jain
none Details | Review
chatView: change color of status header on hover (2.49 KB, patch)
2015-12-22 19:31 UTC, Kunaal Jain
none Details | Review
chatView: Listen to crossover events (861 bytes, patch)
2015-12-22 19:47 UTC, Kunaal Jain
none Details | Review
chatView: change color of status header on hover (3.04 KB, patch)
2015-12-22 19:53 UTC, Kunaal Jain
none Details | Review
chatView: change color of status header on hover (2.11 KB, patch)
2015-12-22 21:06 UTC, Kunaal Jain
none Details | Review
chatView: Listen to crossover events (1.54 KB, patch)
2015-12-23 06:33 UTC, Kunaal Jain
committed Details | Review
chatView: change color of status header on hover (1.61 KB, patch)
2015-12-23 06:34 UTC, Kunaal Jain
committed Details | Review

Description Bastian Ilsø 2015-12-04 15:15:54 UTC
On idle channels, status messages (user x joined, user x left) are compressed into one "status header" message (fx 4 users joined, 7 users left)[0]. By clicking the status header, all the status messages are revealed. It would be nice if the status header changed color (from the grey "dimcolor" to a black) when a user is hovering over the header. This can help indicating that the status header is clickable.
Comment 1 Kunaal Jain 2015-12-06 12:15:57 UTC
Created attachment 316837 [details] [review]
chatView: change color of status header on hover
Comment 2 Bastian Ilsø 2015-12-06 22:07:09 UTC
Review of attachment 316837 [details] [review]:

::: src/chatView.js
@@ +152,3 @@
         this._pendingLogs = [];
         this._statusCount = { left: 0, joined: 0, total: 0 };
+        this._hoveredtags = []; // 'status-compressed' tags currently hovered

I'm not sure I understand the need of an array here. Shouldn't there only ever need to be one tag needing style (the status-compressed* one, where * is a number)?

@@ +262,3 @@
 
+        this._blackColor = new Gdk.RGBA ();
+        this._blackColor.parse('black');

This only works if you are using default theme or a light theme, but you probably dont want to use a black color as such if you have a dark theme like Adwaita dark (you can test it with gnome-tweak-tool, turning on a global dark theme).

I suggest you do something similar to how the dimColor is loaded in line 240-245. Instead of using the "dim-label" class you can use the "view" class to get hold of a pure black (or pure white in case of dark theme).
Comment 3 Kunaal Jain 2015-12-07 04:12:07 UTC
(In reply to Bastian Ilsø from comment #2)
> Review of attachment 316837 [details] [review] [review]:
> 
> ::: src/chatView.js
> @@ +152,3 @@
>          this._pendingLogs = [];
>          this._statusCount = { left: 0, joined: 0, total: 0 };
> +        this._hoveredtags = []; // 'status-compressed' tags currently
> hovered
> 
> I'm not sure I understand the need of an array here. Shouldn't there only
> ever need to be one tag needing style (the status-compressed* one, where *
> is a number)?
> 

I was thinking of multi touch devices. But since I am clearing out style at each function call, array won't be needed. 

> @@ +262,3 @@
>  
> +        this._blackColor = new Gdk.RGBA ();
> +        this._blackColor.parse('black');
> 
> This only works if you are using default theme or a light theme, but you
> probably dont want to use a black color as such if you have a dark theme
> like Adwaita dark (you can test it with gnome-tweak-tool, turning on a
> global dark theme).
> 
> I suggest you do something similar to how the dimColor is loaded in line
> 240-245. Instead of using the "dim-label" class you can use the "view" class
> to get hold of a pure black (or pure white in case of dark theme).

I had this in mind. I am having trouble finding documentation or reference on inbuilt CSS classes and styles provided by GNOME.
Comment 4 Kunaal Jain 2015-12-07 04:45:07 UTC
Created attachment 316864 [details] [review]
chatView: change color of status header on hover

On dark theme, strangely for me dim-label class and view class has almost same font color.
Comment 5 Bastian Ilsø 2015-12-07 22:13:07 UTC
(In reply to Kunaal Jain from comment #4)
> On dark theme, strangely for me dim-label class and view class has almost
> same font color.

ah yes, well the issue seems to be in the theme, as the dim-labels are using opacity to make them grey rather than a blend..

also, found one other more issue. If you happen to hover over a status message while changing the view, then the hover is never reset to use the dim color. I wonder if there is a way we can handle that nicely.

Beyond that, I don't have more comments on the code, (Florian might need to chime in here before we push anything, though).

On commit message:


> On idle channels, status messages are compressed into
> 'status header' message. By clicking status header, all
> status messages are revealed.

I think we can leave this part out of the commit message.


> Changes the on hover color
> of status messages from dimcolor to black which helps in
> indicating the link is clickable.

I don't we need to mention the color as that now depends on the theme here. I suggest change to:
"Highlight the compressed status messages on hover by changing the color. The change helps indicating that the status message can be clicked."
Comment 6 Kunaal Jain 2015-12-08 18:39:08 UTC
Created attachment 316969 [details] [review]
chatView: change color of status header on hover

fixes hovering not reverting back when changing the view. Commit message updated too ;)
Comment 7 Florian Müllner 2015-12-20 01:22:39 UTC
Review of attachment 316969 [details] [review]:

As mentioned on IRC/mail, all the different treatment of links/status headers in _handleLinkClicks/Hovers is getting messy, so I've refactored stuff a bit in bug 759677 - it probably makes sense to rebase this patch on top of that.

::: src/chatView.js
@@ +252,3 @@
 
+        context.save();
+        context.add_class('view');

Mmmh, maybe we should just use the TextView's style context in the first place? None of the stuff we're fetching from the context actually make sense for a ScrolledWindow ...

@@ +304,3 @@
                                     right_margin: MARGIN });
+        this._view.add_events(Gdk.EventMask.LEAVE_NOTIFY_MASK);
+        this._view.add_events(Gdk.EventMask.ENTER_NOTIFY_MASK);

If you rebase on top of bug 759677, it will make sense to split this out
Comment 8 Kunaal Jain 2015-12-22 19:31:58 UTC
Created attachment 317795 [details] [review]
chatView: change color of status header on hover
Comment 9 Kunaal Jain 2015-12-22 19:47:47 UTC
Created attachment 317796 [details] [review]
chatView: Listen to crossover events
Comment 10 Kunaal Jain 2015-12-22 19:53:23 UTC
Created attachment 317797 [details] [review]
chatView: change color of status header on hover

sorry for the noise folks.
Comment 11 Kunaal Jain 2015-12-22 21:06:19 UTC
Created attachment 317800 [details] [review]
chatView: change color of status header on hover

as pointed out by florian, on style update we are not updating the status compressed tags.
Comment 12 Florian Müllner 2015-12-22 21:12:38 UTC
Review of attachment 317796 [details] [review]:

Actually using the enter/leave events to update the hover status belongs here as well, not in the other patch.

(Commit message could be better as well and mention *why* we should do this, but I won't insist on it if you just want to update the patch)
Comment 13 Florian Müllner 2015-12-22 21:13:03 UTC
Review of attachment 317800 [details] [review]:

::: src/chatView.js
@@ +346,3 @@
+        context.add_class('view');
+        context.set_state(Gtk.StateFlags.NORMAL);
+        this._highlightColor = context.get_color(context.get_state());

highlightColor is a bit generic - statusHeaderHoverColor maybe?

@@ +412,3 @@
+                           Lang.bind(this, this._handleButtonTagsHover));
+        this._view.connect('leave-notify-event',
+                           Lang.bind(this, this._handleButtonTagsHover));

This belongs in the previous patch

@@ +876,3 @@
 
+            headerTag.connect('notify::hover', Lang.bind(this,
+            function() {

Style nit: missing indentation

@@ +877,3 @@
+            headerTag.connect('notify::hover', Lang.bind(this,
+            function() {
+                headerTag.foreground_rgba = headerTag.hover? this._highlightColor : null;

Style nit: missing space before '?'
Comment 14 Kunaal Jain 2015-12-23 06:33:59 UTC
Created attachment 317806 [details] [review]
chatView: Listen to crossover events
Comment 15 Kunaal Jain 2015-12-23 06:34:48 UTC
Created attachment 317807 [details] [review]
chatView: change color of status header on hover
Comment 16 Florian Müllner 2015-12-23 11:35:53 UTC
Review of attachment 317806 [details] [review]:

LGTM
Comment 17 Florian Müllner 2015-12-23 11:36:05 UTC
Review of attachment 317807 [details] [review]:

Dito
Comment 18 Kunaal Jain 2015-12-23 15:30:07 UTC
Review of attachment 317806 [details] [review]:

Pushed to master with commit 8b4f719f