[gtksourceview] view: simplify code for applying the StyleScheme to the view



commit e15f19d6d8b1ada6b289c8a53080ddb02383ecb3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jul 30 14:12:34 2016 +0200

    view: simplify code for applying the StyleScheme to the view
    
    The style_scheme_applied instance variable was useful to defer the
    action when the widget is realized. But it is no longer useful, after
    commit 8568dabf9f380971eb8ca31d908e489ed0ce47fa.

 gtksourceview/gtksourceview.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index bb77fcb..31daaaf 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -198,7 +198,6 @@ struct _GtkSourceViewPrivate
        guint highlight_current_line : 1;
        guint indent_on_tab : 1;
        guint show_right_margin  : 1;
-       guint style_scheme_applied : 1;
        guint current_line_color_set : 1;
        guint background_pattern_color_set : 1;
        guint smart_backspace : 1;
@@ -4598,13 +4597,6 @@ update_right_margin_colors (GtkSourceView *view)
 static void
 update_style (GtkSourceView *view)
 {
-       if (view->priv->style_scheme != NULL &&
-           !view->priv->style_scheme_applied)
-       {
-               _gtk_source_style_scheme_apply (view->priv->style_scheme, view);
-               view->priv->style_scheme_applied = TRUE;
-       }
-
        update_background_pattern_color (view);
        update_current_line_color (view);
        update_right_margin_colors (view);
@@ -4642,7 +4634,11 @@ gtk_source_view_update_style_scheme (GtkSourceView *view)
 
        g_set_object (&view->priv->style_scheme, new_scheme);
 
-       view->priv->style_scheme_applied = FALSE;
+       if (view->priv->style_scheme != NULL)
+       {
+               _gtk_source_style_scheme_apply (view->priv->style_scheme, view);
+       }
+
        update_style (view);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]