[gnome-software: 70/110] gs-star-image: Drop custom CSS code




commit d7fa6eec2c5693afc22d8fe98323ab380e6ba168
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Aug 25 19:27:47 2021 -0300

    gs-star-image: Drop custom CSS code
    
    GTK4 doesn't support this anymore. Instead, the background colour will
    have to remain hard-coded for now, until someone can look at this again.
    The changes needed to make the star background customisable seem to be
    non-trivial.

 src/gs-star-image.c  | 17 ++++-------------
 src/gtk-style-hc.css |  1 -
 src/gtk-style.css    |  1 -
 3 files changed, 4 insertions(+), 15 deletions(-)
---
diff --git a/src/gs-star-image.c b/src/gs-star-image.c
index 254a037ef..f50c6e514 100644
--- a/src/gs-star-image.c
+++ b/src/gs-star-image.c
@@ -12,8 +12,8 @@
  *
  * Depending on the #GsStarImage:fraction property, the star image can be
  * drawn as filled only partially or fully or not at all. This is accomplished
- * by using a `color` style property for the filled part and a
- * `star-bg` style property for the unfilled part of the star.
+ * by using a `color` style property for the filled part. The unfilled part of
+ * the star currently uses a hardcoded colour.
  * The `background` style property controls the area outside the star.
  *
  * Since: 41
@@ -163,14 +163,10 @@ gs_star_image_snapshot (GtkWidget   *widget,
                GdkRGBA star_fg;
                gint min_x = -radius, max_x = radius;
 
-               gtk_widget_style_get (widget,
-                       "star-bg", &star_bg,
-                       NULL);
+               /* TODO: read star_bg from CSS, somehow */
 
                style_context = gtk_widget_get_style_context (widget);
-               gtk_style_context_get_color (style_context,
-                                            gtk_style_context_get_state (style_context),
-                                            &star_fg);
+               gtk_style_context_get_color (style_context, &star_fg);
 
                cairo_save (cr);
                gs_star_image_outline_star (cr, allocation.x, allocation.y, radius, &min_x, &max_x);
@@ -215,11 +211,6 @@ gs_star_image_class_init (GsStarImageClass *klass)
                                                              0.0, 1.0, 1.0,
                                                              G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
 
-       gtk_widget_class_install_style_property (widget_class,
-                                        g_param_spec_boxed ("star-bg", NULL, NULL,
-                                                            GDK_TYPE_RGBA,
-                                                            G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
        gtk_widget_class_set_css_name (widget_class, "star-image");
 }
 
diff --git a/src/gtk-style-hc.css b/src/gtk-style-hc.css
index 202495ab3..c01b5b120 100644
--- a/src/gtk-style-hc.css
+++ b/src/gtk-style-hc.css
@@ -40,7 +40,6 @@
 
 star-image {
        color: #000000;
-       -GsStarImage-star-bg: #777777;
 }
 
 app-context-bar .context-tile {
diff --git a/src/gtk-style.css b/src/gtk-style.css
index ad2932adc..3fb721393 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -483,7 +483,6 @@ flowboxchild {
 
 star-image {
        color: #e5a50a;
-       -GsStarImage-star-bg: #deddda;
 }
 
 .counter-label {


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