| 8174 purple_signal_connect(purple_conversations_get_handle(), "wrote-im-msg", handle, |
8175 purple_signal_connect(purple_conversations_get_handle(), "wrote-im-msg", handle, |
| 8175 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL); |
8176 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL); |
| 8176 purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", handle, |
8177 purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", handle, |
| 8177 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL); |
8178 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL); |
| 8178 |
8179 |
| 8179 { |
8180 } |
| 8180 /* Set default tab colors */ |
8181 |
| 8181 GString *str = g_string_new(NULL); |
8182 /* Invalidate the first tab color set */ |
| 8182 GtkSettings *settings = gtk_settings_get_default(); |
8183 static gboolean tab_color_fuse = TRUE; |
| 8183 GtkStyle *parent = gtk_rc_get_style_by_paths(settings, "tab-container.tab-label*", NULL, G_TYPE_NONE), *now; |
8184 |
| 8184 struct { |
8185 static void |
| 8185 const char *stylename; |
8186 pidgin_conversations_set_tab_colors(void) |
| 8186 const char *labelname; |
8187 { |
| 8187 const char *color; |
8188 /* Set default tab colors */ |
| 8188 } styles[] = { |
8189 GString *str = g_string_new(NULL); |
| 8189 {"pidgin_tab_label_typing_default", "tab-label-typing", "#4e9a06"}, |
8190 GtkSettings *settings = gtk_settings_get_default(); |
| 8190 {"pidgin_tab_label_typed_default", "tab-label-typed", "#c4a000"}, |
8191 GtkStyle *parent = gtk_rc_get_style_by_paths(settings, "tab-container.tab-label*", NULL, G_TYPE_NONE), *now; |
| 8191 {"pidgin_tab_label_attention_default", "tab-label-attention", "#006aff"}, |
8192 struct { |
| 8192 {"pidgin_tab_label_unreadchat_default", "tab-label-unreadchat", "#cc0000"}, |
8193 const char *stylename; |
| 8193 {"pidgin_tab_label_event_default", "tab-label-event", "#888a85"}, |
8194 const char *labelname; |
| 8194 {NULL, NULL, NULL} |
8195 const char *color; |
| 8195 }; |
8196 } styles[] = { |
| 8196 int iter; |
8197 {"pidgin_tab_label_typing_default", "tab-label-typing", "#4e9a06"}, |
| 8197 for (iter = 0; styles[iter].stylename; iter++) { |
8198 {"pidgin_tab_label_typed_default", "tab-label-typed", "#c4a000"}, |
| 8198 now = gtk_rc_get_style_by_paths(settings, styles[iter].labelname, NULL, G_TYPE_NONE); |
8199 {"pidgin_tab_label_attention_default", "tab-label-attention", "#006aff"}, |
| 8199 if (parent == now || |
8200 {"pidgin_tab_label_unreadchat_default", "tab-label-unreadchat", "#cc0000"}, |
| 8200 (parent && now && parent->rc_style == now->rc_style)) { |
8201 {"pidgin_tab_label_event_default", "tab-label-event", "#888a85"}, |
| 8201 g_string_append_printf(str, "style \"%s\" {\n" |
8202 {NULL, NULL, NULL} |
| 8202 "fg[ACTIVE] = \"%s\"\n" |
8203 }; |
| 8203 "}\n" |
8204 int iter; |
| 8204 "widget \"*%s\" style \"%s\"\n", |
8205 |
| 8205 styles[iter].stylename, |
8206 if(tab_color_fuse) { |
| 8206 styles[iter].color, |
8207 tab_color_fuse = FALSE; |
| 8207 styles[iter].labelname, styles[iter].stylename); |
8208 return; |
| 8208 } |
8209 } |
| 8209 } |
8210 |
| 8210 gtk_rc_parse_string(str->str); |
8211 for (iter = 0; styles[iter].stylename; iter++) { |
| 8211 g_string_free(str, TRUE); |
8212 now = gtk_rc_get_style_by_paths(settings, styles[iter].labelname, NULL, G_TYPE_NONE); |
| 8212 gtk_rc_reset_styles(settings); |
8213 if (parent == now || |
| 8213 } |
8214 (parent && now && parent->rc_style == now->rc_style)) { |
| |
8215 GdkColor color; |
| |
8216 gdk_color_parse(styles[iter].color, &color); |
| |
8217 pidgin_style_adjust_contrast(gtk_widget_get_default_style(), &color); |
| |
8218 |
| |
8219 g_string_append_printf(str, "style \"%s\" {\n" |
| |
8220 "fg[ACTIVE] = \"%s\"\n" |
| |
8221 "}\n" |
| |
8222 "widget \"*%s\" style \"%s\"\n", |
| |
8223 styles[iter].stylename, |
| |
8224 gdk_color_to_string(&color), |
| |
8225 styles[iter].labelname, styles[iter].stylename); |
| |
8226 } |
| |
8227 } |
| |
8228 gtk_rc_parse_string(str->str); |
| |
8229 g_string_free(str, TRUE); |
| |
8230 gtk_rc_reset_styles(settings); |
| 8214 } |
8231 } |
| 8215 |
8232 |
| 8216 void |
8233 void |
| 8217 pidgin_conversations_uninit(void) |
8234 pidgin_conversations_uninit(void) |
| 8218 { |
8235 { |