summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-20 19:46:42 +0300
committerPaul Buetow <paul@buetow.org>2026-07-20 19:46:42 +0300
commitde9ceaeb0cc7040153c3ba1288180bd38767f639 (patch)
tree6a3fd48200ac87622659f9cea013da3ad70ad27b /tests
parentb69ed3923e42f122910242e724ee9dc43208d7b4 (diff)
grid: mark multi-selection (v / Ctrl+a / Esc) and a ? shortcuts overlay
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_shortcut.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/test_shortcut.c b/tests/test_shortcut.c
index db68e7b..e57d361 100644
--- a/tests/test_shortcut.c
+++ b/tests/test_shortcut.c
@@ -328,10 +328,11 @@ test_shortcut_keypath_toggle_and_back(void) {
static void
test_shortcut_full_table_registered(void) {
static const char *ACTIONS[] = {
- "win.prev", "win.next", "win.first", "win.last",
- "win.open", "win.quit", "win.trash", "win.delete",
- "win.undo", "win.toggle-view", "win.zoom-in", "win.zoom-out",
- "win.fullscreen", "win.slideshow", "win.info", "win.back",
+ "win.prev", "win.next", "win.first", "win.last",
+ "win.open", "win.quit", "win.trash", "win.delete",
+ "win.undo", "win.toggle-view", "win.mark", "win.mark-all",
+ "win.shortcuts", "win.zoom-in", "win.zoom-out", "win.fullscreen",
+ "win.slideshow", "win.info", "win.back",
};
GgazeWindow *p_win = new_window();
GtkShortcutController *p_sc = find_shortcut_controller(GTK_WIDGET(p_win));
@@ -341,9 +342,9 @@ test_shortcut_full_table_registered(void) {
g_assert_nonnull(p_s);
g_object_unref(p_s);
}
- /* The SHORTCUTS[] table has 20 rows (some actions appear twice, e.g.
- * win.prev for h and Left). The controller must carry all 20. */
- g_assert_cmpint(g_list_model_get_n_items(G_LIST_MODEL(p_sc)), ==, 20);
+ /* The SHORTCUTS[] table has 23 rows now (some actions appear twice, e.g.
+ * win.prev for h and Left; win.zoom-in for plus and equal). */
+ g_assert_cmpint(g_list_model_get_n_items(G_LIST_MODEL(p_sc)), ==, 23);
g_object_unref(p_sc);
g_object_unref(p_win);
drain_main(200);