[gnome-software: 1/7] respos-section: Use the content style class




commit c927da0b3702537f41703b1aa2fc6be545180586
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jul 30 09:21:12 2021 +0200

    respos-section: Use the content style class

 src/gs-repo-row.c      |  2 --
 src/gs-repos-section.c |  6 ++++--
 src/gtk-style.css      | 27 ---------------------------
 3 files changed, 4 insertions(+), 31 deletions(-)
---
diff --git a/src/gs-repo-row.c b/src/gs-repo-row.c
index e7dc023b0..d0507447f 100644
--- a/src/gs-repo-row.c
+++ b/src/gs-repo-row.c
@@ -328,8 +328,6 @@ gs_repo_row_class_init (GsRepoRowClass *klass)
                              NULL, NULL, g_cclosure_marshal_VOID__VOID,
                              G_TYPE_NONE, 0, G_TYPE_NONE);
 
-       gtk_widget_class_set_css_name (widget_class, "reporow");
-
        gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-repo-row.ui");
 
        gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, name_label);
diff --git a/src/gs-repos-section.c b/src/gs-repos-section.c
index 5b163add8..651024e8f 100644
--- a/src/gs-repos-section.c
+++ b/src/gs-repos-section.c
@@ -107,13 +107,12 @@ gs_repos_section_class_init (GsReposSectionClass *klass)
                              0,
                              NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
                              G_TYPE_NONE, 1, GS_TYPE_REPO_ROW);
-
-       gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "repos-section");
 }
 
 static void
 gs_repos_section_init (GsReposSection *self)
 {
+       GtkStyleContext *style_context;
        PangoAttrList *attrs;
 
        attrs = pango_attr_list_new ();
@@ -146,6 +145,9 @@ gs_repos_section_init (GsReposSection *self)
                      NULL);
        gtk_list_box_set_sort_func (self->list, _list_sort_func, self, NULL);
 
+       style_context = gtk_widget_get_style_context (GTK_WIDGET (self->list));
+       gtk_style_context_add_class (style_context, "content");
+
        gtk_box_pack_start (GTK_BOX (self), GTK_WIDGET (self->list), TRUE, TRUE, 0);
 
        g_signal_connect (self->list, "row-activated",
diff --git a/src/gtk-style.css b/src/gtk-style.css
index faf6c784d..b34d43bc6 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -50,33 +50,6 @@
        font-size: x-small;
 }
 
-repos-section list {
-       border-radius: 8px;
-       border: 1px solid darker(@theme_bg_color);
-       padding-bottom: 0px;
-       padding-top: 0px;
-}
-
-repos-section list reporow:not(:last-child) {
-       border-bottom: 1px solid darker(@theme_bg_color);
-}
-
-repos-section list reporow {
-       border-radius: 0;
-}
-
-repos-section list reporow:first-child {
-       border-radius: 8px 8px 0 0;
-}
-
-repos-section list reporow:last-child {
-       border-radius: 0 0 8px 8px;
-}
-
-repos-section list reporow:only-child {
-       border-radius: 8px;
-}
-
 /* Adapted from Adwaita’s .needs-attention class for stacksidebar */
 sidebar row.needs-attention > box > label {
        animation: needs_attention 150ms ease-in;


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