mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-03 09:11:10 +00:00
* Add craft-dialogs: native file and message dialogs that never block the event loop Requests queue and show at the end of the frame on the main thread; answers come back with the app's continuation on a later frame. One dialog at a time, a drop guard and a panic guard so a dialog never stays open, and an override for tests. On macOS, Open and Folder show as a free-standing NSOpenPanel (beginWithCompletionHandler, which rfd can't show), Save and message boxes as sheets through rfd's async dialogs, never falling back to runModal. Filter extensions match in any letter case on Linux. * craft-dialogs: Dialogs::raise brings the open macOS panel to the front * CI: dialogs workflow (Linux clippy and tests for craft-dialogs) * craft-dialogs: per-instance macOS panel, parent window check, override panic guard, CI lints macOS code * craft-dialogs: raise only a visible panel; Open and Folder need a running app
27 lines
1.3 KiB
TOML
27 lines
1.3 KiB
TOML
[package]
|
|
name = "craft-dialogs"
|
|
description = "Native file and message dialogs that never block the event loop: queued requests, shown at the end of the frame, answered on a later frame."
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
repository.workspace = true
|
|
|
|
# Versions the apps already pin (rfd 0.17.2, raw-window-handle 0.6.2), so adopting the crate adds
|
|
# nothing new to their Cargo.lock. rfd without its `wayland` feature, which links libwayland-client
|
|
# through pkg-config unless winit's `dlopen` is in the build too; the apps' own rfd keeps it on.
|
|
[dependencies]
|
|
raw-window-handle = "0.6.2"
|
|
rfd = { version = "0.17.2", default-features = false, features = ["xdg-portal"] }
|
|
|
|
# The free-standing Open and Folder panel (`beginWithCompletionHandler:`). rfd and winit already
|
|
# use these.
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
block2 = "0.6.2"
|
|
objc2 = { version = "0.6.4", default-features = false, features = ["std"] }
|
|
objc2-app-kit = { version = "0.3.2", default-features = false, features = ["std", "block2", "NSApplication", "NSOpenPanel", "NSPanel", "NSResponder", "NSSavePanel", "NSView", "NSWindow"] }
|
|
objc2-foundation = { version = "0.3.2", default-features = false, features = ["std", "NSArray", "NSString", "NSURL"] }
|
|
|
|
[lints]
|
|
workspace = true
|