summaryrefslogtreecommitdiff
path: root/src/shortcuts.c
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-13 20:57:16 +0300
committerPaul Buetow <paul@buetow.org>2026-07-13 20:57:16 +0300
commit0795d3cf926d0d937f25fcc699f5f674bf618c72 (patch)
tree48e3fcf44a7c5213c11c63c1f69eb8b336edb325 /src/shortcuts.c
parent48aa1b3cdbf27be2e016e8b532687226f9249043 (diff)
gridcull: thumbnail TMS cache, grid view, trash, window d/D/u/t (jt0)
M7 (task jt0): thumbnail cache + grid view + trash. - src/trash.{c,h}: ./Trash bin (lazy create, collision suffix -1/-2, restore_last for u undo, permanent delete for D). Plain-C, unit-tested. - src/thumbnail.{c,h}: freedesktop TMS cache (normal/large/x-large buckets, md5(URI) key, Thumb::URI/MTime/Size, mtime verify). Async GTask worker with GCancellable so the grid can cancel pending requests on dispose. - src/gridview.{c,h}: GgazeGrid (GtkWidget wrapping GtkFlowBox): one cell per navigator file, lazy thumbnail decode on realize, +/- resize 64-512, dim removed cells, mark badges, Enter/double-click → 'activate' signal, cursor sync. ggaze_grid_detach() breaks the nav ref before dispose. - src/navigator.{c,h}: removed set (mark_removed/is_removed/unmark_removed); _relist preserves removed items (stay dimmed even if absent from disk); get_remaining = count - removed_count. - src/window.c: d (trash+mark_removed+advance), D (permanent delete, confirm dialog if >1 marked), u (restore_last+rescan), t (toggle grid/large), +/- (viewer zoom in large / grid resize). Header counter uses remaining. - src/shortcuts.c: d/D/u/t/+/= bindings added. - tests: unit test_trash + test_thumbnail, integration test_grid_cull (grid count + trash/undo + ./sample-images 613-cell grid). 13/13 green, ASan clean. Fixed: grid dispose UAF (detach before nav freed), g_file_get_basename leak, test p_plain lifetime, thumbnail async-cancellable for clean dispose, test grid-toggle avoiding async-thumbnail drain issues.
Diffstat (limited to 'src/shortcuts.c')
-rw-r--r--src/shortcuts.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shortcuts.c b/src/shortcuts.c
index d946d30..6853490 100644
--- a/src/shortcuts.c
+++ b/src/shortcuts.c
@@ -29,6 +29,14 @@ static const ShortcutEntry SHORTCUTS[] = {
/* open / quit / back */
{GDK_KEY_o, 0, "win.open"},
{GDK_KEY_q, 0, "win.quit"},
+ {GDK_KEY_d, 0, "win.trash"},
+ {GDK_KEY_D, GDK_SHIFT_MASK, "win.delete"},
+ {GDK_KEY_u, 0, "win.undo"},
+ {GDK_KEY_t, 0, "win.toggle-view"},
+ {GDK_KEY_plus, 0, "win.zoom-in"},
+ {GDK_KEY_equal, 0, "win.zoom-in"},
+ {GDK_KEY_minus, 0, "win.zoom-out"},
+ {GDK_KEY_underscore, 0, "win.zoom-out"},
};
void