Adopt bread_utils::screenshot_cli for --screenshot flags
Some checks failed
check / check (push) Failing after 3s
dev release / build (push) Successful in 29s

Replace the local settle delay, canvas defaults, and pair-validation
error path with bread-utils v0.7.2. Hand-rolled argv parsing stays.
This commit is contained in:
Breadway 2026-08-16 00:26:07 +08:00
parent af6ba1bd82
commit a7a67d7d84
2 changed files with 32 additions and 16 deletions

View file

@ -21,19 +21,15 @@
//! both render embedded *inside* the Learn/Home tabs respectively, so
//! they're already covered by those tabs' own captures.
use bread_utils::screenshot_cli::SETTLE_DELAY;
use gtk4::prelude::*;
use std::path::PathBuf;
use std::time::Duration;
/// Extra settle time after `map` for the first frame to actually paint
/// before grim runs — `map` fires once the surface exists, not once
/// anything has been drawn into it.
const SETTLE_DELAY: Duration = Duration::from_millis(300);
/// Delay before opening the wizard modal — same reasoning as every other
/// app's PRE_POPUP_DELAY: the parent window's own layout needs a beat to
/// settle first.
const PRE_POPUP_DELAY: Duration = Duration::from_millis(300);
const PRE_POPUP_DELAY: Duration = SETTLE_DELAY;
const KNOWN_VIEWS: &[&str] = &["home", "learn", "ask", "troubleshoot-wizard"];