[gnome-software: 2/4] search-page: Modernize the list style




commit c7558f69d6197d5ddb924e7a671115728e20faa0
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Jun 14 17:02:39 2021 +0200

    search-page: Modernize the list style
    
    This also makes the code a bit simpler.

 src/gs-search-page.c  | 26 --------------------------
 src/gs-search-page.ui | 12 +++++++-----
 2 files changed, 7 insertions(+), 31 deletions(-)
---
diff --git a/src/gs-search-page.c b/src/gs-search-page.c
index ecbb26b8d..b22e3bd3b 100644
--- a/src/gs-search-page.c
+++ b/src/gs-search-page.c
@@ -366,29 +366,6 @@ gs_search_page_switch_from (GsPage *page)
        g_clear_object (&self->search_cancellable);
 }
 
-static void
-gs_search_page_list_header_func (GtkListBoxRow *row,
-                                 GtkListBoxRow *before,
-                                 gpointer user_data)
-{
-       GtkWidget *header;
-
-       /* first entry */
-       header = gtk_list_box_row_get_header (row);
-       if (before == NULL) {
-               gtk_list_box_row_set_header (row, NULL);
-               return;
-       }
-
-       /* already set */
-       if (header != NULL)
-               return;
-
-       /* set new */
-       header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_list_box_row_set_header (row, header);
-}
-
 static void
 gs_search_page_cancel_cb (GCancellable *cancellable,
                           GsSearchPage *self)
@@ -431,9 +408,6 @@ gs_search_page_setup (GsPage *page,
        /* setup search */
        g_signal_connect (self->list_box_search, "row-activated",
                          G_CALLBACK (gs_search_page_app_row_activated_cb), self);
-       gtk_list_box_set_header_func (GTK_LIST_BOX (self->list_box_search),
-                                     gs_search_page_list_header_func,
-                                     self, NULL);
        return TRUE;
 }
 
diff --git a/src/gs-search-page.ui b/src/gs-search-page.ui
index 988162abe..efe9848d6 100644
--- a/src/gs-search-page.ui
+++ b/src/gs-search-page.ui
@@ -75,19 +75,21 @@
             <property name="hscrollbar_policy">never</property>
             <property name="vscrollbar_policy">automatic</property>
             <property name="shadow_type">none</property>
+            <style>
+              <class name="list-page"/>
+            </style>
             <child>
-              <object class="GsFixedSizeBin" id="gs_fixed_bin">
+              <object class="HdyClamp" id="gs_fixed_bin">
                 <property name="visible">True</property>
-                <property name="preferred-width">860</property>
-                <property name="valign">start</property>
-                <property name="border-width">24</property>
+                <property name="maximum-size">860</property>
+                <property name="tightening-threshold">860</property>
                 <child>
                   <object class="GtkListBox" id="list_box_search">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="selection_mode">none</property>
                     <style>
-                      <class name="full-page-app-list"/>
+                      <class name="content"/>
                     </style>
                   </object>
                 </child>


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