[gnome-software] Use black font for Fedora distro upgrades



commit 29395d73590a3f3e3fe7e612a92ebb6fcd9c35f3
Author: Kalev Lember <klember redhat com>
Date:   Fri Apr 3 15:46:50 2020 +0200

    Use black font for Fedora distro upgrades
    
    This makes the text more legible on light backgrounds (such as the F32
    distro upgrade background).
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-software/issues/956

 .../gs-plugin-fedora-pkgdb-collections.c               | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c 
b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
index e41bbc88..5862bae5 100644
--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
+++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
@@ -229,8 +229,7 @@ _get_upgrade_css_background (guint version)
        if (g_file_test (filename2, G_FILE_TEST_EXISTS))
                return g_strdup_printf ("url('%s')", filename2);
 
-       /* fall back to solid colour */
-       return g_strdup_printf ("#151E65");
+       return NULL;
 }
 
 static gint
@@ -295,13 +294,16 @@ _create_upgrade_from_info (GsPlugin *plugin, PkgdbItem *item)
                               item->version);
        gs_app_set_url (app, AS_URL_KIND_HOMEPAGE, url);
 
-       /* use a fancy background */
+       /* use a fancy background if possible */
        background = _get_upgrade_css_background (item->version);
-       css = g_strdup_printf ("background: %s;"
-                              "background-position: center;"
-                              "background-size: cover;",
-                              background);
-       gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css", css);
+       if (background != NULL) {
+               css = g_strdup_printf ("background: %s;"
+                                      "background-position: center;"
+                                      "background-size: cover;"
+                                      "color: black;",
+                                      background);
+               gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css", css);
+       }
 
        /* save in the cache */
        gs_plugin_cache_add (plugin, cache_key, app);


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