Mercurial > pidgin
diff src/gtkimhtmltoolbar.c @ 9025:b24967757d46
[gaim-migrate @ 9801]
"
- Fixed text-decoration: underline; parsing from being dependent on font-size
specified
- IM HTML Toolbar dialogs now automatically fill with the color/font for the
current text
- Made most of the IMHTML formatting buttons fire signals where appropriate
- Implemented a global on or off "Send default formatting with outgoing
messages" option
- If user previously sent a font name, we assume they want formatting on,
otherwise it defaults to off.
- Removed font and color from the GaimGtkConversation struct, because this
wasn't being used anywhere, by anything and just resulted in more confusing
code.
- Removed three functions related to the struct, including one that was
declared, but never actually written.
- Added get_current_fontface, get_current_fontsize, get_current_forecolor,
get_current_backcolor to gtk_imhtml_* to get the formatting at the cursor
(or whole buffer when wbfo is on)
- Removed all dialogs used only by the old default formatting preferences from
dialogs.c
- When font background, color, or face are "disabled" they are stored as an
empty string in their prefs.
- Fixed a bug where NULL for background, color, or face did not remove the
tags in wbfo
" all that, quoth SimGuy
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sun, 23 May 2004 03:54:20 +0000 |
parents | 4ff4c34b7500 |
children | 1bd8bda384e7 |
line wrap: on
line diff
--- a/src/gtkimhtmltoolbar.c Sun May 23 02:42:01 2004 +0000 +++ b/src/gtkimhtmltoolbar.c Sun May 23 03:54:20 2004 +0000 @@ -153,27 +153,26 @@ static void toggle_font(GtkWidget *font, GtkIMHtmlToolbar *toolbar) { -#if 0 - char fonttif[128]; - const char *fontface; -#endif + const char *fontname; g_return_if_fail(toolbar); + fontname = gtk_imhtml_get_current_fontface(GTK_IMHTML(toolbar->imhtml)); + if (!toolbar->font_dialog) { toolbar->font_dialog = gtk_font_selection_dialog_new(_("Select Font")); g_object_set_data(G_OBJECT(toolbar->font_dialog), "gaim_toolbar", toolbar); - /* if (gtkconv->fontface[0]) { - g_snprintf(fonttif, sizeof(fonttif), "%s 12", gtkconv->fontface); - gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(gtkconv->dialogs.font), - fonttif); - } else { - gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(gtkconv->dialogs.font), - DEFAULT_FONT_FACE); - } - */ + if(fontname) { + char fonttif[128]; + g_snprintf(fonttif, sizeof(fonttif), "%s 12", fontname); + gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog), + fonttif); + } else { + gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(toolbar->font_dialog), + DEFAULT_FONT_FACE); + } g_signal_connect(G_OBJECT(toolbar->font_dialog), "delete_event", G_CALLBACK(destroy_toolbar_font), toolbar); @@ -231,15 +230,18 @@ { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(color))) { GtkWidget *colorsel; - /* GdkColor fgcolor; */ + GdkColor fgcolor; + const char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(toolbar->imhtml)); - /*gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), - &fgcolor);*/ if (!toolbar->fgcolor_dialog) { toolbar->fgcolor_dialog = gtk_color_selection_dialog_new(_("Select Text Color")); colorsel = GTK_COLOR_SELECTION_DIALOG(toolbar->fgcolor_dialog)->colorsel; - //gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &fgcolor); + if (color) { + gdk_color_parse(color, &fgcolor); + gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &fgcolor); + } + g_object_set_data(G_OBJECT(colorsel), "gaim_toolbar", toolbar); g_signal_connect(G_OBJECT(toolbar->fgcolor_dialog), "delete_event", @@ -301,15 +303,18 @@ { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(color))) { GtkWidget *colorsel; - /* GdkColor bgcolor; */ + GdkColor bgcolor; + const char *color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(toolbar->imhtml)); - /*gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), - &bgcolor);*/ if (!toolbar->bgcolor_dialog) { toolbar->bgcolor_dialog = gtk_color_selection_dialog_new(_("Select Background Color")); colorsel = GTK_COLOR_SELECTION_DIALOG(toolbar->bgcolor_dialog)->colorsel; - //gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &bgcolor); + if (color) { + gdk_color_parse(color, &bgcolor); + gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &bgcolor); + } + g_object_set_data(G_OBJECT(colorsel), "gaim_toolbar", toolbar); g_signal_connect(G_OBJECT(toolbar->bgcolor_dialog), "delete_event",