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:
@@ -134,6 +134,13 @@ fn main() {
|
||||
config = config.with_bundled_translations(lang);
|
||||
}
|
||||
|
||||
// The recording hook's element queries walk a tree the compiler only
|
||||
// describes when asked to (src/automation.rs). Only that build asks: the
|
||||
// extra tables are dead weight to everyone else.
|
||||
if std::env::var_os("CARGO_FEATURE_AUTOMATION").is_some() {
|
||||
config = config.with_debug_info(true);
|
||||
}
|
||||
|
||||
slint_build::compile_with_config(entry(&out_dir, live), config).expect("compiling app.slint");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user