[gnome-control-center/wip/feborges/new-search-panel: 26/30] search: Move "Search Locations" button to top bar



commit c173424c110c6f5537a8c12ad40b56dfd53f603e
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Jul 2 16:22:30 2019 +0200

    search: Move "Search Locations" button to top bar
    
    Fixes #591

 panels/search/cc-search-panel.c  |  4 ++--
 panels/search/cc-search-panel.ui | 35 ++++++++---------------------------
 2 files changed, 10 insertions(+), 29 deletions(-)
---
diff --git a/panels/search/cc-search-panel.c b/panels/search/cc-search-panel.c
index f4765556b..86049636a 100644
--- a/panels/search/cc-search-panel.c
+++ b/panels/search/cc-search-panel.c
@@ -703,6 +703,7 @@ cc_search_panel_constructed (GObject *object)
                           G_BINDING_DEFAULT |
                           G_BINDING_SYNC_CREATE);
 
+  cc_shell_embed_widget_in_header (cc_panel_get_shell (CC_PANEL (self)), self->settings_button, 
GTK_POS_LEFT);
   cc_shell_embed_widget_in_header (cc_panel_get_shell (CC_PANEL (self)), box, GTK_POS_RIGHT);
 }
 
@@ -725,8 +726,6 @@ cc_search_panel_init (CcSearchPanel *self)
                     G_CALLBACK (down_button_clicked), self);
   gtk_widget_set_sensitive (self->down_button, FALSE);
 
-  g_signal_connect (self->settings_button, "clicked",
-                    G_CALLBACK (settings_button_clicked), self);
   gtk_widget_set_sensitive (self->settings_button, cc_search_locations_dialog_is_available ());
 
   self->search_settings = g_settings_new ("org.gnome.desktop.search-providers");
@@ -760,4 +759,5 @@ cc_search_panel_class_init (CcSearchPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcSearchPanel, settings_button);
 
   gtk_widget_class_bind_template_callback (widget_class, search_panel_invalidate_button_state);
+  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 e93c6647b..ffff72042 100644
--- a/panels/search/cc-search-panel.ui
+++ b/panels/search/cc-search-panel.ui
@@ -97,33 +97,6 @@
                         <property name="expand">True</property>
                       </packing>
                     </child>
-                    <child>
-                      <object class="GtkToolItem" id="settings_item">
-                        <property name="visible">True</property>
-                        <child>
-                          <object class="GtkBox" id="i_s_ud_box">
-                            <property name="visible">True</property>
-                            <child>
-                               <object class="GtkButton" id="settings_button">
-                                 <property name="visible">True</property>
-                                 <child internal-child="accessible">
-                                   <object class="AtkObject" id="settings_button_a11y">
-                                     <property name="accessible-name" 
translatable="yes">Preferences</property>
-                                   </object>
-                                 </child>
-                                 <child>
-                                    <object class="GtkImage" id="settings_image">
-                                      <property name="visible">True</property>
-                                      <property name="icon-name">emblem-system-symbolic</property>
-                                      <property name="icon-size">1</property>
-                                    </object>
-                                 </child>
-                               </object>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -138,4 +111,12 @@
       </object>
     </child>
   </template>
+
+  <!-- Header widget -->
+  <object class="GtkButton" id="settings_button">
+    <property name="visible">True</property>
+    <property name="can-focus">True</property>
+    <property name="label" translatable="yes">Search Locations</property>
+    <signal name="clicked" handler="settings_button_clicked" object="CcSearchPanel" swapped="no"/>
+  </object>
 </interface>


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