diff options
author | Abner Silva <abner.silva@collabora.co.uk> | 2009-07-14 05:41:09 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-07-15 23:06:39 +0800 |
commit | 2a6048e015b83b22eb2c771412b2e4770c4ada01 (patch) | |
tree | c952d871cdd81678af2f8f812553a3a4eafc7173 /src | |
parent | 3db15a0c3a67d8f5c03ac88468b107dbabb7c8ef (diff) | |
download | gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.tar gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.tar.gz gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.tar.bz2 gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.tar.lz gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.tar.xz gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.tar.zst gsoc2013-empathy-2a6048e015b83b22eb2c771412b2e4770c4ada01.zip |
Chat window's tab label changes the font color when got an incoming msg. (Fixes #588498)
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-window.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 7bc64bb08..8dcb68d2f 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -995,6 +995,24 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window, } static void +chat_window_set_highlight_room_tab_label (EmpathyChat *chat) +{ + gchar *markup; + GtkWidget *widget; + + if (empathy_chat_is_room (chat) == FALSE) + return; + + markup = g_markup_printf_escaped ("<span color=\"%s\">%s</span>", + "red", + empathy_chat_get_name (chat)); + + widget = g_object_get_data (G_OBJECT (chat), "chat-window-tab-label"); + gtk_label_set_markup (GTK_LABEL (widget), markup); + g_free (markup); +} + +static void chat_window_new_message_cb (EmpathyChat *chat, EmpathyMessage *message, EmpathyChatWindow *window) @@ -1026,6 +1044,11 @@ chat_window_new_message_cb (EmpathyChat *chat, return; } + if (!g_list_find (priv->chats_new_msg, chat)) { + priv->chats_new_msg = g_list_prepend (priv->chats_new_msg, chat); + chat_window_update_chat_tab (chat); + } + /* If empathy_chat_is_room () returns TRUE, that means it's a named MUC. * If empathy_chat_get_remote_contact () returns NULL, that means it's * an unamed MUC (msn-like). @@ -1039,18 +1062,15 @@ chat_window_new_message_cb (EmpathyChat *chat, } if (needs_urgency) { - if (!has_focus) + if (!has_focus) { chat_window_set_urgency_hint (window, TRUE); + chat_window_set_highlight_room_tab_label (chat); + } empathy_sound_play (GTK_WIDGET (priv->dialog), EMPATHY_SOUND_MESSAGE_INCOMING); chat_window_show_or_update_notification (window, message, chat); } - - if (!g_list_find (priv->chats_new_msg, chat)) { - priv->chats_new_msg = g_list_prepend (priv->chats_new_msg, chat); - chat_window_update_chat_tab (chat); - } } static GtkNotebook * |