From 5386fd29fbd8322a115dc1b9d91a1d2b9db465c7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 04:04:35 -0800 Subject: [PATCH] Type: only keypad digits start an Alt code, and the Windows hook ends its Alt hold The app's root values set `AltCodeKeys::Keypad`, so on Windows and Linux only the numeric keypad types an Alt code. Alt with a top-row digit stays a key press and reaches its shortcut (the Type tool's Alt+2 and a user-set Alt+5 included). macOS has no Alt codes and is unchanged. The Windows key-message hook now calls `alt_code_digits_taken` when it takes a keypad code's digits out of the frame, so releasing Alt after the code is not read as a lone Alt: no menu bar focus, no Alt tap and no alert in a field. Every craft-libs rev moves to storytold/craft-libs#4453's head (1ccea91875) for these two calls, `xtask/src/pdf_deps.rs` included. With that pin: - Info panel readouts copied nothing on click: since craft-libs #4320 a dock group's measuring run uses the ids of its real run, and `copy_shown` took the saved press there. It now returns early in a sizing pass. - `applying_a_dialog_preview_reads_the_menus` waits for the angle field to give up the keys and counts the second menu send, as on #10195. --- Cargo.lock | 212 +++++++++++----------- Cargo.toml | 76 ++++---- apps/vectorcraft-web/Cargo.toml | 2 +- apps/vectorcraft/Cargo.toml | 2 + apps/vectorcraft/src/app.rs | 2 +- apps/vectorcraft/src/windows_alt_codes.rs | 103 +++++++++-- crates/ui-egui/src/app.rs | 6 +- crates/ui-egui/src/panels/doc_info.rs | 5 + crates/ui-egui/src/shortcuts/tests.rs | 59 +++++- crates/ui-egui/src/tests/nativemenu.rs | 18 +- xtask/src/pdf_deps.rs | 2 +- 11 files changed, 322 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fce3ecad1..38d858ec78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -626,12 +626,6 @@ dependencies = [ "cpufeatures 0.3.1", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "block-buffer" version = "0.10.4" @@ -725,6 +719,17 @@ dependencies = [ "brotli-decompressor 5.0.3", ] +[[package]] +name = "brotli" +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", + "brotli-decompressor 6.3.2", +] + [[package]] name = "brotli-decompressor" version = "5.0.3" @@ -1184,19 +1189,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-graphics2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c" -dependencies = [ - "bitflags 2.13.2", - "block", - "cfg-if", - "core-foundation 0.10.1", - "libc", -] - [[package]] name = "core_detect" version = "1.0.0" @@ -1239,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "crc32fast", "flate2", @@ -1291,18 +1283,19 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "block2 0.6.2", "objc2 0.6.5", "objc2-app-kit 0.3.2", + "objc2-core-graphics", "objc2-foundation 0.3.2", ] [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "egui", ] @@ -1388,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "md-5", "rayon", @@ -1397,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "rayon", ] @@ -1451,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "serde", ] @@ -1501,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "serde", "serde_json", @@ -1542,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "gif", ] @@ -1626,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "flate2", ] @@ -1634,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,8 +1640,10 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", "chrono", "fixed_decimal", "icu_calendar", @@ -1675,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "chrono", "craft-codepage", @@ -1819,15 +1814,16 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24#1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ + "uds_windows", "winsafe", ] [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-keymap", @@ -1843,7 +1839,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "flate2", "serde", @@ -1854,7 +1850,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1866,12 +1862,12 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "async-channel", "async-io", "async-process", - "core-graphics2", + "craft-appkit", "craft-atomic", "craft-docpath", "craft-host", @@ -1881,6 +1877,8 @@ dependencies = [ "js-sys", "log", "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", "rfd", "serde", "serde_json", @@ -1897,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1906,7 +1904,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-host", @@ -1930,7 +1928,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1941,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-eps", "flate2", @@ -1955,7 +1953,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "encoding_rs", "flate2", @@ -1966,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "dispatch2", "egui", @@ -1979,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1998,7 +1996,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-atomic", "craft-host", @@ -2015,7 +2013,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "fax", "hayro-ccitt", @@ -2026,7 +2024,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2047,7 +2045,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2059,7 +2057,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2084,7 +2082,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2099,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-atomic", "craft-behavior", @@ -2114,7 +2112,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "serde", "thiserror 2.0.21", @@ -2124,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "serde", "thiserror 2.0.21", @@ -2133,7 +2131,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2148,12 +2146,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2167,7 +2165,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-i18n", @@ -2183,7 +2181,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "accesskit", "craft-behavior", @@ -2221,7 +2219,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2232,7 +2230,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-host", @@ -2250,7 +2248,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-host", @@ -2271,7 +2269,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-host", @@ -2292,7 +2290,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-behavior", "craft-host", @@ -2311,7 +2309,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "base64 0.22.1", "chrono", @@ -2343,7 +2341,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "flate2", "serde", @@ -2354,7 +2352,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2364,7 +2362,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "js-sys", "serde_json", @@ -2375,7 +2373,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "winsafe", ] @@ -2383,7 +2381,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "craft-appkit", "craft-atomic", @@ -2415,7 +2413,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3770,16 +3768,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ - "brotli", + "brotli 8.0.4", "hayro-postscript", ] [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3797,7 +3795,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3815,12 +3813,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "flate2", "hayro-ccitt", @@ -4803,7 +4801,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4960,7 +4958,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=1ccea91875c30b091aa6e24d36b6906a9414815d#1ccea91875c30b091aa6e24d36b6906a9414815d" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index cc76d129c5..410256b0d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,51 +10,51 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -194,13 +194,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index ce4d1d3d44..9e15973811 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "1ccea91875c30b091aa6e24d36b6906a9414815d", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml index 3ec7da1b75..bc000f0bd6 100644 --- a/apps/vectorcraft/Cargo.toml +++ b/apps/vectorcraft/Cargo.toml @@ -130,3 +130,5 @@ winresource = "0.1" [dev-dependencies] tempfile = "3" +# The framework's test frames (`craft::ui::testing`), for the Alt-code hook's tests. +craft = { workspace = true, features = ["ui-testing"] } diff --git a/apps/vectorcraft/src/app.rs b/apps/vectorcraft/src/app.rs index b91282e7da..65bcad703f 100644 --- a/apps/vectorcraft/src/app.rs +++ b/apps/vectorcraft/src/app.rs @@ -46,7 +46,7 @@ impl eframe::App for App { } // The characters Alt + keypad codes typed (#5108). #[cfg(windows)] - super::windows_alt_codes::raw_input_hook(raw); + super::windows_alt_codes::raw_input_hook(ctx, raw); // Symbol-font characters a keyboard tool typed (NHM Writer legacy Tamil). #[cfg(windows)] super::windows_symbol_chars::raw_input_hook(raw); diff --git a/apps/vectorcraft/src/windows_alt_codes.rs b/apps/vectorcraft/src/windows_alt_codes.rs index 0abf65ddc9..f86b81620f 100644 --- a/apps/vectorcraft/src/windows_alt_codes.rs +++ b/apps/vectorcraft/src/windows_alt_codes.rs @@ -11,7 +11,9 @@ //! the character that follows Alt's release, and [`raw_input_hook`] hands it to the frame as typed //! text, so the Type tool (or a panel's text field) types it like any other character, in the //! same undo step as the typing round it. The keypad digits themselves are taken out of the frame, -//! so they don't run a shortcut bound to Alt and a digit. +//! so they don't run a shortcut bound to Alt and a digit, and [`raw_input_hook`] tells the framework +//! that the Alt hold had digits typed in it (`alt_code_digits_taken`), so it does not read Alt's +//! release as a lone Alt (an alert in a field that holds drafts, or the menu bar taking the focus). //! //! With NumLock off the keypad keys arrive as Insert, End, Down, Page Down, Left, Clear, Right, //! Home, Up and Page Up, and Windows still composes the code from them. They are told from the @@ -20,8 +22,10 @@ //! so with Alt held they count as digits and are taken out of the frame too, rather than moving //! the caret before the character arrives. //! -//! egui reports a keypad digit as the same key as the digit above the letters, so the other -//! platforms, whose systems have no such convention, can't tell them apart either. +//! egui reports a keypad digit as the same key as the digit above the letters and tells them apart +//! only by the physical key. On the other platforms the framework types keypad codes itself, and on +//! every platform Alt with a top-row digit stays a key press (`AltCodeKeys::Keypad`, set in the +//! app's root values). #![cfg_attr(not(windows), allow(dead_code))] @@ -132,9 +136,10 @@ impl AltCodes { } /// Hand the frame `events` the characters typed since the last frame, as typed text, and take - /// out the keypad digits typed with Alt held. - fn drain(&mut self, events: &mut Vec) { + /// out the keypad digits typed with Alt held. Returns whether it took any out. + fn drain(&mut self, events: &mut Vec) -> bool { let mut keypad = std::mem::take(&mut self.keypad_events); + let before = events.len(); if !keypad.is_empty() { events.retain(|e| { let Event::Key { key, modifiers, .. } = e else { @@ -154,9 +159,11 @@ impl AltCodes { } }); } + let taken = events.len() < before; if !self.typed.is_empty() { events.push(Event::Text(std::mem::take(&mut self.typed))); } + taken } } @@ -183,12 +190,13 @@ pub fn msg_hook(msg: *const std::ffi::c_void) { } /// Before egui reads the main window's frame: the characters Alt + keypad codes typed, as text. -pub fn raw_input_hook(raw: &mut egui::RawInput) { - CODES.with(|c| { - if let Ok(mut c) = c.try_borrow_mut() { - c.drain(&mut raw.events); - } - }); +/// When it takes keypad digits out of the frame, it tells the framework in `ctx` that the Alt hold +/// had digits typed in it. +pub fn raw_input_hook(ctx: &egui::Context, raw: &mut egui::RawInput) { + let taken = CODES.with(|c| c.try_borrow_mut().is_ok_and(|mut c| c.drain(&mut raw.events))); + if taken { + craft::ui::runtime::egui::input::alt_code_digits_taken(ctx, raw.viewport_id); + } } #[cfg(test)] @@ -328,6 +336,79 @@ mod tests { assert_eq!(events, vec![key(Key::Home, true, true), key(Key::Home, true, false)]); } + /// The physical keys egui reports for the keypad digits, by digit. + const KEYPAD_KEYS: [Key; 10] = + [Key::Numpad0, Key::Numpad1, Key::Numpad2, Key::Numpad3, Key::Numpad4, Key::Numpad5, Key::Numpad6, Key::Numpad7, Key::Numpad8, Key::Numpad9]; + + /// One frame of the framework's test window: Windows' key `messages` reach [`msg_hook`]'s + /// state, then `events` pass through [`raw_input_hook`] before the frame reads them. + fn hooked_frame(frames: &mut craft::ui::testing::Frames, show: &mut dyn FnMut(&mut egui::Ui), messages: &[(u32, usize)], events: Vec) { + CODES.with(|c| { + let mut c = c.borrow_mut(); + for &(message, wparam) in messages { + c.message(message, wparam, 0); + } + }); + let mut raw = egui::RawInput { events, ..Default::default() }; + raw_input_hook(&frames.ctx, &mut raw); + frames.frame(raw.events, &mut *show); + } + + /// After a code the hook composed, the framework does not read Alt's release as a lone Alt: a + /// tool that claims the Alt tap gets none, and the code's character is typed. A lone Alt after + /// it is a tap again. + #[test] + fn the_alt_release_after_a_composed_code_is_no_lone_alt() { + use craft::ui::runtime::env::{AltCodeKeys, RootEnv}; + use craft::ui::runtime::keys::{claim_alt_tap, take_alt_tap}; + use std::cell::Cell; + use std::rc::Rc; + + let mut frames = craft::ui::testing::Frames::new(); + craft::ui::testing::windows::set_os(&frames.ctx, craft::host::target::Os::Windows); + frames.root(RootEnv::default().alt_code_keys(AltCodeKeys::Keypad)); + let tool = craft::ui::testing::focus::named_id("alt tap tool"); + let (taps, text) = (Rc::new(Cell::new(0)), Rc::new(RefCell::new(String::new()))); + let mut show = { + let (taps, text) = (Rc::clone(&taps), Rc::clone(&text)); + move |ui: &mut egui::Ui| { + taps.set(taps.get() + usize::from(take_alt_tap(ui.ctx(), tool))); + claim_alt_tap(ui.ctx(), tool); + ui.input(|input| { + for event in &input.events { + if let Event::Text(t) = event { + text.borrow_mut().push_str(t); + } + } + }); + } + }; + frames.frame(vec![], &mut show); + frames.frame(vec![], &mut show); + + let alt = |down: bool| Event::ModifiersChanged(if down { egui::Modifiers::ALT } else { egui::Modifiers::NONE }); + let keypad = |d: usize, pressed: bool| Event::Key { + key: DIGIT_KEYS[d], + physical_key: Some(KEYPAD_KEYS[d]), + pressed, + repeat: false, + modifiers: egui::Modifiers::ALT, + }; + hooked_frame(&mut frames, &mut show, &[(WM_SYSKEYDOWN, ALT)], vec![alt(true)]); + for d in [0, 2, 3, 3] { + let vk = VK_NUMPAD0 + d; + hooked_frame(&mut frames, &mut show, &[(WM_SYSKEYDOWN, vk), (WM_SYSKEYUP, vk)], vec![keypad(d, true), keypad(d, false)]); + } + hooked_frame(&mut frames, &mut show, &[(WM_KEYUP, ALT), (WM_CHAR, 0xE9)], vec![alt(false)]); + frames.frame(vec![], &mut show); + assert_eq!((taps.get(), text.take()), (0, "é".to_owned()), "the code's Alt release is no Alt tap, and its character is typed once"); + + hooked_frame(&mut frames, &mut show, &[(WM_SYSKEYDOWN, ALT)], vec![alt(true)]); + hooked_frame(&mut frames, &mut show, &[(WM_KEYUP, ALT)], vec![alt(false)]); + frames.frame(vec![], &mut show); + assert_eq!(taps.get(), 1, "a lone Alt after the code is a tap"); + } + #[test] fn numlock_off_keys_without_alt_are_left_alone() { let mut c = AltCodes::default(); diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 84ab44d769..2a4d76c16b 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -11,7 +11,7 @@ use craft::ui::docking::IconGroupSeparator; use craft::ui::list::{CommandHighlight, ThumbRows}; use craft::ui::menu::MenuTitleLook; use craft::ui::patterns::form_dialogs::PresetCardLook; -use craft::ui::runtime::env::{RootEnv, Scale, ScrubDrags, WindowKey}; +use craft::ui::runtime::env::{AltCodeKeys, RootEnv, Scale, ScrubDrags, WindowKey}; use craft::ui::runtime::frame::{FrameInput, FrameOutput}; use craft::ui::runtime::toast::{self, Toast}; use craft::ui::runtime::windows::WindowHost; @@ -823,6 +823,10 @@ pub(crate) fn root_env(prefs: &vectorcraft_engine::Prefs, native_ppp: f32, print root.escape_leaves_fields = true; // A held key repeats its command (Cmd+= keeps zooming in). root.shortcuts_repeat = true; + // On Windows and Linux only the keypad digits type an Alt code, and Alt with a top-row digit stays a key press for + // the shortcuts (macOS has no Alt codes). On Windows the app reads keypad codes from the system's key messages + // (the app's `windows_alt_codes`). + root.alt_code_keys = AltCodeKeys::Keypad; root } diff --git a/crates/ui-egui/src/panels/doc_info.rs b/crates/ui-egui/src/panels/doc_info.rs index e6f7cb6e86..be9c0f9360 100644 --- a/crates/ui-egui/src/panels/doc_info.rs +++ b/crates/ui-egui/src/panels/doc_info.rs @@ -62,6 +62,11 @@ pub(crate) fn copy_shown(ui: &mut Ui, shown: &egui::Response, value: &str) -> bo // The click's own position and keys: a move or a key change after the release in the same // frame leaves the pointer and the held keys elsewhere. A frame with more than one release // copies nothing, since the click flags below do not say which release they describe. + // A measuring run shows the readout under the ids of the real run: it reads no click and + // leaves the saved press for the real run. + if ui.is_sizing_pass() { + return false; + } let area = shown.interact_rect.intersect(ui.clip_rect()); let primary = egui::PointerButton::Primary; let press_id = shown.id.with("readout_copy_press"); diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index f5cd51ebb5..a87672a95e 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -975,6 +975,63 @@ fn alt_chords_outside_text_editing_type_nothing() { } } +/// A digit's press or release with Alt held, from the keypad (`keypad`) or the top row. +fn alt_digit(digit: usize, keypad: bool, pressed: bool) -> egui::Event { + const DIGITS: [Key; 10] = [Key::Num0, Key::Num1, Key::Num2, Key::Num3, Key::Num4, Key::Num5, Key::Num6, Key::Num7, Key::Num8, Key::Num9]; + const KEYPAD: [Key; 10] = + [Key::Numpad0, Key::Numpad1, Key::Numpad2, Key::Numpad3, Key::Numpad4, Key::Numpad5, Key::Numpad6, Key::Numpad7, Key::Numpad8, Key::Numpad9]; + let physical_key = Some(if keypad { KEYPAD[digit] } else { DIGITS[digit] }); + egui::Event::Key { key: DIGITS[digit], physical_key, pressed, repeat: false, modifiers: Modifiers::ALT } +} + +/// Alt held, `digits` typed on the keypad or the top row, Alt released: one frame each. +fn alt_digits(digits: &[usize], keypad: bool) -> Vec> { + let mut frames = vec![vec![egui::Event::ModifiersChanged(Modifiers::ALT)]]; + frames.extend(digits.iter().map(|&d| vec![alt_digit(d, keypad, true), alt_digit(d, keypad, false)])); + frames.push(vec![egui::Event::ModifiersChanged(Modifiers::NONE)]); + frames +} + +/// On Windows and Linux only the keypad digits type an Alt code: while type is edited, Alt with keypad 0131 types `ƒ` +/// (Windows-1252), and Alt with the same top-row digits, none of which the Type tool claims, types no code. +#[test] +fn only_keypad_digits_type_an_alt_code() { + for os in [craft::host::target::Os::Windows, craft::host::target::Os::Linux] { + for (keypad, expected) in [(false, "Hi"), (true, "Hi\u{0192}")] { + let (mut app, id) = editing_hi(); + let ctx = crate::testing::ui_context(); + craft::ui::testing::windows::set_os(&ctx, os); + idle(&mut app, &ctx, 2); + for events in alt_digits(&[0, 1, 3, 1], keypad) { + key_frame(&mut app, &ctx, events); + } + idle(&mut app, &ctx, 1); + assert_eq!(text_and_layers(&mut app, id).0, expected, "{os:?}, keypad {keypad}"); + } + } +} + +/// On Windows and Linux a shortcut of Alt and a top-row digit runs its command; Alt with the keypad digit types an +/// Alt code instead. +#[test] +fn alt_and_a_top_row_digit_runs_its_shortcut() { + for os in [craft::host::target::Os::Windows, craft::host::target::Os::Linux] { + for (keypad, runs) in [(false, true), (true, false)] { + let mut app = app_with_shortcut("paint.default", "Alt+5"); + app.session.execute("paint.setFill", &json!({"color": "#336699"})).unwrap(); + let ctx = crate::testing::ui_context(); + craft::ui::testing::windows::set_os(&ctx, os); + idle(&mut app, &ctx, 2); + for events in alt_digits(&[5], keypad) { + key_frame(&mut app, &ctx, events); + } + idle(&mut app, &ctx, 1); + let fill = crate::panels::current_paints(&app).0.color().map(|c| c.to_hex()); + assert_eq!(fill.as_deref() != Some("#336699"), runs, "{os:?}, keypad {keypad}: fill {fill:?}, {}", app.ui.status); + } + } +} + /// Alt+P chooses the Quick Pen and is no Alt tap; a lone Alt tap then switches its action, and Alt /// let go after a click does not. #[test] @@ -1313,7 +1370,7 @@ fn brackets_size_the_blob_brush_and_the_eraser() { key_frame(&mut app, &ctx, vec![text("]")]); key_frame(&mut app, &ctx, vec![text("]")]); assert_eq!(size(&mut app), before + 2.0, "{tool}"); - // Option-8 types `[` on a Turkish Mac keyboard, so the step runs on a macOS shell: elsewhere Alt+digit starts an Alt code. + // Option-8 types `[` on a Turkish Mac keyboard, so the step runs on a macOS shell. let mac = crate::testing::ui_context(); craft::ui::testing::windows::set_os(&mac, craft::host::target::Os::Mac); key_frame(&mut app, &mac, vec![]); diff --git a/crates/ui-egui/src/tests/nativemenu.rs b/crates/ui-egui/src/tests/nativemenu.rs index f1f6bcd09c..1fad419639 100644 --- a/crates/ui-egui/src/tests/nativemenu.rs +++ b/crates/ui-egui/src/tests/nativemenu.rs @@ -355,10 +355,11 @@ fn a_control_port_cancel_of_a_dialog_preview_reads_the_menus() { } /// OK applies the rotation a dialog previews as one undo step: the menus are read then, with Undo -/// naming it, and not for the angles previewed before. +/// naming it, and not for the angles previewed before. Once the dialog's angle field no longer takes +/// the keys, the menus are sent once more without the text-editing gate. #[test] fn applying_a_dialog_preview_reads_the_menus() { - let (m, (read, synced, closed, after)) = undisturbed(|m| { + let (m, (read, synced, applied, closed, after)) = undisturbed(|m| { m.rotate_preview(); let read = m.angles(4); let synced = m.fake.synced(); @@ -367,12 +368,21 @@ fn applying_a_dialog_preview_reads_the_menus() { // gone two frames later. m.frame(vec![]); m.frame(vec![]); + let applied = m.fake.synced(); + // The frame after the field gives up the keys sets the gate. + for _ in 0..4 { + if !m.ctx.egui_wants_keyboard_input() { + break; + } + m.frame(vec![]); + } m.frame(vec![]); - (read, synced, !m.app.session.in_interaction() && !m.app.any_dialog_open(), m.fake.synced()) + (read, synced, applied, !m.app.session.in_interaction() && !m.app.any_dialog_open(), m.fake.synced()) }); assert_eq!(read, 0, "the menus weren't read while the dialog previewed the angles"); assert!(closed); - assert_eq!(after, synced + 1, "the menus were read"); + assert_eq!(applied, synced + 1, "the menus were read"); + assert_eq!(after, synced + 2, "and sent once more when the gate changed"); assert_eq!(find(&m.fake.last(), "edit.undo").label, "Undo Rotate"); } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index f4f02f8627..784e108d8f 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "186a229c8da8db5916f8a863dfd894f1879af735"; +const REV: &str = "1ccea91875c30b091aa6e24d36b6906a9414815d"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV),