[gtksourceview] view: add private helper to get line background color



commit fae9e9ec277e395747662a7a74b902fcab66cee6
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 20 15:45:17 2021 -0700

    view: add private helper to get line background color
    
    This will be useful to avoid using CSS for this.

 gtksourceview/gtksourceview-private.h |  3 +++
 gtksourceview/gtksourceview.c         | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)
---
diff --git a/gtksourceview/gtksourceview-private.h b/gtksourceview/gtksourceview-private.h
index 3f417484..caaf7f48 100644
--- a/gtksourceview/gtksourceview-private.h
+++ b/gtksourceview/gtksourceview-private.h
@@ -85,4 +85,7 @@ gboolean _gtk_source_view_snippets_key_pressed (GtkSourceViewSnippets *snippets,
                                                 guint                  keycode,
                                                 GdkModifierType        state);
 
+gboolean _gtk_source_view_get_current_line_number_background (GtkSourceView *view,
+                                                              GdkRGBA       *rgba);
+
 G_END_DECLS
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 462831cb..6fd55d37 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -5387,3 +5387,19 @@ gtk_source_view_set_indenter (GtkSourceView     *view,
                g_object_notify_by_pspec (G_OBJECT (view), properties [PROP_INDENTER]);
        }
 }
+
+gboolean
+_gtk_source_view_get_current_line_number_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_number_color;
+       }
+
+       return priv->current_line_number_color_set;
+}


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