Close the help sheet with Escape, and keep keys from acting behind it

F1 opens the help sheet from the grid, and nothing on the keyboard closed
it: Escape fell through to the shell, and every other key went on judging,
labelling and keywording the photographs hidden behind the sheet.

Escape and Back now close the sheet first, ahead of the grid's other
sheets, since it is drawn over all of them. While it is open the grid's
handler declines every other key, so a stray P or Ctrl+K changes nothing
the reader cannot see.
This commit is contained in:
2026-09-24 23:42:27 -04:00
parent d489a34190
commit f8737e3fda
4 changed files with 54 additions and 39 deletions
+3 -3
View File
@@ -475,9 +475,9 @@ pub const GESTURES: &[Gesture] = &[
Gesture {
title: "Open this list",
section: "Library grid",
touch: "Press Help in the header",
pointer: "Press Help in the header",
keys: "F1",
touch: "Press Help in the header, and Done to put it away",
pointer: "Press Help in the header, and Done to put it away",
keys: "F1, and Escape to put it away",
manual: "",
},
Gesture {
+18 -3
View File
@@ -3082,6 +3082,13 @@ export component LibraryGrid inherits Rectangle {
// button, and a sheet it walked straight past would leave
// the user out of the grid with their selection gone.
if (Keys.chord(event) == "Back" || Keys.chord(event) == "Escape") {
// The help sheet first: it is drawn over everything
// else here, and F1 opened it from the keyboard, so
// the keyboard has to be able to put it away.
if (root.helping) {
root.helping = false;
return accept;
}
if (root.keywording) {
root.keywording = false;
return accept;
@@ -3104,6 +3111,12 @@ export component LibraryGrid inherits Rectangle {
}
return reject;
}
// Nothing else acts behind the help sheet: a key that
// judged or keyworded the grid under it would change
// photographs the reader cannot see.
if (root.helping) {
return reject;
}
// GESTURE: Export the selection as the last export was
// where: Library grid
// touch: Select them, then Export in the selection bar
@@ -3319,9 +3332,11 @@ export component LibraryGrid inherits Rectangle {
// mode. Rust ignores it when nothing is scoped.
// GESTURE: Open this list
// where: Library grid
// touch: Press Help in the header
// pointer: Press Help in the header
// keys: `F1`
// touch: Press Help in the header, and Done to put it
// away
// pointer: Press Help in the header, and Done to put it
// away
// keys: `F1`, and `Escape` to put it away
//
// GESTURE: Rename the collection the grid is showing
// where: Library grid