[gnome-software/1868-source-pill-legibility-issues] gs-origin-popover-row: Re-style source pills
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1868-source-pill-legibility-issues] gs-origin-popover-row: Re-style source pills
- Date: Thu, 18 Aug 2022 14:16:16 +0000 (UTC)
commit fe47c912f4cb0c0661ae0133b90a252582d4d578
Author: Milan Crha <mcrha redhat com>
Date: Thu Aug 18 16:14:23 2022 +0200
gs-origin-popover-row: Re-style source pills
Update styling of the source pills to work better in different styles
and use standard colors directly, not their fg/bg variants.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1868
plugins/flatpak/gs-flatpak-utils.c | 2 +-
plugins/packagekit/packagekit-common.c | 2 +-
plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 2 +-
src/gs-details-page.c | 6 ++----
src/gs-origin-popover-row.c | 10 ++--------
src/gs-origin-popover-row.ui | 1 -
src/style-hc.css | 4 ++++
src/style.css | 13 ++++---------
8 files changed, 15 insertions(+), 25 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 0bf0a7ffa..9675810d3 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -266,6 +266,6 @@ gs_flatpak_app_set_packaging_info (GsApp *app)
g_return_if_fail (GS_IS_APP (app));
gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_FLATPAK);
- gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "accent_bg_color");
+ gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "accent_color");
gs_app_set_metadata (app, "GnomeSoftware::PackagingIcon", "flatpak-symbolic");
}
diff --git a/plugins/packagekit/packagekit-common.c b/plugins/packagekit/packagekit-common.c
index a2074603c..4b6b16596 100644
--- a/plugins/packagekit/packagekit-common.c
+++ b/plugins/packagekit/packagekit-common.c
@@ -581,5 +581,5 @@ gs_plugin_packagekit_set_packaging_format (GsPlugin *plugin, GsApp *app)
return;
}
- gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "error_bg_color");
+ gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "error_color");
}
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index 9e30e9795..ddf024432 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -452,7 +452,7 @@ static void
app_set_rpm_ostree_packaging_format (GsApp *app)
{
gs_app_set_metadata (app, "GnomeSoftware::PackagingFormat", "RPM");
- gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "error_bg_color");
+ gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "error_color");
}
void
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index a6711f97a..f30c0670c 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -285,10 +285,8 @@ gs_details_page_update_origin_button (GsDetailsPage *self,
gtk_image_set_from_icon_name (GTK_IMAGE (self->origin_packaging_image), packaging_icon);
- if (packaging_base_css_color == NULL)
- packaging_base_css_color = "window_fg_color";
-
- css = g_strdup_printf ("color: @%s;\n", packaging_base_css_color);
+ if (packaging_base_css_color != NULL)
+ css = g_strdup_printf ("color: @%s;\n", packaging_base_css_color);
gs_utils_widget_set_css (self->origin_packaging_image, &self->origin_css_provider, "packaging-color",
css);
}
diff --git a/src/gs-origin-popover-row.c b/src/gs-origin-popover-row.c
index 132aceb1c..27f76ea12 100644
--- a/src/gs-origin-popover-row.c
+++ b/src/gs-origin-popover-row.c
@@ -123,14 +123,8 @@ refresh_ui (GsOriginPopoverRow *row)
if (packaging_icon != NULL)
gtk_image_set_from_icon_name (GTK_IMAGE (priv->packaging_image), packaging_icon);
- if (packaging_base_css_color == NULL)
- packaging_base_css_color = "window_fg_color";
-
- css = g_strdup_printf (
- " color: @%s;\n"
- " background-color: alpha(@%s, .15);\n",
- packaging_base_css_color,
- packaging_base_css_color);
+ if (packaging_base_css_color != NULL)
+ css = g_strdup_printf (" color: @%s;\n", packaging_base_css_color);
gs_utils_widget_set_css (priv->packaging_box, &priv->css_provider, "packaging-color", css);
}
diff --git a/src/gs-origin-popover-row.ui b/src/gs-origin-popover-row.ui
index f1fac6504..89b505307 100644
--- a/src/gs-origin-popover-row.ui
+++ b/src/gs-origin-popover-row.ui
@@ -122,7 +122,6 @@
<property name="valign">center</property>
<style>
<class name="origin-rounded-box"/>
- <class name="origin-scope-user"/>
</style>
<child>
<object class="GtkImage" id="user_scope_image">
diff --git a/src/style-hc.css b/src/style-hc.css
index 3f44daba5..767cbe8c3 100644
--- a/src/style-hc.css
+++ b/src/style-hc.css
@@ -24,6 +24,10 @@ star-image {
color: inherit;
}
+.origin-rounded-box {
+ box-shadow: inset 0 0 0 1px currentColor;
+}
+
.context-tile-lozenge {
box-shadow: inset 0 0 0 2px currentColor;
}
diff --git a/src/style.css b/src/style.css
index f403bb640..b36620824 100644
--- a/src/style.css
+++ b/src/style.css
@@ -35,18 +35,13 @@ screenshot-carousel button,
}
.origin-rounded-box {
- border-radius: 14px;
- padding: 4px 4px;
+ background-color: alpha(currentColor, .15);
+ border-radius: 999px;
+ padding: 4px;
}
.origin-beta {
- color: @warning_bg_color;
- background-color: alpha(@warning_bg_color, .15);
-}
-
-.origin-scope-user {
- color: @window_fg_color;
- background-color: alpha(@window_fg_color, .15);
+ color: @warning_color;
}
.origin-button > button {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]