[gnome-control-center/wip/cdavis/40-consistency] search: Use libhandy preferences widgets and styling



commit d04a9563474d8349c9333d5ab6d3aa086b0d133a
Author: Christopher Davis <christopherdavis gnome org>
Date:   Wed Feb 17 19:04:13 2021 -0800

    search: Use libhandy preferences widgets and styling

 panels/search/cc-search-panel.c  |  9 +++------
 panels/search/cc-search-panel.ui | 42 ++++++++--------------------------------
 2 files changed, 11 insertions(+), 40 deletions(-)
---
diff --git a/panels/search/cc-search-panel.c b/panels/search/cc-search-panel.c
index b0d4d42d6..6d1e54d8c 100644
--- a/panels/search/cc-search-panel.c
+++ b/panels/search/cc-search-panel.c
@@ -32,8 +32,7 @@ struct _CcSearchPanel
   CcPanel     parent_instance;
 
   GtkWidget  *list_box;
-  GtkWidget  *search_vbox;
-  GtkWidget  *search_frame;
+  GtkWidget  *search_page;
   GtkWidget  *settings_button;
   CcSearchPanelRow  *selected_row;
 
@@ -647,7 +646,7 @@ cc_search_panel_constructed (GObject *object)
                    G_SETTINGS_BIND_INVERT_BOOLEAN);
 
   g_object_bind_property (widget, "active",
-                          self->search_vbox, "sensitive",
+                          self->search_page, "sensitive",
                           G_BINDING_DEFAULT |
                           G_BINDING_SYNC_CREATE);
 
@@ -664,7 +663,6 @@ cc_search_panel_init (CcSearchPanel *self)
 
   gtk_list_box_set_sort_func (GTK_LIST_BOX (self->list_box),
                               (GtkListBoxSortFunc)list_sort_func, self, NULL);
-  gtk_list_box_set_header_func (GTK_LIST_BOX (self->list_box), cc_list_box_update_header_func, NULL, NULL);
 
   gtk_widget_set_sensitive (self->settings_button, cc_search_locations_dialog_is_available ());
 
@@ -691,8 +689,7 @@ cc_search_panel_class_init (CcSearchPanelClass *klass)
                                                "/org/gnome/control-center/search/cc-search-panel.ui");
 
   gtk_widget_class_bind_template_child (widget_class, CcSearchPanel, list_box);
-  gtk_widget_class_bind_template_child (widget_class, CcSearchPanel, search_vbox);
-  gtk_widget_class_bind_template_child (widget_class, CcSearchPanel, search_frame);
+  gtk_widget_class_bind_template_child (widget_class, CcSearchPanel, search_page);
   gtk_widget_class_bind_template_child (widget_class, CcSearchPanel, settings_button);
 
   gtk_widget_class_bind_template_callback (widget_class, settings_button_clicked);
diff --git a/panels/search/cc-search-panel.ui b/panels/search/cc-search-panel.ui
index 731cc95d2..31775d4ab 100644
--- a/panels/search/cc-search-panel.ui
+++ b/panels/search/cc-search-panel.ui
@@ -6,46 +6,20 @@
     <property name="can_focus">False</property>
 
     <child>
-      <object class="GtkScrolledWindow" id="search_vbox">
+      <object class="HdyPreferencesPage" id="search_page">
         <property name="visible">True</property>
-        <property name="hscrollbar_policy">never</property>
-        <property name="can_focus">False</property>
         <child>
-          <object class="HdyClamp">
+          <object class="HdyPreferencesGroup">
             <property name="visible">True</property>
-            <property name="margin_top">32</property>
-            <property name="margin_bottom">32</property>
-            <property name="margin_start">12</property>
-            <property name="margin_end">12</property>
+            <property name="description" translatable="yes">Control which search results are shown in the 
Activities Overview. The order of search results can also be changed by moving rows in the list.</property>
             <child>
-              <object class="GtkBox">
+              <object class="GtkListBox" id="list_box">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="hexpand">True</property>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="visible">True</property>
-                    <property name="xalign">0.0</property>
-                    <property name="margin-bottom">20</property>
-                    <property name="wrap">True</property>
-                    <property name="label" translatable="yes">Control which search results are shown in the 
Activities Overview. The order of search results can also be changed by moving rows in the list.</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkFrame" id="search_frame">
-                    <property name="visible">True</property>
-                    <child>
-                      <object class="GtkListBox" id="list_box">
-                        <property name="visible">True</property>
-                      </object>
-                    </child>
-                  </object>
-                </child>
+                <style>
+                  <class name="content"/>
+                </style>
               </object>
-           </child>
+            </child>
           </object>
         </child>
       </object>


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