From de9ceaeb0cc7040153c3ba1288180bd38767f639 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 20 Jul 2026 19:46:42 +0300 Subject: grid: mark multi-selection (v / Ctrl+a / Esc) and a ? shortcuts overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The navigator already had a mark API and the grid rendered mark badges, but nothing could set marks — so multi-file ops (D, Ctrl+c, m) only ever acted on the single current image. Wire up marking in the UI: - v toggles a mark on the highlighted grid cell (or the current image in large view). navigator_toggle_mark does not emit "changed", so the cell's badge is updated in place via ggaze_grid_update_mark_badge (no reflow / re-decode). - Ctrl+a marks all; Esc now clears marks first (contextual), then keeps its existing back/quit behavior. - The window title appends "N marked" so multi-selection is visible. - A GtkCssProvider styles .ggaze-marked (accent border + tint) — the class was set but had no styling, so badges were invisible. Also add a ? -> win.shortcuts action that presents a GtkShortcutsWindow (grouped: navigation, view, selection, files, zoom) built from an inline GtkBuilder UI string, transient to the window. tests/test_shortcut.c full-table test updated for the three new bindings (v, Ctrl+a, ?) -> 23 rows, 19 actions. --- src/shortcuts.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/shortcuts.c') diff --git a/src/shortcuts.c b/src/shortcuts.c index 0c737bd..8ea978d 100644 --- a/src/shortcuts.c +++ b/src/shortcuts.c @@ -33,6 +33,9 @@ static const ShortcutEntry SHORTCUTS[] = { {GDK_KEY_D, GDK_SHIFT_MASK, "win.delete"}, {GDK_KEY_u, 0, "win.undo"}, {GDK_KEY_t, 0, "win.toggle-view"}, + {GDK_KEY_v, 0, "win.mark"}, + {GDK_KEY_a, GDK_CONTROL_MASK, "win.mark-all"}, + {GDK_KEY_question, 0, "win.shortcuts"}, {GDK_KEY_plus, 0, "win.zoom-in"}, {GDK_KEY_equal, 0, "win.zoom-in"}, {GDK_KEY_minus, 0, "win.zoom-out"}, -- cgit v1.2.3