[gtksourceview] stylescheme: track CSS changes in gtk+



commit 1436a49da86e540dd7cb4e148ca991ee26825f0d
Author: Christian Hergert <christian hergert me>
Date:   Fri Oct 30 22:36:14 2015 -0700

    stylescheme: track CSS changes in gtk+
    
    This uses the new element names in gtk+ to apply the style scheme to the
    GtkSourceView widget.
    
    There may still be some fallout to ensure we get right, but this fixes all
    the use-cases that I ran into while testing Builder and gedit.
    
    See commit 844f60f1f22722b3c27a72e1c981cf499ff945c0 in gtk+ for more
    details on the element name changes.

 gtksourceview/gtksourcestylescheme.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index 7591797..c97c1a9 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -690,7 +690,7 @@ get_cursors_css_style (GtkSourceStyleScheme *scheme,
        primary_color_str = gdk_rgba_to_string (&primary_color);
        secondary_color_str = gdk_rgba_to_string (&secondary_color);
 
-       css = g_strdup_printf ("GtkSourceView {\n"
+       css = g_strdup_printf ("textview {\n"
                               "\t-GtkWidget-cursor-color: %s;\n"
                               "\t-GtkWidget-secondary-cursor-color: %s;\n"
                               "}\n",
@@ -894,29 +894,29 @@ generate_css_style (GtkSourceStyleScheme *scheme)
        final_style = g_string_new ("");
 
        style = gtk_source_style_scheme_get_style (scheme, STYLE_TEXT);
-       append_css_style (final_style, style, ".view");
+       append_css_style (final_style, style, "text");
 
        style = gtk_source_style_scheme_get_style (scheme, STYLE_SELECTED);
-       append_css_style (final_style, style, ".view:selected:focused");
+       append_css_style (final_style, style, "textview:selected:focused");
 
        style2 = gtk_source_style_scheme_get_style (scheme, STYLE_SELECTED_UNFOCUSED);
        append_css_style (final_style,
                          style2 != NULL ? style2 : style,
-                         ".view:selected");
+                         "textview:selected");
 
        /* For now we use "line numbers" colors for all the gutters */
        style = gtk_source_style_scheme_get_style (scheme, STYLE_LINE_NUMBERS);
        if (style != NULL)
        {
-               append_css_style (final_style, style, ".top");
-               append_css_style (final_style, style, ".right");
-               append_css_style (final_style, style, ".bottom");
-               append_css_style (final_style, style, ".left");
+               append_css_style (final_style, style, "border.top");
+               append_css_style (final_style, style, "border.right");
+               append_css_style (final_style, style, "border.bottom");
+               append_css_style (final_style, style, "border.left");
 
                /* For the corners if the top or bottom gutter is also
                 * displayed.
                 */
-               append_css_style (final_style, style, "GtkSourceView");
+               append_css_style (final_style, style, "textview");
        }
 
        style = gtk_source_style_scheme_get_style (scheme, STYLE_CURRENT_LINE_NUMBER);


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