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

Use the crate for pair validation, settle delay, and canvas defaults
in breadpad and breadman. breadman now depends on bread-utils v0.7.2
for screenshot_cli; existing hand-rolled argv parsing stays.
This commit is contained in:
Breadway 2026-08-16 00:26:07 +08:00
commit c929517b49
6 changed files with 37 additions and 32 deletions

View file

@ -19,6 +19,7 @@
//! the button/click-handler entirely), with no-op save/delete/error
//! callbacks since nothing here should actually persist a change.
use bread_utils::screenshot_cli::SETTLE_DELAY;
use gtk4::prelude::*;
use libadwaita::prelude::*;
use std::path::PathBuf;
@ -26,15 +27,10 @@ use std::rc::Rc;
use std::sync::Arc;
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 popping the editor popover open — 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;
#[derive(Clone)]
pub struct ScreenshotRequest {