# HG changeset patch # User Ethan Blanton # Date 1188235336 0 # Node ID 217c4b1d3a09a0d2129d161c68c6a8235956baee # Parent 286438542b24e76dc9abedfd7ee35a8e7c19dde3# Parent fb69c4dd757e8cb23fd68cd2caf670696c6ff267 merge of 'b6c53eca73f8f22b0d8fafd412b2570c631455be' and 'db850ab42d8f30eaba15fafaa3dc5ec1137141e7' diff -r 286438542b24 -r 217c4b1d3a09 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Mon Aug 27 17:21:35 2007 +0000 +++ b/pidgin/gtkconv.c Mon Aug 27 17:22:16 2007 +0000 @@ -2271,7 +2271,7 @@ const char *name = NULL; GdkPixbuf *status = NULL; PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); - const char *icon_size = small_icon ? "pidgin-icon-size-tango-microscopic" : PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL; + const char *icon_size = small_icon ? PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC : PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL; g_return_val_if_fail(conv != NULL, NULL); account = purple_conversation_get_account(conv); diff -r 286438542b24 -r 217c4b1d3a09 pidgin/gtkimhtmltoolbar.c --- a/pidgin/gtkimhtmltoolbar.c Mon Aug 27 17:21:35 2007 +0000 +++ b/pidgin/gtkimhtmltoolbar.c Mon Aug 27 17:22:16 2007 +0000 @@ -70,6 +70,14 @@ } static void +do_strikethrough(GtkWidget *strikethrough, GtkIMHtmlToolbar *toolbar) +{ + g_return_if_fail(toolbar != NULL); + gtk_imhtml_toggle_strike(GTK_IMHTML(toolbar->imhtml)); + gtk_widget_grab_focus(toolbar->imhtml); +} + +static void do_small(GtkWidget *smalltb, GtkIMHtmlToolbar *toolbar) { g_return_if_fail(toolbar != NULL); @@ -433,6 +441,17 @@ gtk_widget_grab_focus(toolbar->imhtml); } +static void insert_hr_cb(GtkWidget *widget, GtkIMHtmlToolbar *toolbar) +{ + GtkTextIter iter; + GtkTextMark *ins; + GtkIMHtmlScalable *hr; + + ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml))); + gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml)), &iter, ins); + hr = gtk_imhtml_hr_new(); + gtk_imhtml_hr_add_to(hr, GTK_IMHTML(toolbar->imhtml), &iter); +} static void do_insert_image_cb(GtkWidget *widget, int response, GtkIMHtmlToolbar *toolbar) @@ -1027,6 +1046,13 @@ G_CALLBACK(do_underline), toolbar); toolbar->underline = button; + + /* Strikethrough */ + button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_STRIKETHROUGH); + g_signal_connect(G_OBJECT(button), "clicked", + G_CALLBACK(do_strikethrough), toolbar); + toolbar->strikethrough = button; + /* Increase font size */ button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_TEXT_LARGER); g_signal_connect(G_OBJECT(button), "clicked", @@ -1124,6 +1150,7 @@ {_("_Bold"), &toolbar->bold, TRUE}, {_("_Italic"), &toolbar->italic, TRUE}, {_("_Underline"), &toolbar->underline, TRUE}, + {_("Strikethrough"), &toolbar->strikethrough, TRUE}, {_("_Larger"), &toolbar->larger_size, TRUE}, #if 0 {_("_Normal"), &toolbar->normal_size, TRUE}, @@ -1230,6 +1257,11 @@ g_signal_connect(G_OBJECT(toolbar->link), "notify::sensitive", G_CALLBACK(button_sensitiveness_changed), menuitem); + menuitem = gtk_menu_item_new_with_mnemonic(_("_Horizontal rule")); + g_signal_connect(G_OBJECT(menuitem), "activate" , G_CALLBACK(insert_hr_cb), toolbar); + gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), menuitem); + toolbar->insert_hr = menuitem; + g_signal_connect_swapped(G_OBJECT(insert_button), "button-press-event", G_CALLBACK(gtk_widget_activate), insert_button); g_signal_connect(G_OBJECT(insert_button), "activate", G_CALLBACK(pidgin_menu_clicked), insert_menu); g_signal_connect(G_OBJECT(insert_menu), "deactivate", G_CALLBACK(pidgin_menu_deactivate), insert_button); diff -r 286438542b24 -r 217c4b1d3a09 pidgin/gtkimhtmltoolbar.h --- a/pidgin/gtkimhtmltoolbar.h Mon Aug 27 17:21:35 2007 +0000 +++ b/pidgin/gtkimhtmltoolbar.h Mon Aug 27 17:22:16 2007 +0000 @@ -74,6 +74,8 @@ GtkWidget *image_dialog; char *sml; + GtkWidget *strikethrough; + GtkWidget *insert_hr; }; struct _GtkIMHtmlToolbarClass { diff -r 286438542b24 -r 217c4b1d3a09 pidgin/pidginstock.c --- a/pidgin/pidginstock.c Mon Aug 27 17:21:35 2007 +0000 +++ b/pidgin/pidginstock.c Mon Aug 27 17:22:16 2007 +0000 @@ -396,7 +396,7 @@ /* register custom icon sizes */ - microscopic = gtk_icon_size_register("pidgin-icon-size-tango-microscopic", 11, 11); + microscopic = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC, 11, 11); extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16); small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22); medium = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MEDIUM, 32, 32); diff -r 286438542b24 -r 217c4b1d3a09 pidgin/pidginstock.h --- a/pidgin/pidginstock.h Mon Aug 27 17:21:35 2007 +0000 +++ b/pidgin/pidginstock.h Mon Aug 27 17:22:16 2007 +0000 @@ -145,6 +145,7 @@ /** * For using icons that aren't one of the default GTK_ICON_SIZEs */ +#define PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC "pidgin-icon-size-tango-microscopic" #define PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL "pidgin-icon-size-tango-extra-small" #define PIDGIN_ICON_SIZE_TANGO_SMALL "pidgin-icon-size-tango-small" #define PIDGIN_ICON_SIZE_TANGO_MEDIUM "pidgin-icon-size-tango-medium"