pidgin/gtkstatusbox.c

changeset 37996
6c9cb1e8b2d9
parent 37879
38eebb7c9019
child 37997
7b62a2153898
equal deleted inserted replaced
37995:d5ab4262ea77 37996:6c9cb1e8b2d9
595 * should modify status_box->store 595 * should modify status_box->store
596 */ 596 */
597 static void 597 static void
598 pidgin_status_box_refresh(PidginStatusBox *status_box) 598 pidgin_status_box_refresh(PidginStatusBox *status_box)
599 { 599 {
600 GtkStyle *style; 600 const char *aa_color;
601 char aa_color[8];
602 PurpleSavedStatus *saved_status; 601 PurpleSavedStatus *saved_status;
603 char *primary, *secondary, *text; 602 char *primary, *secondary, *text;
604 const char *stock = NULL; 603 const char *stock = NULL;
605 GdkPixbuf *emblem = NULL; 604 GdkPixbuf *emblem = NULL;
606 GtkTreePath *path; 605 GtkTreePath *path;
607 gboolean account_status = FALSE; 606 gboolean account_status = FALSE;
608 PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account; 607 PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account;
609
610 style = gtk_widget_get_style(GTK_WIDGET(status_box));
611 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x",
612 style->text_aa[GTK_STATE_NORMAL].red >> 8,
613 style->text_aa[GTK_STATE_NORMAL].green >> 8,
614 style->text_aa[GTK_STATE_NORMAL].blue >> 8);
615 608
616 saved_status = purple_savedstatus_get_current(); 609 saved_status = purple_savedstatus_get_current();
617 610
618 if (status_box->account || (status_box->token_status_account 611 if (status_box->account || (status_box->token_status_account
619 && purple_savedstatus_is_transient(saved_status))) 612 && purple_savedstatus_is_transient(saved_status)))
691 } 684 }
692 685
693 stock = pidgin_stock_id_from_status_primitive(prim); 686 stock = pidgin_stock_id_from_status_primitive(prim);
694 } 687 }
695 688
689 aa_color = pidgin_get_dim_grey_string(GTK_WIDGET(status_box));
696 if (status_box->account != NULL) { 690 if (status_box->account != NULL) {
697 text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>", 691 text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>",
698 purple_account_get_username(status_box->account), 692 purple_account_get_username(status_box->account),
699 aa_color, secondary ? secondary : primary); 693 aa_color, secondary ? secondary : primary);
700 emblem = pidgin_create_protocol_icon(status_box->account, PIDGIN_PROTOCOL_ICON_SMALL); 694 emblem = pidgin_create_protocol_icon(status_box->account, PIDGIN_PROTOCOL_ICON_SMALL);
2076 { 2070 {
2077 text = g_markup_escape_text(title, -1); 2071 text = g_markup_escape_text(title, -1);
2078 } 2072 }
2079 else 2073 else
2080 { 2074 {
2081 GtkStyle *style; 2075 const char *aa_color;
2082 char aa_color[8];
2083 gchar *escaped_title, *escaped_desc; 2076 gchar *escaped_title, *escaped_desc;
2084 2077
2085 style = gtk_widget_get_style(GTK_WIDGET(status_box)); 2078 aa_color = pidgin_get_dim_grey_string(GTK_WIDGET(status_box));
2086 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x",
2087 style->text_aa[GTK_STATE_NORMAL].red >> 8,
2088 style->text_aa[GTK_STATE_NORMAL].green >> 8,
2089 style->text_aa[GTK_STATE_NORMAL].blue >> 8);
2090 2079
2091 escaped_title = g_markup_escape_text(title, -1); 2080 escaped_title = g_markup_escape_text(title, -1);
2092 escaped_desc = g_markup_escape_text(desc, -1); 2081 escaped_desc = g_markup_escape_text(desc, -1);
2093 text = g_strdup_printf("%s - <span color=\"%s\" size=\"smaller\">%s</span>", 2082 text = g_strdup_printf("%s - <span color=\"%s\" size=\"smaller\">%s</span>",
2094 escaped_title, 2083 escaped_title,

mercurial