[gtksourceview] StyleScheme: add CSS for the left/right/top/bottom classes



commit fdec7cf887a6e16a24a52c818cca5ea5d4a3d7da
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Mar 26 12:14:51 2016 +0100

    StyleScheme: add CSS for the left/right/top/bottom classes
    
    Since it's what GtkSourceGutter uses. GtkSourceGutter cannot rely on the
    "border" subnode.
    
    The reason why the gutter style was not broken is because it worked by
    chance, since we apply the gutter style also to the whole textview node
    to fix the color on the corners if the top or bottom window border is
    shown.

 gtksourceview/gtksourcestylescheme.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index 5cf1392..7e47523 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -920,6 +920,16 @@ generate_css_style (GtkSourceStyleScheme *scheme)
        {
                append_css_style (final_style, style, "textview border");
 
+               /* Needed for GtkSourceGutter. In the ::draw callback,
+                * gtk_style_context_add_class() is called to add e.g. the
+                * "left" class. Because as of GTK+ 3.20 we cannot do the same
+                * to add the "border" subnode.
+                */
+               append_css_style (final_style, style, "textview .left");
+               append_css_style (final_style, style, "textview .right");
+               append_css_style (final_style, style, "textview .top");
+               append_css_style (final_style, style, "textview .bottom");
+
                /* For the corners if the top or bottom gutter is also
                 * displayed.
                 */


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