--- a/pidgin/gtkblist.c Fri Feb 12 00:17:08 2021 -0600
+++ b/pidgin/gtkblist.c Fri Feb 12 02:16:44 2021 -0600
@@ -131,7 +131,6 @@
BUDDY_ICON_VISIBLE_COLUMN,
GROUP_EXPANDER_VISIBLE_COLUMN,
@@ -3787,7 +3786,7 @@
pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected, gboolean aliased)
- const char *name, *status_color, *dim_grey;
+ const char *name, *name_color, *status_color, *dim_grey; PurpleProtocol *protocol = NULL;
@@ -3887,15 +3886,20 @@
dim_grey = pidgin_style_context_is_dark() ? "light slate grey" : "dim grey";
+ /* choose the colors of the text */ + status_color = dim_grey; if(purple_presence_is_idle(presence) ||
!purple_presence_is_online(presence))
- status_color = dim_grey;
if(aliased && selected) {
@@ -3908,22 +3912,33 @@
/* Put it all together */
if ((!aliased || biglist) && (statustext || idletime)) {
/* using <span size='smaller'> breaks the status, so it must be seperated into <small><span>*/
text = g_strdup_printf("<span foreground='%s'>%s</span>\n"
- "<small><span foreground='%s'>%s%s%s</span></small>",
- status_color, nametext, status_color,
- idletime != NULL ? idletime : "",
- (idletime != NULL && statustext != NULL) ? " - " : "",
- statustext != NULL ? statustext : "");
+ "<small><span foreground='%s'>%s%s%s</span></small>", + name_color, nametext, status_color, + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); + } else if (status_color) { + text = g_strdup_printf("%s\n<small><span foreground='%s'>%s%s%s</span></small>", + nametext, status_color, + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); text = g_strdup_printf("%s\n<small>%s%s%s</small>",
- idletime != NULL ? idletime : "",
- (idletime != NULL && statustext != NULL) ? " - " : "",
- statustext != NULL ? statustext : "");
+ idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); - text = g_strdup_printf("%s", nametext);
+ text = g_strdup_printf("<span color='%s'>%s</span>", + text = g_strdup_printf("%s", nametext); @@ -4966,8 +4981,6 @@
GtkTreeViewColumn *column;
- gint i, status_icon = 0, text = 1, emblem = 2, protocol_icon = 3, buddy_icon = 4;
column = gtkblist->text_column;
@@ -4980,7 +4993,6 @@
"visible", GROUP_EXPANDER_VISIBLE_COLUMN,
"is-expanded", GROUP_EXPANDER_COLUMN,
"sensitive", GROUP_EXPANDER_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
@@ -4990,81 +5002,67 @@
"visible", CONTACT_EXPANDER_VISIBLE_COLUMN,
"is-expanded", CONTACT_EXPANDER_COLUMN,
"sensitive", CONTACT_EXPANDER_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
+ rend = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "pixbuf", STATUS_ICON_COLUMN, + "visible", STATUS_ICON_VISIBLE_COLUMN,
- for (i = 0; i < 5; i++) {
- if (status_icon == i) {
- rend = gtk_cell_renderer_pixbuf_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_set_attributes(column, rend,
- "pixbuf", STATUS_ICON_COLUMN,
- "visible", STATUS_ICON_VISIBLE_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
- g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL);
- } else if (text == i) {
- gtkblist->text_rend = rend = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, rend, TRUE);
- gtk_tree_view_column_set_attributes(column, rend,
- "cell-background-rgba", BGCOLOR_COLUMN,
- G_OBJECT(rend), "editing-started",
- G_CALLBACK(gtk_blist_renderer_editing_started_cb),
- g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list);
- g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list);
- g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
- g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
- rend = gtk_cell_renderer_text_new();
- g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_set_attributes(column, rend,
- "visible", IDLE_VISIBLE_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
- } else if (emblem == i) {
- rend = gtk_cell_renderer_pixbuf_new();
- g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL);
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
- "visible", EMBLEM_VISIBLE_COLUMN, NULL);
- } else if (protocol_icon == i) {
- rend = gtk_cell_renderer_pixbuf_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_set_attributes(column, rend,
- "pixbuf", PROTOCOL_ICON_COLUMN,
- "visible", PROTOCOL_ICON_VISIBLE_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
- g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL);
- } else if (buddy_icon == i) {
- rend = gtk_cell_renderer_pixbuf_new();
- g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN,
- "cell-background-rgba", BGCOLOR_COLUMN,
- "visible", BUDDY_ICON_VISIBLE_COLUMN,
+ g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL); + gtkblist->text_rend = rend = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(column, rend, TRUE); + gtk_tree_view_column_set_attributes(column, rend, + g_signal_connect(G_OBJECT(rend), "editing-started", + G_CALLBACK(gtk_blist_renderer_editing_started_cb), list); + g_signal_connect(G_OBJECT(rend), "editing-canceled", + G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list); + g_signal_connect(G_OBJECT(rend), "edited", + G_CALLBACK(gtk_blist_renderer_edited_cb), list); + g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); + g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); + rend = gtk_cell_renderer_text_new(); + g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "visible", IDLE_VISIBLE_COLUMN, + rend = gtk_cell_renderer_pixbuf_new(); + g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "pixbuf", EMBLEM_COLUMN, + "visible", EMBLEM_VISIBLE_COLUMN, NULL); + rend = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "pixbuf", PROTOCOL_ICON_COLUMN, + "visible", PROTOCOL_ICON_VISIBLE_COLUMN, + g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL); + rend = gtk_cell_renderer_pixbuf_new(); + g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "pixbuf", BUDDY_ICON_COLUMN, + "visible", BUDDY_ICON_VISIBLE_COLUMN, @@ -5242,7 +5240,6 @@
GDK_TYPE_PIXBUF, /* Buddy icon */
G_TYPE_BOOLEAN, /* Buddy icon visible */
G_TYPE_POINTER, /* Node */
- GDK_TYPE_RGBA, /* bgcolor */
G_TYPE_BOOLEAN, /* Group expander */
G_TYPE_BOOLEAN, /* Group expander visible */
G_TYPE_BOOLEAN, /* Contact expander */
@@ -5665,7 +5662,6 @@
- GdkRGBA *bgcolor = NULL;
GdkPixbuf *avatar = NULL;
if(!insert_node(list, gnode, &iter))
@@ -5687,7 +5683,6 @@
STATUS_ICON_COLUMN, NULL,
- BGCOLOR_COLUMN, bgcolor,
GROUP_EXPANDER_COLUMN, TRUE,
GROUP_EXPANDER_VISIBLE_COLUMN, TRUE,
CONTACT_EXPANDER_VISIBLE_COLUMN, FALSE,
@@ -5725,7 +5720,7 @@
esc = g_markup_escape_text(purple_group_get_name(group), -1);
- mark = g_strdup_printf("<span><b>%s</b>%s%s%s</span>",
+ mark = g_strdup_printf("<b>%s</b>%s%s%s", !expanded ? " <span weight='light'>(</span>" : "",
@@ -5740,7 +5735,6 @@
PurplePresence *presence = purple_buddy_get_presence(buddy);
PidginBlistNode *pidgin_node = NULL;
GdkPixbuf *status, *avatar, *emblem, *protocol_icon;
gboolean selected = (gtkblist->selected_node == node);
@@ -5776,9 +5770,7 @@
time_t idle_secs = purple_presence_get_idle_time(presence);
- const gchar *textcolor;
@@ -5787,16 +5779,13 @@
imin = ((t - idle_secs) / 60) % 60;
+ idle = g_strdup_printf("%d:%02d", ihrs, imin); - textcolor = pidgin_style_context_is_dark() ? "light slate grey" : "dim grey";
idle = g_strdup_printf("<span color='%s'>%d:%02d</span>",
- textcolor, ihrs, imin);
- idle = g_strdup_printf("<span>%d:%02d</span>", ihrs, imin);
+ pidgin_style_context_is_dark() @@ -5815,7 +5804,6 @@
EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
PROTOCOL_ICON_COLUMN, protocol_icon,
PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
CONTACT_EXPANDER_COLUMN, NULL,
CONTACT_EXPANDER_VISIBLE_COLUMN, pidgin_node->contact_expanded,
GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
@@ -5873,13 +5861,9 @@
if(gtknode->contact_expanded) {
mark = g_markup_escape_text(purple_contact_get_alias(contact), -1);
- tmp = g_strdup_printf("<span>%s</span>", mark);
status = pidgin_blist_get_status_icon(cnode,
biglist? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL);
@@ -5890,7 +5874,6 @@
IDLE_VISIBLE_COLUMN, FALSE,
CONTACT_EXPANDER_COLUMN, TRUE,
CONTACT_EXPANDER_VISIBLE_COLUMN, TRUE,
@@ -5965,7 +5948,6 @@
PurpleConversation *conv;
- GdkRGBA *bgcolor = NULL;
gboolean selected = (gtkblist->selected_node == node);
gboolean nick_said = FALSE;
@@ -6018,7 +6000,6 @@
PROTOCOL_ICON_COLUMN, protocol_icon,
PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
- BGCOLOR_COLUMN, bgcolor,
GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,