From 6acf5318b0964afcd10819b18ecc62ec3e5c7f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sat, 7 Mar 2026 10:18:26 -0800 Subject: [PATCH] GridView: remove grids hashmap --- src/Views/GridView.vala | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Views/GridView.vala b/src/Views/GridView.vala index 0fdb9890..e634c725 100644 --- a/src/Views/GridView.vala +++ b/src/Views/GridView.vala @@ -13,7 +13,6 @@ public class Slingshot.Widgets.Grid : Gtk.Box { } private Gtk.Grid current_grid; - private Gee.HashMap grids; private Hdy.Carousel paginator; private Page page; @@ -60,7 +59,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; } @@ -91,8 +90,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 (); @@ -104,11 +101,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 add_new_grid (); // Increments current_grid_key to 1 @@ -161,7 +157,6 @@ public class Slingshot.Widgets.Grid : Gtk.Box { paginator.add (current_grid); current_grid_key = current_grid_key + 1; - grids.set (current_grid_key, current_grid); }