[gtksourceview] view: queue draw when implicit-trailing-newline property changes
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] view: queue draw when implicit-trailing-newline property changes
- Date: Sat, 23 Jul 2016 08:27:24 +0000 (UTC)
commit 55eb47ab23466ab25bc8284fbc3959356d80cd55
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Jul 23 10:24:26 2016 +0200
view: queue draw when implicit-trailing-newline property changes
gtksourceview/gtksourceview.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 96a9a64..da0db2c 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -1451,6 +1451,15 @@ buffer_style_scheme_changed_cb (GtkSourceBuffer *buffer,
}
static void
+implicit_trailing_newline_changed_cb (GtkSourceBuffer *buffer,
+ GParamSpec *pspec,
+ GtkSourceView *view)
+{
+ /* For drawing or not a trailing newline. */
+ gtk_widget_queue_draw (GTK_WIDGET (view));
+}
+
+static void
remove_source_buffer (GtkSourceView *view)
{
if (view->priv->source_buffer != NULL)
@@ -1467,6 +1476,10 @@ remove_source_buffer (GtkSourceView *view)
buffer_style_scheme_changed_cb,
view);
+ g_signal_handlers_disconnect_by_func (view->priv->source_buffer,
+ implicit_trailing_newline_changed_cb,
+ view);
+
g_object_unref (view->priv->source_buffer);
view->priv->source_buffer = NULL;
}
@@ -1501,6 +1514,11 @@ set_source_buffer (GtkSourceView *view,
"notify::style-scheme",
G_CALLBACK (buffer_style_scheme_changed_cb),
view);
+
+ g_signal_connect (buffer,
+ "notify::implicit-trailing-newline",
+ G_CALLBACK (implicit_trailing_newline_changed_cb),
+ view);
}
gtk_source_view_update_style_scheme (view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]