diff --git a/src/Views/GridView.vala b/src/Views/GridView.vala index 0ee2c571..c55090a7 100644 --- a/src/Views/GridView.vala +++ b/src/Views/GridView.vala @@ -12,7 +12,6 @@ public class Slingshot.Widgets.Grid : Gtk.Box { public uint columns; } - private Gee.HashMap grids; private Hdy.Carousel paginator; private Page page; @@ -59,7 +58,7 @@ public class Slingshot.Widgets.Grid : Gtk.Box { set { // Clamp to valid values for keyboard navigation _current_grid_key = value.clamp (1, paginator.n_pages); - var grid = grids.@get (_current_grid_key); + var grid = (Gtk.Grid) paginator.get_children ().nth_data (_current_grid_key - 1); if (grid == null) { return; } @@ -89,8 +88,6 @@ public class Slingshot.Widgets.Grid : Gtk.Box { add (paginator); add (page_switcher); - grids = new Gee.HashMap (null, null); - can_focus = true; focus_in_event.connect_after (() => { refocus (); @@ -102,11 +99,10 @@ public class Slingshot.Widgets.Grid : Gtk.Box { } public void populate (Backend.AppSystem app_system) { - foreach (Gtk.Grid grid in grids.values) { - grid.destroy (); + foreach (unowned var child in paginator.get_children ()) { + paginator.remove (child); } - grids.clear (); _current_grid_key = 0; // Avoids clamp var grid = add_new_grid (); // Increments current_grid_key to 1 @@ -159,12 +155,10 @@ public class Slingshot.Widgets.Grid : Gtk.Box { paginator.add (grid); current_grid_key = current_grid_key + 1; - grids.set (current_grid_key, grid); return grid; } - private Gtk.Widget? get_widget_at (uint col, uint row) { if (col < 1 || col > page.columns || row < 1 || row > page.rows) { return null;