[evince] libview: Replace "cursor-color" by "caret-color"



commit 96e98e310c86eb5c89b97f34ff1ac04506047fc3
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Mon Jun 29 00:41:20 2020 -0400

    libview: Replace "cursor-color" by "caret-color"
    
    "cursor-color" is deprecated in favour of "caret-color" which is
    themable in CSS. It also fixes GdkColor deprecation in favour of
    GtkRGBA
    
    https://developer.gnome.org/gtk3/3.24/GtkWidget.html#GtkWidget--s-cursor-color

 libview/ev-view.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 95a3e222..ebd0bbb7 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4705,20 +4705,21 @@ static void
 get_cursor_color (GtkStyleContext *context,
                  GdkRGBA         *color)
 {
-       GdkColor *style_color;
+       GdkRGBA *caret_color;
 
-       gtk_style_context_get_style (context,
-                                    "cursor-color",
-                                    &style_color,
-                                    NULL);
+       gtk_style_context_get (context,
+                              gtk_style_context_get_state (context),
+                              "caret-color",
+                              &caret_color,
+                              NULL);
 
-       if (style_color) {
-               color->red = style_color->red / 65535.0;
-               color->green = style_color->green / 65535.0;
-               color->blue = style_color->blue / 65535.0;
-               color->alpha = 1;
+       if (caret_color) {
+               color->red = caret_color->red;
+               color->green = caret_color->green;
+               color->blue = caret_color->blue;
+               color->alpha = caret_color->alpha;
 
-               gdk_color_free (style_color);
+               gdk_rgba_free (caret_color);
        } else {
                gtk_style_context_save (context);
                gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, color);


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