mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 02:07:09 -06:00
On macOS the menus are in the system menu bar, laid out as a Mac app's (Illustrator on the Mac as the reference), and the app settings sit in the VectorCraft menu: About, Settings ▸ (one item per Preferences page, General… ⌘K), Language ▸, Appearance ▸ (UI brightness), Services, Hide VectorCraft ⌃⌘H (⌘H stays View › Hide Edges), Hide Others ⌥⌘H, Show All and Quit ⌘Q (the app's own quit, so unsaved documents are asked about); they leave Edit and Help. Window gets Minimize ⌃⌘M, Zoom and Bring All to Front; Help is the system's Help menu. Windows, Linux and the web keep the in-window menu bar unchanged; --in-window-menus or VECTORCRAFT_IN_WINDOW_MENUS keeps it on macOS too, and so does a menu bar AppKit refuses to build. One menu model: the in-window menus and the native bar draw the same rows (menus::entry), and the platform-free native_menu module lays them out, decides when to update (a cheap state hash; labels, enabled and checked in place, a rebuild only when the structure changes) and hands key equivalents back to egui as the key presses they were, so shortcuts, user overrides and focused text fields behave as in the window and nothing fires twice. The muda backend (pinned =0.21.1, macOS only, no unsafe) is apps/vectorcraft/src/mac_menu.rs, mirroring PhotoCraft's. ui.inspect reports nativeMenuBar. Translations for the new labels in ja, es, zh-hans, zh-hant, cs and pt-br. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
2.1 KiB
TOML
52 lines
2.1 KiB
TOML
[package]
|
|
name = "vectorcraft"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
publish = false
|
|
default-run = "vectorcraft"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = ["wgpu", "accessibility"]
|
|
wgpu = ["eframe/wgpu"]
|
|
accessibility = ["eframe/accesskit"]
|
|
# Build with --no-default-features --features windows7 and the win7 Rust target.
|
|
windows7 = ["eframe/glow"]
|
|
|
|
[dependencies]
|
|
vectorcraft-engine = { workspace = true }
|
|
vectorcraft-ui-egui = { workspace = true }
|
|
eframe = { workspace = true, features = ["default_fonts", "wayland", "x11"] }
|
|
egui = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
log = { workspace = true }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
rfd = { workspace = true }
|
|
# wayland-data-control: native Wayland clipboard (Linux; X11 through XWayland only sees what X11 apps copied).
|
|
arboard = { workspace = true, features = ["image-data", "wayland-data-control"] }
|
|
image = { workspace = true }
|
|
webbrowser = { workspace = true }
|
|
# The window's monitors, size and position (the same winit eframe runs on).
|
|
winit = { version = "0.30", default-features = false }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
clipboard-win = { workspace = true }
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
# The macOS menu bar (src/mac_menu.rs): Tauri's menu crate, AppKit menus behind a safe API (no GTK
|
|
# with default features off). Pinned exactly: review the diff before bumping.
|
|
muda = { version = "=0.21.1", default-features = false }
|
|
objc2 = "0.6"
|
|
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSApplication", "NSEvent", "NSPasteboard", "NSResponder", "NSTextInputContext"] }
|
|
# Files opened from Finder and the Dock (src/open_documents.rs) and pasted bitmaps (src/clipboard.rs); both already come with winit, muda and rfd.
|
|
objc2-foundation = { version = "0.3", default-features = false, features = ["std", "block2", "NSArray", "NSData", "NSNotification", "NSOperation", "NSString", "NSURL"] }
|
|
block2 = "0.6"
|
|
|
|
[build-dependencies]
|
|
# Icon + VERSIONINFO for vectorcraft.exe; build.rs only uses it when targeting Windows.
|
|
winresource = "0.1"
|