# HG changeset patch # User Justin Rodriguez # Date 1217610289 0 # Node ID 824e97a1dd2214c106a44620e8f2a7292bc3ab0e # Parent 06392c8252c0d9ae57048dcbffdf947b8b49f3b9 fixed some small font bugs, the coloring when selected, and a segfault diff -r 06392c8252c0 -r 824e97a1dd22 pidgin/gtkblist-loader.c --- a/pidgin/gtkblist-loader.c Thu Jul 31 23:38:07 2008 +0000 +++ b/pidgin/gtkblist-loader.c Fri Aug 01 17:04:49 2008 +0000 @@ -162,7 +162,7 @@ } if ((sucess = sucess && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "contact_text")) != NULL)) { - online->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + contact->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) contact->color = g_strdup(temp); else contact->color = g_strdup(DEFAULT_TEXT_COLOR); diff -r 06392c8252c0 -r 824e97a1dd22 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Thu Jul 31 23:38:07 2008 +0000 +++ b/pidgin/gtkblist.c Fri Aug 01 17:04:49 2008 +0000 @@ -1797,7 +1797,8 @@ return handled; } -static gboolean gtk_blist_button_press_cb(GtkWidget *tv, GdkEventButton *event, gpointer user_data) +static gboolean +gtk_blist_button_press_cb(GtkWidget *tv, GdkEventButton *event, gpointer user_data) { GtkTreePath *path; PurpleBlistNode *node; @@ -3817,7 +3818,7 @@ gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data; /* Name */ - if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) + if (gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) name = contact->alias; else name = purple_buddy_get_alias(b); @@ -3959,13 +3960,15 @@ /* Put it all together */ if (biglist && (statustext || idletime)) { - text = g_strdup_printf("%s\n%s%s%s", - name_color, nametext, status_color, + /* using breaks the status, so it must be seperated into */ + text = g_strdup_printf("%s\n" + "%s%s%s", + name_font, name_color, nametext, status_font, status_color, idletime != NULL ? idletime : "", (idletime != NULL && statustext != NULL) ? " - " : "", statustext != NULL ? statustext : ""); - } else text = g_strdup_printf("%s", name_color, nametext); + } else text = g_strdup_printf("%s", name_font, name_color, nametext); if (hidden_conv) { char *tmp = text; @@ -6082,7 +6085,7 @@ else pair = pidgin_blist_theme_get_collapsed_text_info(theme); - text_color = (pair == NULL || pair->color == NULL) ? "black" : pair->color; + text_color = (selected || pair == NULL || pair->color == NULL) ? "black" : pair->color; text_font = (pair == NULL || pair->font == NULL) ? "" : pair->font; esc = g_markup_escape_text(group->name, -1); @@ -6145,13 +6148,12 @@ ihrs = (t - idle_secs) / 3600; imin = ((t - idle_secs) / 60) % 60; - if (selected) textcolor = "dim grey"; - else if (theme != NULL && (pair = pidgin_blist_theme_get_idle_text_info(theme)) != NULL && pair->color != NULL) + if (!selected && theme != NULL && (pair = pidgin_blist_theme_get_idle_text_info(theme)) != NULL && pair->color != NULL) textcolor = pair->color; else textcolor = "black"; - idle = g_strdup_printf("%d:%02d", - textcolor, (pair == NULL || pair->font == NULL) ? "" : pair->color, ihrs, imin); + idle = g_strdup_printf("%d:%02d", textcolor, + (pair == NULL || pair->font == NULL) ? "" : pair->color, ihrs, imin); } } @@ -6233,17 +6235,18 @@ gchar *mark; GdkColor *color = NULL; PidginBlistTheme *theme = pidgin_blist_get_theme(); + gboolean selected = (gtkblist->selected_node == cnode); mark = g_markup_escape_text(purple_contact_get_alias(contact), -1); if (theme != NULL) { FontColorPair *pair = pidgin_blist_theme_get_contact_text_info(theme); color = pidgin_blist_theme_get_contact_color(theme); - + if (pair != NULL) { - gchar *temp = g_strdup_printf("%s", - (pair->font == NULL) ? "" : pair->font, - (pair->color == NULL) ? "black" : pair->color, mark); + gchar *temp = g_strdup_printf("%s", + (selected || pair->color == NULL || contact) ? "black" : pair->color, + (pair->font == NULL) ? "" : pair->font, mark); g_free(mark); mark = temp; @@ -6336,6 +6339,7 @@ GdkColor *bgcolor = NULL; FontColorPair *pair; PidginBlistTheme *theme; + gboolean selected = (gtkblist->selected_node == node); if (!insert_node(list, node, &iter)) return; @@ -6364,15 +6368,13 @@ else if (hidden) pair = pidgin_blist_theme_get_unread_message_text_info(theme); else pair = pidgin_blist_theme_get_online_text_info(theme); - + font = (pair == NULL || pair->font == NULL) ? "" : g_strdup(pair->font); - color = (pair == NULL || pair->color == NULL) ? "black" : g_strdup(pair->color); + color = (selected || pair == NULL || pair->color == NULL) ? "black" : g_strdup(pair->color); tmp = g_strdup_printf("%s", font, color, hidden ? "bold" : "normal", mark); - g_free(font); - g_free(color); g_free(mark); mark = tmp; @@ -6404,6 +6406,7 @@ g_object_unref(avatar); if(prpl_icon) g_object_unref(prpl_icon); + } else { pidgin_blist_hide_node(list, node, TRUE); }