Step to the next photograph from the keyboard in a library's develop

The arrow keys and space in develop called `next-image` and
`prev-image`, which walk the files given on the command line. A
photograph opened from a library leaves that list empty, so the keys did
nothing and only a click on the photo roll moved on.

With a library open the step now goes through the roll: it opens the
neighbouring frame exactly as clicking it would, and saves the outgoing
edit the same way.
This commit is contained in:
2026-09-24 05:09:39 +02:00
parent d6d27fb062
commit 41486bd59b
3 changed files with 56 additions and 36 deletions
+22 -2
View File
@@ -675,6 +675,26 @@ export component AppWindow inherits Window {
callback settings-open();
callback settings-close();
/// TRACES: FR-UI-5
/// One photograph along, from the keyboard.
///
/// `next-image` and `prev-image` walk the files given on the command
/// line, and a photograph opened from a library leaves that list empty —
/// so with a library open the arrow keys and space did nothing at all, and
/// only a click on the roll moved on. With a library the step is the
/// roll's own: open its neighbouring frame, exactly as clicking it would.
function step-photo(delta: int) {
if (Library.library-total > 0) {
if (Library.library-roll-current + delta >= 0) {
Library.library-roll-pick(Library.library-roll-current + delta);
}
} else if (delta > 0) {
root.next-image();
} else {
root.prev-image();
}
}
// FR-UI-1: layout class follows window width, not device type. A narrow
// desktop window gets the compact layout, exactly as a tablet would.
//
@@ -2341,11 +2361,11 @@ in property <bool> panel-visible: true;
// is as much a departure as going back
// to the grid and loses nothing.
if (event.text == Key.RightArrow || event.text == " ") {
root.next-image();
root.step-photo(1);
return accept;
}
if (event.text == Key.LeftArrow) {
root.prev-image();
root.step-photo(-1);
return accept;
}
return reject;