[gtksourceview/wip/chergert/gsv-gtk4: 105/175] view: use new gutter creation widgets



commit f4d0320a4a716e72c7d196a2754535f453085dfa
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 15 15:40:43 2020 -0800

    view: use new gutter creation widgets
    
    And warn if we get something we don't support.

 gtksourceview/gtksourceview.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3b4895bd..b4ef6a7d 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -4807,20 +4807,28 @@ gtk_source_view_get_gutter (GtkSourceView     *view,
        {
                if (priv->left_gutter == NULL)
                {
-                       priv->left_gutter = _gtk_source_gutter_new (view, window_type);
+                       priv->left_gutter = _gtk_source_gutter_new (window_type);
+                       gtk_text_view_set_gutter (GTK_TEXT_VIEW (view),
+                                                 GTK_TEXT_WINDOW_LEFT,
+                                                 GTK_WIDGET (priv->left_gutter));
                }
 
                return priv->left_gutter;
        }
-       else
+       else if (window_type == GTK_TEXT_WINDOW_RIGHT)
        {
                if (priv->right_gutter == NULL)
                {
-                       priv->right_gutter = _gtk_source_gutter_new (view, window_type);
+                       priv->right_gutter = _gtk_source_gutter_new (window_type);
+                       gtk_text_view_set_gutter (GTK_TEXT_VIEW (view),
+                                                 GTK_TEXT_WINDOW_RIGHT,
+                                                 GTK_WIDGET (priv->right_gutter));
                }
 
                return priv->right_gutter;
        }
+
+       g_return_val_if_reached (NULL);
 }
 
 /**


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