mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 22:08:42 +00:00
Hold back files that are ready to open while an opened document's Missing Fonts dialog waits for the frame
This commit is contained in:
@@ -352,6 +352,11 @@ fn after_open_for(app: &mut VectorcraftApp, r: &Value, web: bool) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether an opened document's Missing Fonts dialog waits for the frame's pump to open it.
|
||||
pub(crate) fn waiting(app: &VectorcraftApp) -> bool {
|
||||
app.ui.pending_fonts.iter().any(|&uid| dialog_for(app, uid).is_some())
|
||||
}
|
||||
|
||||
/// The Missing Fonts dialog of the open document `uid`, when fonts it uses aren't available.
|
||||
fn dialog_for(app: &VectorcraftApp, uid: u64) -> Option<MissingFontsDialog> {
|
||||
let st = app.session.documents().iter().find(|d| d.uid == uid)?;
|
||||
|
||||
@@ -142,7 +142,7 @@ fn track(app: &mut VectorcraftApp, path: &str, done: Receiver<Result<ReadFile, S
|
||||
/// May the active document change now ([`poll`])?
|
||||
pub(crate) fn may_switch(app: &VectorcraftApp) -> bool {
|
||||
let s = &app.session;
|
||||
!(app.any_dialog_open() || s.in_interaction() || (s.tool_busy() && s.pointer_held()))
|
||||
!(app.any_dialog_open() || crate::dialogs::missing_fonts::waiting(app) || s.in_interaction() || (s.tool_busy() && s.pointer_held()))
|
||||
}
|
||||
|
||||
/// Open the files that are ready (each frame). Not while a dialog is open: a document that opens
|
||||
|
||||
Reference in New Issue
Block a user