mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-26 02:58:32 -06:00
macOS: open PDFs from Finder, Open With and the Dock (#73)
Finder hands files to an app as an Apple event, not on the command line. winit doesn't handle it, so AppKit answered "PrintCraft cannot open files in the PDF document format". The bundle also declared no PDF document type: its Info.plist still carried the sibling image editor's types. - Info.plist declares PDF (by extension and MIME type) as a document type, role Editor, rank Alternate: offered under Open With and settable as the default, without taking over on install. - apps/printcraft registers open-documents and quit Apple event handlers through fmv-macos-events (=0.1.0, the audited safe wrapper PhotoCraft uses, since the Objective-C interop needs unsafe), before the launch event arrives. - printcraft-ui-egui gains OsEvent and PrintCraftApp::os_events, polled every frame: Open opens each file as File > Open does; Quit closes the window like its close button, so unsaved changes are asked about. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2e49a84ace
commit
f50c5a4e88
@@ -22,8 +22,8 @@ milestone = "M1"
|
||||
status = "shipped"
|
||||
commands = ["file.open"]
|
||||
tools = ["doc_open"]
|
||||
evidence = ["crates/automation/tests/automation.rs::open_inspect_render_and_find", "crates/ui-egui/tests/ui.rs::opening_a_pdf_shows_comments_and_bookmarks"]
|
||||
notes = ""
|
||||
evidence = ["crates/automation/tests/automation.rs::open_inspect_render_and_find", "crates/ui-egui/tests/ui.rs::opening_a_pdf_shows_comments_and_bookmarks", "crates/ui-egui/tests/ui.rs::files_and_quit_from_the_operating_system"]
|
||||
notes = "File ▸ Open, the command line (Linux and Windows file associations), and on macOS Finder, Open With and the Dock (Apple events; the bundle declares PDF as a document type)"
|
||||
|
||||
[[feature]]
|
||||
id = "core.repair-broken-files"
|
||||
|
||||
Reference in New Issue
Block a user