comparison src/dialogs.c @ 7714:3d9d3d21e600

[gaim-migrate @ 8359] I rock so hard! This is just too easy. WYSIWYG foreground and background colors. The observant commit watcher will note that I'm not really paying too close attention to the toolbar UI yet. And as a result, it doesn't really work too great. The plan is to make the toolbar its own GtkWidget, which will attach to a GtkIMHtml. The GtkIMHtml will emit signals to it, telling it what state it should be in, and the toolbar will manipulate the GtkIMHtml accordingly. This way, anything that has text entry can have a toolbar with which to edit it. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 03 Dec 2003 04:17:42 +0000
parents 17756d5dcfdf
children edebf99a5ec4
comparison
equal deleted inserted replaced
7713:1adc71ed6d45 7714:3d9d3d21e600
1091 /* GTK_IS_EDITABLE(c->entry); huh? */ 1091 /* GTK_IS_EDITABLE(c->entry); huh? */
1092 1092
1093 gtkconv = GAIM_GTK_CONVERSATION(c); 1093 gtkconv = GAIM_GTK_CONVERSATION(c);
1094 1094
1095 gtkconv->fg_color = text_color; 1095 gtkconv->fg_color = text_color;
1096 g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", 1096 g_snprintf(open_tag, 23, "#%02X%02X%02X",
1097 text_color.red / 256, 1097 text_color.red / 256,
1098 text_color.green / 256, 1098 text_color.green / 256,
1099 text_color.blue / 256); 1099 text_color.blue / 256);
1100 gaim_gtk_surround(gtkconv, open_tag, "</FONT>"); 1100 gtk_imhtml_toggle_forecolor(GTK_IMHTML(gtkconv->entry), open_tag);
1101 1101
1102 gaim_debug(GAIM_DEBUG_MISC, "fgcolor dialog", "#%02X%02X%02X\n",
1103 text_color.red / 256,
1104 text_color.green / 256,
1105 text_color.blue / 256);
1106 g_free(open_tag); 1102 g_free(open_tag);
1107 cancel_fgcolor(NULL, c); 1103 cancel_fgcolor(NULL, c);
1108 } 1104 }
1109 1105
1110 void do_bgcolor(GtkWidget *widget, GtkColorSelection *colorsel) 1106 void do_bgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
1122 /* GTK_IS_EDITABLE(c->entry); huh? */ 1118 /* GTK_IS_EDITABLE(c->entry); huh? */
1123 1119
1124 gtkconv = GAIM_GTK_CONVERSATION(c); 1120 gtkconv = GAIM_GTK_CONVERSATION(c);
1125 1121
1126 gtkconv->bg_color = text_color; 1122 gtkconv->bg_color = text_color;
1127 g_snprintf(open_tag, 25, "<BODY BGCOLOR=\"#%02X%02X%02X\">", 1123 g_snprintf(open_tag, 25, "#%02X%02X%02X",
1128 text_color.red / 256, 1124 text_color.red / 256,
1129 text_color.green / 256, 1125 text_color.green / 256,
1130 text_color.blue / 256); 1126 text_color.blue / 256);
1131 gaim_gtk_surround(gtkconv, open_tag, "</BODY>"); 1127 gtk_imhtml_toggle_backcolor(GTK_IMHTML(gtkconv->entry), open_tag);
1132 gaim_debug(GAIM_DEBUG_MISC, "bgcolor dialog", "#%02X%02X%02X\n", 1128
1133 text_color.red / 256,
1134 text_color.green / 256,
1135 text_color.blue / 256);
1136
1137 g_free(open_tag); 1129 g_free(open_tag);
1138 cancel_bgcolor(NULL, c); 1130 cancel_bgcolor(NULL, c);
1139 } 1131 }
1140 1132
1141 void show_fgcolor_dialog(GaimConversation *c, GtkWidget *color) 1133 void show_fgcolor_dialog(GaimConversation *c, GtkWidget *color)