Mercurial > pidgin
comparison src/gtkconv.c @ 11737:3959c29f340f
[gaim-migrate @ 14028]
This isn't customizable yet, but that's looking uglier than I like. This
should still help people like Sean with problems seeing certain colors. I
picked what made sense to me, people please change things if you think
differently.
committer: Tailor Script <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Sun, 23 Oct 2005 03:57:10 +0000 |
parents | 2f6b4c544d5b |
children | 14675df16cd8 |
comparison
equal
deleted
inserted
replaced
11736:a14d72b6ca41 | 11737:3959c29f340f |
---|---|
2648 GtkWidget *image; | 2648 GtkWidget *image; |
2649 GtkWidget *menuitem; | 2649 GtkWidget *menuitem; |
2650 GdkPixbuf *pixbuf; | 2650 GdkPixbuf *pixbuf; |
2651 gchar *text; | 2651 gchar *text; |
2652 | 2652 |
2653 | |
2654 account = bud->account; | 2653 account = bud->account; |
2655 | 2654 |
2656 /* Create a pixmap for the protocol icon. */ | 2655 /* Create a pixmap for the protocol icon. */ |
2657 pixbuf = gaim_gtk_blist_get_status_icon((GaimBlistNode*)bud, GAIM_STATUS_ICON_SMALL); | 2656 pixbuf = gaim_gtk_blist_get_status_icon((GaimBlistNode*)bud, GAIM_STATUS_ICON_SMALL); |
2658 /* Now convert it to GtkImage */ | 2657 /* Now convert it to GtkImage */ |
4920 type == GAIM_CONV_UPDATE_TITLE) | 4919 type == GAIM_CONV_UPDATE_TITLE) |
4921 { | 4920 { |
4922 char *title; | 4921 char *title; |
4923 GaimConvIm *im = NULL; | 4922 GaimConvIm *im = NULL; |
4924 GaimConnection *gc = gaim_conversation_get_gc(conv); | 4923 GaimConnection *gc = gaim_conversation_get_gc(conv); |
4925 char color[8]; | 4924 /* I think this is a little longer than it needs to be but I'm lazy. */ |
4925 char style[51]; | |
4926 | 4926 |
4927 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) | 4927 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) |
4928 im = GAIM_CONV_IM(conv); | 4928 im = GAIM_CONV_IM(conv); |
4929 | 4929 |
4930 if (!gc || ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) | 4930 if (!gc || ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) |
4931 && gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)))) | 4931 && gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)))) |
4932 title = g_strdup_printf("(%s)", gaim_conversation_get_title(conv)); | 4932 title = g_strdup_printf("(%s)", gaim_conversation_get_title(conv)); |
4933 | |
4934 else | 4933 else |
4935 title = g_strdup(gaim_conversation_get_title(conv)); | 4934 title = g_strdup(gaim_conversation_get_title(conv)); |
4936 | 4935 |
4937 *color = '\0'; | 4936 *style = '\0'; |
4938 | 4937 |
4939 if (!GTK_WIDGET_REALIZED(gtkconv->tab_label)) | 4938 if (!GTK_WIDGET_REALIZED(gtkconv->tab_label)) |
4940 gtk_widget_realize(gtkconv->tab_label); | 4939 gtk_widget_realize(gtkconv->tab_label); |
4941 | 4940 |
4942 if (im != NULL && gaim_conv_im_get_typing_state(im) == GAIM_TYPING) | 4941 if (im != NULL && |
4942 gaim_conv_im_get_typing_state(im) == GAIM_TYPING) | |
4943 { | 4943 { |
4944 strcpy(color, "#47A046"); | 4944 strncpy(style, "color=\"#47A046\" style=\"italic\"", sizeof(style)); |
4945 } | 4945 } |
4946 else if (im != NULL && gaim_conv_im_get_typing_state(im) == GAIM_TYPED) | 4946 else if (im != NULL && |
4947 gaim_conv_im_get_typing_state(im) == GAIM_TYPED) | |
4947 { | 4948 { |
4948 strcpy(color, "#D1940C"); | 4949 strncpy(style, "color=\"#D1940C\"", sizeof(style)); |
4949 } | 4950 } |
4950 else if (gtkconv->unseen_state == GAIM_UNSEEN_NICK) | 4951 else if (gtkconv->unseen_state == GAIM_UNSEEN_NICK) |
4951 { | 4952 { |
4952 strcpy(color, "#0D4E91"); | 4953 strncpy(style, "color=\"#0D4E91\" style=\"italic\" weight=\"bold\"", sizeof(style)); |
4953 } | 4954 } |
4954 else if (gtkconv->unseen_state == GAIM_UNSEEN_TEXT) | 4955 else if (gtkconv->unseen_state == GAIM_UNSEEN_TEXT) |
4955 { | 4956 { |
4956 strcpy(color, "#DF421E"); | 4957 strncpy(style, "color=\"#DF421E\" weight=\"bold\"", sizeof(style)); |
4957 } | 4958 } |
4958 else if (gtkconv->unseen_state == GAIM_UNSEEN_EVENT) | 4959 else if (gtkconv->unseen_state == GAIM_UNSEEN_EVENT) |
4959 { | 4960 { |
4960 strcpy(color, "#868272"); | 4961 strncpy(style, "color=\"#868272\"", sizeof(style)); |
4961 } | 4962 } |
4962 | 4963 |
4963 if (*color != '\0') | 4964 if (*style != '\0') |
4964 { | 4965 { |
4965 char *html_title,*label; | 4966 char *html_title,*label; |
4966 | 4967 |
4967 html_title = g_markup_escape_text(title, -1); | 4968 html_title = g_markup_escape_text(title, -1); |
4968 | 4969 |
4969 label = g_strdup_printf("<span color=\"%s\">%s</span>", | 4970 label = g_strdup_printf("<span %s>%s</span>", |
4970 color, html_title); | 4971 style, html_title); |
4971 g_free(html_title); | 4972 g_free(html_title); |
4972 gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label); | 4973 gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label); |
4973 g_free(label); | 4974 g_free(label); |
4974 } | 4975 } |
4975 else | 4976 else |
5616 #include "gtkutils.h" | 5617 #include "gtkutils.h" |
5617 #include "gtkstock.h" | 5618 #include "gtkstock.h" |
5618 #include "gtkimhtml.h" | 5619 #include "gtkimhtml.h" |
5619 #include "gtkimhtmltoolbar.h" | 5620 #include "gtkimhtmltoolbar.h" |
5620 | 5621 |
5621 | |
5622 | |
5623 | |
5624 | |
5625 static void | 5622 static void |
5626 do_close(GtkWidget *w, int resp, GaimGtkWindow *win) | 5623 do_close(GtkWidget *w, int resp, GaimGtkWindow *win) |
5627 { | 5624 { |
5628 gtk_widget_destroy(warn_close_dialog); | 5625 gtk_widget_destroy(warn_close_dialog); |
5629 warn_close_dialog = NULL; | 5626 warn_close_dialog = NULL; |