[gnome-control-center/wip/feborges/new-search-panel: 29/30] search: Do not allow selecting rows



commit 041a3e92f16713e4da6b7e1cf42d1805bafa6649
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Jul 16 13:13:21 2019 +0000

    search: Do not allow selecting rows
    
    There is no functionality involving selecting a row here.

 panels/search/cc-search-panel-row.ui | 1 +
 panels/search/cc-search-panel.c      | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/panels/search/cc-search-panel-row.ui b/panels/search/cc-search-panel-row.ui
index b147fb8f2..1cb76aede 100644
--- a/panels/search/cc-search-panel-row.ui
+++ b/panels/search/cc-search-panel-row.ui
@@ -4,6 +4,7 @@
   <template class="CcSearchPanelRow" parent="GtkListBoxRow">
     <property name="visible">True</property>
     <property name="can-focus">True</property>
+    <property name="selectable">False</property>
     <signal name="drag_data_received" handler="drag_data_received_cb" object="CcSearchPanelRow" 
swapped="yes"/>
     <child>
       <object class="GtkEventBox" id="drag_handle">
diff --git a/panels/search/cc-search-panel.c b/panels/search/cc-search-panel.c
index 34cb66170..e7095d8cb 100644
--- a/panels/search/cc-search-panel.c
+++ b/panels/search/cc-search-panel.c
@@ -35,6 +35,7 @@ struct _CcSearchPanel
   GtkWidget  *search_vbox;
   GtkWidget  *search_frame;
   GtkWidget  *settings_button;
+  CcSearchPanelRow  *selected_row;
 
   GCancellable *load_cancellable;
   GSettings  *search_settings;
@@ -169,7 +170,7 @@ search_panel_move_selected (CcSearchPanel *self,
   g_autoptr(GList) children = NULL;
   GList *l, *other;
 
-  row = gtk_list_box_get_selected_row (GTK_LIST_BOX (self->list_box));
+  row = GTK_LIST_BOX_ROW (self->selected_row);
   app_info = cc_search_panel_row_get_app_info (CC_SEARCH_PANEL_ROW (row));
   app_id = g_app_info_get_id (app_info);
 
@@ -272,7 +273,7 @@ row_moved_cb (CcSearchPanel    *self,
   gint dest_idx = gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (dest_row));
   gboolean down;
 
-  gtk_list_box_select_row (GTK_LIST_BOX (self->list_box), GTK_LIST_BOX_ROW (row));
+  self->selected_row = row;
 
   down = (source_idx - dest_idx) < 0;
   for (int i = 0; i < ABS (source_idx - dest_idx); i++)


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