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 759677 - chatView: Clean up handling of interactive tags
chatView: Clean up handling of interactive tags
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-19 22:11 UTC by Florian Müllner
Modified: 2015-12-22 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
chatView: Clean up handling of interactive tags (10.81 KB, patch)
2015-12-19 22:11 UTC, Florian Müllner
none Details | Review
chatView: Clean up handling of interactive tags (10.81 KB, patch)
2015-12-22 17:25 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2015-12-19 22:11:50 UTC
See patch.
Comment 1 Florian Müllner 2015-12-19 22:11:56 UTC
Created attachment 317678 [details] [review]
chatView: Clean up handling of interactive tags

With the new status grouping where the header can be clicked to reveal
collapsed status messages, we now have a second text tag that responds
to input besides clickable links. This makes the code that handles them
centrally quite awkward, as we now need to differentiate not only on the
type of events, but also the tag type interacted with.
Clean this up by splitting out the generally useful event handling into
a ButtonTag class (with some help in TextView for hover-tracking), and
use its ::clicked, ::button-press-event and ::button-release-event signals
to implement links and status group headers and a much more natural way.
Comment 2 Kunaal Jain 2015-12-21 19:51:58 UTC
We should use _createHeaderTag function just like _createUrlTag as header tag will be listening to hover as well as click? I have taken care of this in my patch of bug 759032, .


Can you please rebase it and push. chatView was modified with commit 452017147. I'd rebase the patches of 759032 on top of it than.
Comment 3 Florian Müllner 2015-12-22 17:25:05 UTC
Created attachment 317791 [details] [review]
chatView: Clean up handling of interactive tags

(In reply to Kunaal Jain from comment #2)
> We should use _createHeaderTag function just like _createUrlTag as header
> tag will be listening to hover as well as click?

I split out _createUrlTag() because _insertMessage() is already fairly unwieldy as-is, and in particular the right-click handling distracts from the overall control flow of _insertMessage(). That's much less of a concern for _updateStatusHeader() IMHO, even when we add a 'notify::hover' handler (it's obviously not *wrong* to split that out as well, I just don't think it's necessary).
Comment 4 Florian Müllner 2015-12-22 18:19:49 UTC
Attachment 317791 [details] pushed as 6ba4640 - chatView: Clean up handling of interactive tags