[nautilus/wip/ernestask/gtk4: 7/19] properties-window: Drop deprecated GtkStyleContext API



commit d515521721ff555922b5b238936513edfd21f18f
Author: Ernestas Kulik <ernestask gnome org>
Date:   Mon May 14 19:09:05 2018 +0300

    properties-window: Drop deprecated GtkStyleContext API
    
    This is kind of a hack, but we can still use
    gtk_style_context_get_color() to get the color of the pie slice. Two
    hacks, in fact, as this adds a separate style class to hold the color of
    the border.

 src/nautilus-properties-window.c |  8 +++++---
 src/resources/css/Adwaita.css    | 12 ++++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 906e69af0..298aaa3fb 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2824,7 +2824,8 @@ paint_slice (GtkWidget   *widget,
     double angle2;
     gboolean full;
     double offset = G_PI / 2.0;
-    GdkRGBA stroke, fill;
+    GdkRGBA fill;
+    GdkRGBA stroke;
     GtkStateFlags state;
     GtkBorder border;
     GtkStyleContext *context;
@@ -2842,8 +2843,9 @@ paint_slice (GtkWidget   *widget,
 
     gtk_style_context_save (context);
     gtk_style_context_add_class (context, style_class);
-    gtk_style_context_get_background_color (context, state, &fill);
-    gtk_style_context_get_border_color (context, state, &stroke);
+    gtk_style_context_get_color (context, state, &fill);
+    gtk_style_context_add_class (context, "border");
+    gtk_style_context_get_color (context, state, &stroke);
     gtk_style_context_restore (context);
 
     width = gtk_widget_get_allocated_width (widget);
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 61fc11386..59c5df3fb 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -158,16 +158,28 @@
 .disk-space-display.unknown {
     background-color: @disk_space_unknown;
     border-color: shade(@disk_space_unknown, 0.7);
+    color: @disk_space_unknown;
+}
+.disk-space-display.unknown.border {
+    color: shade(@disk_space_unknown, 0.7);
 }
 
 .disk-space-display.used {
     background-color: @disk_space_used;
     border-color: shade(@disk_space_used, 0.7);
+    color: @disk_space_used;
+}
+.disk-space-display.used.border {
+    color: shade(@disk_space_used, 0.7);
 }
 
 .disk-space-display.free {
     background-color: @disk_space_free;
     border-color: shade(@disk_space_free, 0.7);
+    color: @disk_space_free;
+}
+.disk-space-display.free.border {
+    color: shade(@disk_space_free, 0.7);
 }
 
 /* View */


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