qulogic/pidgin

Update the toolbar when the caret moves.

2012-06-08, Elliott Sales de Andrade
5005e63a35d4
Parents 2a61ad7ca6b6
Children 4114ce42d094
Update the toolbar when the caret moves.

I'm not sure what that check was that I ended up removing, though.
--- a/pidgin/gtkwebviewtoolbar.c Fri Jun 08 01:18:55 2012 +0000
+++ b/pidgin/gtkwebviewtoolbar.c Fri Jun 08 05:22:19 2012 +0000
@@ -1126,17 +1126,11 @@
update_buttons(toolbar);
}
-#if 0
static void
-mark_set_cb(GtkTextBuffer *buffer, GtkTextIter *location, GtkTextMark *mark,
- GtkWebViewToolbar *toolbar)
+mark_set_cb(GtkWebView *webview, GtkWebViewToolbar *toolbar)
{
- if(mark != gtk_text_buffer_get_insert(buffer))
- return;
-
update_buttons(toolbar);
}
-#endif
/* This comes from gtkmenutoolbutton.c from gtk+
* Copyright (C) 2003 Ricardo Fernandez Pascual
@@ -1587,9 +1581,8 @@
G_CALLBACK(update_format_cb), toolbar);
g_signal_connect(G_OBJECT(webview), "format-updated",
G_CALLBACK(update_format_cb), toolbar);
-#if 0
- g_signal_connect_after(G_OBJECT(GTK_WEBVIEW(webview)->text_buffer), "mark-set", G_CALLBACK(mark_set_cb), toolbar);
-#endif
+ g_signal_connect_after(G_OBJECT(webview), "selection-changed",
+ G_CALLBACK(mark_set_cb), toolbar);
buttons = gtk_webview_get_format_functions(GTK_WEBVIEW(webview));
update_buttons_cb(GTK_WEBVIEW(webview), buttons, toolbar);