[gnome-control-center/gbsneto/search-applications: 1/4] applications: Select the first row at startup



commit c9ed06d2fc76edbe231ed75a905812aacf10b274
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Apr 1 18:28:10 2019 -0300

    applications: Select the first row at startup
    
    That way we are not presented the empty view initially.

 panels/applications/cc-applications-panel.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 5a4593d3b..21a34bb4d 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -1662,6 +1662,7 @@ static void
 cc_applications_panel_init (CcApplicationsPanel *self)
 {
   g_autoptr(GtkStyleProvider) provider = NULL;
+  GtkListBoxRow *row;
 
   g_resources_register (cc_applications_get_resource ());
 
@@ -1731,4 +1732,9 @@ cc_applications_panel_init (CcApplicationsPanel *self)
 
   self->globs = parse_globs ();
   self->search_providers = parse_search_providers ();
+
+  /* Select the first row */
+  row = gtk_list_box_get_row_at_index (self->sidebar_listbox, 0);
+  gtk_list_box_select_row (self->sidebar_listbox, row);
+  g_signal_emit_by_name (row, "activate");
 }


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