summary refs log tree commit diff stats
path: root/src/fe-gtk/userlistgui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/userlistgui.c')
-rw-r--r--src/fe-gtk/userlistgui.c40
1 files changed, 13 insertions, 27 deletions
diff --git a/src/fe-gtk/userlistgui.c b/src/fe-gtk/userlistgui.c
index 8405695b..c2f2a462 100644
--- a/src/fe-gtk/userlistgui.c
+++ b/src/fe-gtk/userlistgui.c
@@ -22,22 +22,13 @@
 
 #include "fe-gtk.h"
 
-#include <gtk/gtkbox.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtkcellrendererpixbuf.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkliststore.h>
 #include <gdk/gdkkeysyms.h>
 
 #include "../common/hexchat.h"
 #include "../common/util.h"
 #include "../common/userlist.h"
 #include "../common/modes.h"
+#include "../common/text.h"
 #include "../common/notify.h"
 #include "../common/hexchatc.h"
 #include "../common/fe.h"
@@ -49,11 +40,6 @@
 #include "userlistgui.h"
 #include "fkeys.h"
 
-#ifdef USE_GTKSPELL
-#include <gtk/gtktextview.h>
-#endif
-
-
 enum
 {
 	COL_PIX=0,		// GdkPixbuf *
@@ -327,21 +313,21 @@ fe_userlist_rehash (session *sess, struct User *user)
 {
 	GtkTreeIter *iter;
 	int sel;
-	int do_away = TRUE;
+	int nick_color = 0;
 
 	iter = find_row (GTK_TREE_VIEW (sess->gui->user_tree),
 						  sess->res->user_model, user, &sel);
 	if (!iter)
 		return;
 
-	if (prefs.hex_away_size_max < 1 || !prefs.hex_away_track)
-		do_away = FALSE;
+	if (prefs.hex_away_track && prefs.hex_away_size_max && user->away)
+		nick_color = COL_AWAY;
+	else if (prefs.hex_gui_ulist_color)
+		nick_color = text_color_of(user->nick);
 
 	gtk_list_store_set (GTK_LIST_STORE (sess->res->user_model), iter,
 							  COL_HOST, user->hostname,
-							  COL_GDKCOLOR, (do_away)
-									?	(user->away ? &colors[COL_AWAY] : NULL)
-									:	(NULL),
+							  COL_GDKCOLOR, nick_color ? &colors[nick_color] : NULL,
 							  -1);
 }
 
@@ -351,11 +337,13 @@ fe_userlist_insert (session *sess, struct User *newuser, int row, int sel)
 	GtkTreeModel *model = sess->res->user_model;
 	GdkPixbuf *pix = get_user_icon (sess->server, newuser);
 	GtkTreeIter iter;
-	int do_away = TRUE;
 	char *nick;
+	int nick_color = 0;
 
-	if (prefs.hex_away_size_max < 1 || !prefs.hex_away_track)
-		do_away = FALSE;
+	if (prefs.hex_away_track && prefs.hex_away_size_max && newuser->away)
+		nick_color = COL_AWAY;
+	else if (prefs.hex_gui_ulist_color)
+		nick_color = text_color_of(newuser->nick);
 
 	nick = newuser->nick;
 	if (!prefs.hex_gui_ulist_icons)
@@ -374,9 +362,7 @@ fe_userlist_insert (session *sess, struct User *newuser, int row, int sel)
 									COL_NICK, nick,
 									COL_HOST, newuser->hostname,
 									COL_USER, newuser,
-									COL_GDKCOLOR, (do_away)
-										?	(newuser->away ? &colors[COL_AWAY] : NULL)
-										:	(NULL),
+									COL_GDKCOLOR, nick_color ? &colors[nick_color] : NULL,
 								  -1);
 
 	if (!prefs.hex_gui_ulist_icons)