[polari/wip/fmuellner/nick-differentiation: 12/13] chatView: Differentiate nicks by underline
- From: Gitlab Administrative User <gitlab src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/nick-differentiation: 12/13] chatView: Differentiate nicks by underline
- Date: Fri, 10 Nov 2017 03:36:29 +0000 (UTC)
commit fced3bf2846144a762b4b1a6df849d623ede9594
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Oct 19 03:14:14 2017 +0200
chatView: Differentiate nicks by underline
src/chatView.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/src/chatView.js b/src/chatView.js
index 5c43968..5059923 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -893,6 +893,17 @@ var ChatView = GObject.registerClass({
return NICKTAG_PREFIX + Polari.util_get_basenick(nick);
}
+ _getNickTagColor(nick) {
+ let type = GLib.ChecksumType.MD5;
+ let baseNick = Polari.util_get_basenick(nick);
+ let hash = GLib.compute_checksum_for_string(type, baseNick, -1);
+ let rgba = new Gdk.RGBA();
+ rgba.parse('#' + hash.substr(0, 6));
+ rgba.alpha = 0.2;
+
+ return rgba;
+ }
+
_getNickFromTagName(tagName) {
if (tagName.startsWith(NICKTAG_PREFIX))
return tagName.replace(NICKTAG_PREFIX, '');
@@ -1246,6 +1257,9 @@ var ChatView = GObject.registerClass({
nickTag = new ButtonTag({ name: nickTagName });
nickTag.connect('clicked', Lang.bind(this, this._onNickTagClicked));
+ nickTag.underline = Pango.Underline.SINGLE;
+ nickTag.underline_rgba = this._getNickTagColor(message.nick);
+
let status = this._userTracker.getNickRoomStatus(message.nick, this._room);
this._updateNickTag(nickTag, status);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]