[gtksourceview] view: add private helper for current line background



commit 856a23522cf0fb4a12481ae8ce019560b09fc856
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 20 16:29:32 2021 -0700

    view: add private helper for current line background
    
    This is specifically for the current line within the text editor as
    opposed to the gutter line numbers. We can use this from overview map to
    improve our fallbacks.

 gtksourceview/gtksourceview-private.h |  2 ++
 gtksourceview/gtksourceview.c         | 18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/gtksourceview-private.h b/gtksourceview/gtksourceview-private.h
index caaf7f48..6cd4cfbd 100644
--- a/gtksourceview/gtksourceview-private.h
+++ b/gtksourceview/gtksourceview-private.h
@@ -85,6 +85,8 @@ gboolean _gtk_source_view_snippets_key_pressed (GtkSourceViewSnippets *snippets,
                                                 guint                  keycode,
                                                 GdkModifierType        state);
 
+gboolean _gtk_source_view_get_current_line_background        (GtkSourceView *view,
+                                                              GdkRGBA       *rgba);
 gboolean _gtk_source_view_get_current_line_number_background (GtkSourceView *view,
                                                               GdkRGBA       *rgba);
 
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 617e1035..9fd57394 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -5417,9 +5417,25 @@ gtk_source_view_set_indenter (GtkSourceView     *view,
        }
 }
 
+gboolean
+_gtk_source_view_get_current_line_background (GtkSourceView *view,
+                                              GdkRGBA       *rgba)
+{
+       GtkSourceViewPrivate *priv = gtk_source_view_get_instance_private (view);
+
+       g_return_val_if_fail (GTK_SOURCE_IS_VIEW (view), FALSE);
+
+       if (rgba != NULL)
+       {
+               *rgba = priv->current_line_color;
+       }
+
+       return priv->current_line_color_set;
+}
+
 gboolean
 _gtk_source_view_get_current_line_number_background (GtkSourceView *view,
-                                                    GdkRGBA       *rgba)
+                                                     GdkRGBA       *rgba)
 {
        GtkSourceViewPrivate *priv = gtk_source_view_get_instance_private (view);
 


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