[gnome-software/1723-installed-updates-papercuts: 8/9] gs-update-list: The list box has missing CSS class




commit 4d754da6de78dd0fac1b38952a7a842182ae1777
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 19 14:20:29 2022 +0200

    gs-update-list: The list box has missing CSS class
    
    As the comment in the .ui file suggests, this did not work, it needs
    the CSS property to be set directly on the list box.
    
    Related to https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1723

 src/gs-update-dialog.ui | 4 ----
 src/gs-update-list.c    | 1 +
 2 files changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/src/gs-update-dialog.ui b/src/gs-update-dialog.ui
index 7d6c1d9de..d4be842fb 100644
--- a/src/gs-update-dialog.ui
+++ b/src/gs-update-dialog.ui
@@ -86,10 +86,6 @@
                           <object class="AdwPreferencesGroup">
                             <child>
                               <object class="GsUpdateList" id="list_box_installed_updates">
-                                <style>
-                                  <!-- FIXME: It's not a GtkListBox, will this work nonetheless‽ -->
-                                  <class name="boxed-list" />
-                                </style>
                               </object>
                             </child>
                           </object>
diff --git a/src/gs-update-list.c b/src/gs-update-list.c
index facfd71f5..c98099eb2 100644
--- a/src/gs-update-list.c
+++ b/src/gs-update-list.c
@@ -106,6 +106,7 @@ gs_update_list_init (GsUpdateList *update_list)
        gtk_list_box_set_selection_mode (priv->listbox, GTK_SELECTION_NONE);
        gtk_widget_set_parent (GTK_WIDGET (priv->listbox), GTK_WIDGET (update_list));
        gtk_list_box_set_sort_func (priv->listbox, list_sort_func, update_list, NULL);
+       gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (priv->listbox)), "boxed-list");
 
        g_signal_connect (priv->listbox, "row-activated",
                          G_CALLBACK (installed_updates_row_activated_cb), update_list);


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