[gnome-boxes/port-assistant-widgets-to-hdy: 5/8] assistant, downloads-page: Drop custom row styling




commit 1971995aace8ecb3bf451ed3cf9694fff23b6669
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Dec 9 14:21:00 2021 +0100

    assistant, downloads-page: Drop custom row styling
    
    In favour of HdyActionRow's defaults.

 data/ui/assistant/pages/downloads-page.ui | 26 ++------------------------
 src/assistant/downloads-page.vala         | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 27 deletions(-)
---
diff --git a/data/ui/assistant/pages/downloads-page.ui b/data/ui/assistant/pages/downloads-page.ui
index 2219a4ac..f3dc37a9 100644
--- a/data/ui/assistant/pages/downloads-page.ui
+++ b/data/ui/assistant/pages/downloads-page.ui
@@ -11,11 +11,6 @@
         <property name="border-width">20</property>
         <property name="margin-start">20</property>
         <property name="margin-end">20</property>
-        <style>
-          <class name="linked"/>
-          <class name="frame"/>
-          <class name="sources-list"/>
-        </style>
 
         <child>
           <object class="GtkListBox" id="recommended_listbox">
@@ -23,25 +18,9 @@
             <property name="vexpand">True</property>
             <property name="selection-mode">none</property>
             <signal name="row-activated" handler="on_listbox_row_activated"/>
-          </object>
-        </child>
-
-        <child>
-          <object class="GtkButton" id="show_more_button">
-            <property name="visible">True</property>
-            <signal name="clicked" handler="on_show_more_button_clicked"/>
             <style>
-              <class name="list-expand-button"/>
-              <class name="boxes-menu-row"/>
-              <class name="flat"/>
+              <class name="content"/>
             </style>
-
-            <child>
-              <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="icon-name">view-more-symbolic</property>
-              </object>
-            </child>
           </object>
         </child>
       </object>
@@ -69,8 +48,7 @@
                 <property name="selection-mode">none</property>
                 <signal name="row-activated" handler="on_listbox_row_activated"/>
                 <style>
-                  <class name="sources-list"/>
-                  <class name="frame"/>
+                  <class name="content"/>
                 </style>
               </object>
             </child>
diff --git a/src/assistant/downloads-page.vala b/src/assistant/downloads-page.vala
index 7317f811..5124e93a 100644
--- a/src/assistant/downloads-page.vala
+++ b/src/assistant/downloads-page.vala
@@ -18,6 +18,7 @@
 
     public Gtk.SearchEntry search_entry = new Gtk.SearchEntry ();
     private GLib.ListStore recommended_model;
+    private Gtk.Button show_more_button;
 
     public signal void media_selected (Gtk.ListBoxRow row);
 
@@ -56,11 +57,20 @@
 
         recommended_model = new GLib.ListStore (typeof (Osinfo.Media));
         recommended_listbox.bind_model (recommended_model, create_downloads_entry);
-        recommended_listbox.set_header_func (use_list_box_separator);
         populate_recommended_list.begin ();
 
+        show_more_button = new Gtk.Button () {
+            visible = true,
+            image = new Gtk.Image () {
+                visible = true,
+                icon_name = "view-more-symbolic"
+            }
+        };
+        show_more_button.clicked.connect (on_show_more_button_clicked);
+        show_more_button.get_style_context ().add_class ("flat");
+        recommended_listbox.add (show_more_button);
+
         listbox.bind_model (search.model, create_downloads_entry);
-        listbox.set_header_func (use_list_box_separator);
 
         search.search_changed.connect (set_visible_view);
     }
@@ -92,11 +102,12 @@ private void on_listbox_row_activated (Gtk.ListBoxRow row) {
         media_selected (row);
     }
 
-    [GtkCallback]
     private void on_show_more_button_clicked () {
         search.show_all ();
 
         page = AssistantDownloadsPageView.SEARCH_RESULTS;
+
+        show_more_button.get_parent ().destroy ();
     }
 
     private void on_search_changed () {


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