From 7deb4ea20b08eab10473f2620c90f6b896d5af10 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Sat, 20 Jun 2009 17:27:06 +0100 Subject: Use accessor functions instead direct access (Fixes #586476) Signed-off-by: Jonny Lamb --- src/empathy-chat-window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/empathy-chat-window.c') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index f9d0b924a..7bc64bb08 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -176,7 +176,7 @@ chat_tab_style_set_cb (GtkWidget *hbox, "chat-window-tab-close-button"); context = gtk_widget_get_pango_context (hbox); - metrics = pango_context_get_metrics (context, hbox->style->font_desc, + metrics = pango_context_get_metrics (context, gtk_widget_get_style (hbox)->font_desc, pango_context_get_language (context)); char_width = pango_font_metrics_get_approximate_char_width (metrics); pango_font_metrics_unref (metrics); @@ -1242,7 +1242,7 @@ chat_window_drag_data_received (GtkWidget *widget, const gchar *account_id; const gchar *contact_id; - id = (const gchar*) selection->data; + id = (const gchar*) gtk_selection_data_get_data (selection); account_manager = empathy_account_manager_dup_singleton (); DEBUG ("DND contact from roster with id:'%s'", id); @@ -1299,7 +1299,7 @@ chat_window_drag_data_received (GtkWidget *widget, DEBUG ("DND tab"); - chat = (void *) selection->data; + chat = (void *) gtk_selection_data_get_data (selection); old_window = chat_window_find_chat (*chat); if (old_window) { -- cgit v1.2.3 From 2a6048e015b83b22eb2c771412b2e4770c4ada01 Mon Sep 17 00:00:00 2001 From: Abner Silva Date: Mon, 13 Jul 2009 18:41:09 -0300 Subject: Chat window's tab label changes the font color when got an incoming msg. (Fixes #588498) --- src/empathy-chat-window.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/empathy-chat-window.c') 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 @@ -994,6 +994,24 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window, g_free (escaped); } +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 ("%s", + "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, @@ -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 * -- cgit v1.2.3