[gnome-software] feature tile: Split out static CSS into gtk-style.css



commit 1d82963b3081d6db0775c01ffe695fe1d6c6f14b
Author: Kalev Lember <kalevlember gmail com>
Date:   Tue Sep 2 20:59:20 2014 +0200

    feature tile: Split out static CSS into gtk-style.css
    
    Instead of applying all CSS at runtime, split out a part of the CSS so
    that we can apply it at the app startup, avoiding unwanted resizing due
    to CSS changes during loading.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734785

 src/gs-feature-tile.c |    6 ------
 src/gtk-style.css     |   10 ++++++++++
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index b8a1c43..6636071 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -129,12 +129,6 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
 
        data = g_string_sized_new (1024);
        g_string_append (data, ".button.featured-tile {\n");
-       g_string_append (data, "  all: unset;\n");
-       g_string_append (data, "  padding: 0;\n");
-       g_string_append (data, "  border-radius: 0;\n");
-       g_string_append (data, "  border-width: 1px;\n");
-       g_string_append (data, "  border-image: none;\n");
-       g_string_append (data, "  box-shadow: inset 0 0 0 1px alpha(@theme_fg_color,0.3), 0 0 1px 
alpha(black,0.4);\n");
        g_string_append_printf (data, "  border-color: %s;\n", stroke_color);
        if (text_shadow != NULL)
                g_string_append_printf (data, "  text-shadow: %s;\n", text_shadow);
diff --git a/src/gtk-style.css b/src/gtk-style.css
index 05c7a6f..70237b4 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -55,6 +55,16 @@ GsAppTile .tile {
        border-color: @unfocused_borders;
 }
 
+/* The rest of the featured-tile CSS is loaded at runtime in gs-feature-tile.c */
+.button.featured-tile {
+       all: unset;
+       padding: 0;
+       border-radius: 0;
+       border-width: 1px;
+       border-image: none;
+       box-shadow: inset 0 0 0 1px alpha(@theme_fg_color,0.3), 0 0 1px alpha(black,0.4);
+}
+
 .application-details-infobar.info {
         background-color: #d3d7cf;
         color: @theme_fg_color;


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