Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Merge remote-tracking branch 'upstream/main' into keymap-adoption

aiongg1a52593d0d96
diff --cc Cargo.lock
index 0479123c2,d3b7833ae..3fd142cb4
--- a/Cargo.lock
+++ b/Cargo.lock
@@@ -950,7 -992,7 +992,7 @@@ dependencies =
[[package]]
name = "craft-atomic"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"rustix 1.1.5",
]
@@@ -958,7 -1000,7 +1000,7 @@@
[[package]]
name = "craft-cms"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"rayon",
]
@@@ -966,22 -1008,12 +1008,22 @@@
[[package]]
name = "craft-docpath"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
+
+[[package]]
+name = "craft-keymap"
+version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
+dependencies = [
+ "egui",
+ "serde",
+ "serde_json",
+]
[[package]]
name = "craft-pdf"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"bytemuck",
"hayro",
@@@ -994,7 -1026,7 +1036,7 @@@
[[package]]
name = "craft-print"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"craft-winprint-gdi",
"miniz_oxide 0.8.9",
@@@ -1007,7 -1039,7 +1049,7 @@@
[[package]]
name = "craft-ui"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"egui",
"log",
@@@ -1020,10 -1077,10 +1087,10 @@@ dependencies =
[[package]]
name = "craft-window"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"egui",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"wayland-client",
]
@@@ -1455,8 -1519,8 +1529,9 @@@ dependencies =
name = "designcraft-ui-egui"
version = "0.13.0"
dependencies = [
+ "craft-keymap",
"craft-ui",
+ "craft-update",
"craft-window",
"designcraft-color",
"designcraft-compose",
@@@ -2482,7 -2546,7 +2557,7 @@@ dependencies =
[[package]]
name = "hayro"
version = "0.7.1"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"bytemuck",
"hayro-interpret",
@@@ -2502,7 -2566,7 +2577,7 @@@ checksum = "9f4d0e94ddd48749f06bbe4e538
[[package]]
name = "hayro-cmap"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"brotli",
"hayro-postscript",
@@@ -2511,7 -2575,7 +2586,7 @@@
[[package]]
name = "hayro-interpret"
version = "0.7.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@@ -2529,7 -2593,7 +2604,7 @@@
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@@ -2547,12 -2611,12 +2622,12 @@@ dependencies =
[[package]]
name = "hayro-postscript"
version = "0.1.0"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"flate2",
"hayro-ccitt",
@@@ -3053,7 -3117,7 +3128,7 @@@ dependencies =
[[package]]
name = "krilla"
version = "0.8.2"
- source = "git+https://github.com/storytold/craft-libs?rev=e3b9e239c52c14677be462e94d8920ea243de4f3#e3b9e239c52c14677be462e94d8920ea243de4f3"
-source = "git+https://github.com/storytold/craft-libs?rev=a0916808f7d78bed8c7b90cdf937176015454a7f#a0916808f7d78bed8c7b90cdf937176015454a7f"
++source = "git+https://github.com/storytold/craft-libs?rev=495e5971bc024aa96e6ed318cb6e7cd3a0103184#495e5971bc024aa96e6ed318cb6e7cd3a0103184"
dependencies = [
"base64 0.22.1",
"bumpalo",
diff --cc Cargo.toml
index b1109a31d,ff5fbf4ac..680c8c28d
--- a/Cargo.toml
+++ b/Cargo.toml
@@@ -12,9 -12,8 +12,10 @@@ repository = "https://github.com/storyt
[workspace.dependencies]
# Shared reader and writer; publish the immutable revision before this consumer.
- craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.1.0", default-features = false }
-craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.1.0", default-features = false }
++craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.1.0", default-features = false }
+# Shared keyboard bindings: chords, overrides, conflicts, egui dispatch.
- craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.1.0", features = ["egui"] }
++craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.1.0", features = ["egui"] }
+ craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", features = ["egui"] }
# internal
designcraft-geom = { path = "crates/geom" }
designcraft-color = { path = "crates/color" }
@@@ -77,20 -76,20 +78,20 @@@ zip = { version = "3", default-feature
indd = { git = "https://github.com/storytold/indd-utils", branch = "main" }
# Which paths stored in documents may be followed (craft-libs).
- craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3" }
-craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f" }
++craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184" }
# Atomic file replacement for saves and exports (craft-libs).
- craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3" }
-craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f" }
++craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184" }
# File › Print through the system print spooler (craft-libs).
- craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3" }
-craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f" }
++craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184" }
# ICC colour management: working spaces, transforms, black point compensation (craft-libs).
- craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3" }
-craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f" }
++craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184" }
# ui
# Shared frontend components; keep this dependency above the engine boundary.
- craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", features = ["serde"] }
-craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", features = ["serde"] }
++craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", features = ["serde"] }
# The application bar as the window's title bar (craft-libs).
- craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", features = ["egui"] }
-craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", features = ["egui"] }
++craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", features = ["egui"] }
egui = "0.37"
egui_extras = { version = "0.37", default-features = false, features = ["svg"] }
eframe = { version = "0.37", default-features = false }
@@@ -128,14 -127,14 +129,14 @@@ debug =
# Opt-in cancelable macOS termination on the pinned winit 0.30 line.
[patch.crates-io]
- krilla = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.8.2" }
-krilla = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.8.2" }
++krilla = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.8.2" }
winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
- hayro = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.7.1" }
- hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.7.0" }
- hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.7.2" }
- hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.3.0" }
- hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.1.0" }
- hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "e3b9e239c52c14677be462e94d8920ea243de4f3", version = "=0.1.0" }
-hayro = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.7.1" }
-hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.7.0" }
-hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.7.2" }
-hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.3.0" }
-hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.1.0" }
-hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "a0916808f7d78bed8c7b90cdf937176015454a7f", version = "=0.1.0" }
++hayro = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.7.1" }
++hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.7.0" }
++hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.7.2" }
++hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.3.0" }
++hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.1.0" }
++hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "495e5971bc024aa96e6ed318cb6e7cd3a0103184", version = "=0.1.0" }
ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
diff --cc crates/ui-egui/src/lib.rs
index f93948cd5,0117a67b4..748af2e25
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@@ -1432,29 -1461,8 +1480,10 @@@ impl DesignApp
if self.egui_ctx.is_none() {
self.egui_ctx = Some(ctx.clone());
}
+ keys::note_platform(ctx);
+ self.sync_keymap();
self.window_maximized = ctx.input(|i| i.viewport().maximized.unwrap_or(false));
- if !self.color_applied {
- self.color_applied = true;
- for path in self.ui.color_profiles.clone() {
- if let Err(e) = self.session.execute("color.loadProfile", &json!({"path": path})) {
- log::warn!("Color Settings: {e}");
- self.status_error("Color Settings", e);
- }
- }
- if let Some(cs) = self.ui.color_settings.clone() {
- let known = cs.with_known_profiles();
- for (saved, used) in [(&cs.rgb, &known.rgb), (&cs.cmyk, &known.cmyk)] {
- if saved != used {
- let e = format!("saved profile {saved} is not available; using {used}");
- log::warn!("Color Settings: {e}");
- self.status_error("Color Settings", e);
- }
- }
- let _ = designcraft_color::cms::set_active(&known);
- }
- }
+ self.apply_saved_color_settings();
let scale = self.ui.ui_scale.clamp(0.5, 3.0);
if (ctx.zoom_factor() - scale).abs() > 1e-3 {
ctx.set_zoom_factor(scale);
diff --cc docs/pdf-backend.md
index c6e65754e,eb32303a9..0bcd7992c
--- a/docs/pdf-backend.md
+++ b/docs/pdf-backend.md
@@@ -1,7 -1,7 +1,7 @@@
# Shared PDF backend
DesignCraft pins `craft-pdf`, patched Krilla 0.8.2 and the six Hayro reader crates (with
- `hayro-cmap` and `hayro-postscript`) to craft-libs revision `e3b9e239c52c14677be462e94d8920ea243de4f3`. `craft-ui`,
-`hayro-cmap` and `hayro-postscript`) to craft-libs revision `a0916808f7d78bed8c7b90cdf937176015454a7f`. `craft-ui`,
++`hayro-cmap` and `hayro-postscript`) to craft-libs revision `495e5971bc024aa96e6ed318cb6e7cd3a0103184`. `craft-ui`,
`craft-print` and the other craft-libs crates are pinned to the same revision. The reader migration is reviewed on top of the separate writer change.
## Writing
diff --cc xtask/src/pdf_deps.rs
index dc1211888,e7caa5d53..c222bbe10
--- a/xtask/src/pdf_deps.rs
+++ b/xtask/src/pdf_deps.rs
@@@ -4,7 -4,7 +4,7 @@@ use std::process::Command
use serde_json::Value;
- const REV: &str = "e3b9e239c52c14677be462e94d8920ea243de4f3";
-const REV: &str = "a0916808f7d78bed8c7b90cdf937176015454a7f";
++const REV: &str = "495e5971bc024aa96e6ed318cb6e7cd3a0103184";
const PACKAGES: &[(&str, &str)] = &[
("craft-pdf", "0.1.0"),
("krilla", "0.8.2"),