[gspell: 7/8] inline-checker-gtv: listen to ::apply-tag and ::remove-tag
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gspell: 7/8] inline-checker-gtv: listen to ::apply-tag and ::remove-tag
- Date: Sun, 13 Dec 2015 14:35:38 +0000 (UTC)
commit acc5bdeb835e8b47d7d52d3cde34fe499363924f
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Dec 13 15:11:02 2015 +0100
inline-checker-gtv: listen to ::apply-tag and ::remove-tag
gspell/gspell-inline-checker-gtv.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/gspell/gspell-inline-checker-gtv.c b/gspell/gspell-inline-checker-gtv.c
index a91e472..23ecb38 100644
--- a/gspell/gspell-inline-checker-gtv.c
+++ b/gspell/gspell-inline-checker-gtv.c
@@ -807,6 +807,21 @@ popup_menu_cb (GtkTextView *view,
}
static void
+apply_or_remove_tag_cb (GtkTextBuffer *buffer,
+ GtkTextTag *tag,
+ GtkTextIter *start,
+ GtkTextIter *end,
+ GspellInlineCheckerGtv *spell)
+{
+ if (spell->no_spell_check_tag != NULL &&
+ spell->no_spell_check_tag == tag)
+ {
+ add_subregion_to_scan (spell, start, end);
+ install_timeout (spell, TIMEOUT_DURATION_BUFFER_MODIFIED);
+ }
+}
+
+static void
tag_added_cb (GtkTextTagTable *table,
GtkTextTag *tag,
GspellInlineCheckerGtv *spell)
@@ -872,6 +887,18 @@ set_buffer (GspellInlineCheckerGtv *spell,
spell,
G_CONNECT_AFTER);
+ g_signal_connect_object (buffer,
+ "apply-tag",
+ G_CALLBACK (apply_or_remove_tag_cb),
+ spell,
+ G_CONNECT_AFTER);
+
+ g_signal_connect_object (buffer,
+ "remove-tag",
+ G_CALLBACK (apply_or_remove_tag_cb),
+ spell,
+ G_CONNECT_AFTER);
+
spell->highlight_tag = gtk_text_buffer_create_tag (spell->buffer, NULL,
"underline", PANGO_UNDERLINE_ERROR,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]