move controller connect to popup dialog
This commit is contained in:
@@ -50,6 +50,12 @@ def main() -> int:
|
||||
action="store_true",
|
||||
help="drive a simulated session so the shot shows live values",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--setup-dialog",
|
||||
default="",
|
||||
choices=("", "connection", "bus"),
|
||||
help="photograph the device-setup dialog on this tab instead of the window",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
width, height = (int(part) for part in args.size.lower().split("x"))
|
||||
|
||||
@@ -89,6 +95,25 @@ def main() -> int:
|
||||
window._on_move_abs(0, 1000.0)
|
||||
_wait_for(app, lambda: window._last_snapshot.axis(0).dpos != 0, 4.0)
|
||||
|
||||
if args.setup_dialog:
|
||||
# The dialog is a separate top-level window, so it is grabbed on its own
|
||||
# rather than inside the page shot.
|
||||
window._show_device_setup(args.setup_dialog) # noqa: SLF001
|
||||
app.processEvents()
|
||||
output = Path(args.out).resolve()
|
||||
target = window.device_setup
|
||||
if not target.grab().save(str(output)):
|
||||
print(f"could not write {output}", file=sys.stderr)
|
||||
return 1
|
||||
print(
|
||||
f"wrote {output} ({target.width()}x{target.height()}, theme={args.theme}, "
|
||||
f"tab={args.setup_dialog})"
|
||||
)
|
||||
target.close()
|
||||
window.close()
|
||||
app.processEvents()
|
||||
return 0
|
||||
|
||||
app.processEvents()
|
||||
|
||||
if args.compare:
|
||||
|
||||
Reference in New Issue
Block a user