Let the manual's scripts find a control by its name
Every scene in tools/manual aimed at window pixels written in by hand, so a panel that gained a row moved every slider under it and the recording went on dragging where the slider used to be. The develop column has already moved that way (Compose now sits above Adjust), and nothing said. A build with the `automation` feature listens on the Unix socket named by DR_AUTOMATION and answers where an element is: by its accessible label, the name a screen reader reads, or by its markup id for the few things that are not controls (the canvas, the crop rectangle). It uses Slint's element queries, which need the compiler's debug tables, so the feature also turns those on in build.rs. It only answers questions; the input is still xdotool's real pointer. No default build has the feature, and one that has it listens only when the variable is set. drive.py gains click-on, drag-on, hold-on, wait-for, wait-gone, labels and ids. The grid's cells are now named by their file, each rating star by its value, the sidebar's + as "New collection", and the Adjust heading's reset as "Reset all adjustments" - controls a screen reader could not reach before either.
This commit is contained in:
@@ -104,6 +104,10 @@ anyhow.workspace = true
|
||||
thiserror.workspace = true
|
||||
log.workspace = true
|
||||
pollster.workspace = true
|
||||
# Slint's element queries, for the `automation` feature only. Pinned to the
|
||||
# exact Slint release: it reaches into i-slint-core, which is versioned in
|
||||
# lockstep and has no stable API of its own.
|
||||
i-slint-backend-testing = { version = "=1.17.1", default-features = false, optional = true }
|
||||
# Runtime YAML only for `live-style`; release builds read the tokens the
|
||||
# Slint compiler folded in at build time and never touch style.yaml.
|
||||
serde_norway = { workspace = true, optional = true }
|
||||
@@ -143,6 +147,12 @@ serde_norway.workspace = true
|
||||
scene-model = ["dr-segment/embedded-scene-model"]
|
||||
|
||||
default = []
|
||||
# Answer "where is the control labelled X?" over a Unix socket named by
|
||||
# `DR_AUTOMATION`, for the scripts that record the manual (src/automation.rs,
|
||||
# tools/manual). Off by default and never in a shipped build: it adds Slint's
|
||||
# element-query crate, and a listener nobody asked for has no place in a
|
||||
# release. `tools/manual/record.sh` builds with it.
|
||||
automation = ["dep:i-slint-backend-testing"]
|
||||
# Debug convenience: re-read style.yaml at startup so a palette can be tuned
|
||||
# without rebuilding. Costs the constant-folding of every token, so it stays
|
||||
# off by default and has no business in a release build.
|
||||
|
||||
Reference in New Issue
Block a user