summaryrefslogtreecommitdiff
path: root/src/gridview.h
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-20 17:36:28 +0300
committerPaul Buetow <paul@buetow.org>2026-07-20 17:36:28 +0300
commit7f9dc97115bb59b62b92f58c8fb01697f15e5a10 (patch)
tree7cd49219664d7b1ba895f96fd406b81aac2c8f8c /src/gridview.h
parentf4eea795c070e5ddca183bc6ff2e4199e39a5cd1 (diff)
grid: sync flowbox selection to navigator.current on Enter/t (cu0)
Arrow-key navigation in the grid moved the GtkFlowBox selection but never updated navigator.current, so Enter (and toggling to large with t) opened the stale current image instead of the highlighted one. _on_flow_key emitted the activate signal directly without syncing, unlike the double-click path (_on_child_activated) which does sync. Add ggaze_grid_sync_current(): reads the selected flowbox child and calls navigator_set_current_file. Call it from _on_flow_key before emitting activate, and from _action_toggle_view's grid→large branch (then load the now-current image). Mirrors the existing double-click sync.
Diffstat (limited to 'src/gridview.h')
-rw-r--r--src/gridview.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gridview.h b/src/gridview.h
index 582ada8..f6a4ad2 100644
--- a/src/gridview.h
+++ b/src/gridview.h
@@ -34,6 +34,10 @@ void ggaze_grid_set_hide_trashed(GgazeGrid *p_grid, gboolean b_hide);
/* Rebuild the cells from the navigator (call after structural changes). */
void ggaze_grid_refresh(GgazeGrid *p_grid);
+/* Sync navigator.current to the flowbox's currently-selected cell, so leaving
+ * the grid (Enter / toggle-to-large) opens the highlighted image. */
+gboolean ggaze_grid_sync_current(GgazeGrid *p_grid);
+
/* Number of cells currently in the grid. */
guint ggaze_grid_get_count(GgazeGrid *p_grid);