[gnome-software] Improve style of install button progress bar
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Improve style of install button progress bar
- Date: Wed, 16 Dec 2015 09:09:32 +0000 (UTC)
commit d58f274ec5f6f66cfebdd7a4efc715e7db9a04b3
Author: Lapo Calamandrei <calamandrei gmail com>
Date: Mon Dec 14 17:06:15 2015 +0000
Improve style of install button progress bar
Also, fix up some other GTK issues.
Signed-off-by: Richard Hughes <richard hughsie com>
configure.ac | 2 +-
src/gs-feature-tile.c | 4 ++--
src/gs-progress-button.c | 6 +++---
src/gtk-style.css | 15 ++++++++++++---
4 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2901fe9..2c30e6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ GLIB_GSETTINGS
dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.18.2 gio-unix-2.0)
+PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.19.1 gio-unix-2.0)
PKG_CHECK_MODULES(PACKAGEKIT, packagekit-glib2 >= 1.0.11)
PKG_CHECK_MODULES(APPSTREAM, appstream-glib >= 0.5.5)
PKG_CHECK_MODULES(SQLITE, sqlite3)
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index d884ef4..96f7120 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -130,7 +130,7 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
text_shadow = gs_app_get_metadata_item (app, "Featured::text-shadow");
data = g_string_sized_new (1024);
- g_string_append (data, ".button.featured-tile {\n");
+ g_string_append (data, ".featured-tile {\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);
@@ -141,7 +141,7 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
g_string_append (data, " outline-offset: 2px;\n");
g_string_append_printf (data, " background: %s;\n", background);
g_string_append (data, "}\n");
- g_string_append (data, ".button.featured-tile:hover {\n");
+ g_string_append (data, ".featured-tile:hover {\n");
g_string_append (data, " background: linear-gradient(to bottom,\n");
g_string_append (data, " alpha(#fff,0.16),\n");
g_string_append_printf (data,
diff --git a/src/gs-progress-button.c b/src/gs-progress-button.c
index ce29f91..fe58c82 100644
--- a/src/gs-progress-button.c
+++ b/src/gs-progress-button.c
@@ -38,11 +38,11 @@ gs_progress_button_set_progress (GsProgressButton *button, guint percentage)
gchar *css;
if (percentage == 0)
- css = g_strdup (".button.install-progress { background: @theme_bg_color; }");
+ css = g_strdup (".install-progress { background-size: 0; }");
else if (percentage == 100)
- css = g_strdup (".button.install-progress { background: @theme_selected_bg_color; }");
+ css = g_strdup (".install-progress { background-size: 100%; }");
else
- css = g_strdup_printf (".button.install-progress { background: linear-gradient(to right,
@theme_selected_bg_color %d%%, @theme_bg_color %d%%); }", percentage, percentage + 1);
+ css = g_strdup_printf (".install-progress { background-size: %d%%; }", percentage);
gtk_css_provider_load_from_data (button->css_provider, css, -1, NULL);
g_free (css);
diff --git a/src/gtk-style.css b/src/gtk-style.css
index ead5e05..6f87d34 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -69,7 +69,7 @@
}
/* The rest of the featured-tile CSS is loaded at runtime in gs-feature-tile.c */
-.button.featured-tile {
+.featured-tile {
all: unset;
padding: 0;
border-radius: 0;
@@ -107,6 +107,15 @@
.application-details-description {
}
+.install-progress {
+ background-image: linear-gradient(to top, @theme_selected_bg_color 2px,
alpha(@theme_selected_bg_color, 0) 2px);
+ background-repeat: no-repeat;
+ background-position: 0 bottom;
+ transition: none;
+}
+
+.install-progress:dir(rtl) { background-position: 100% bottom; }
+
.error-label {
text-shadow: none;
}
@@ -131,12 +140,12 @@
background-color: transparent;
}
-GtkBox.star {
+box.star {
background-color: transparent;
background-image: none;
}
-.button.star {
+button.star {
-GtkWidget-focus-padding: 0;
background-color: transparent;
background-image: none;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]