Skip to content

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

Integration: #1503 keep #1080's tests; roadmap log lines for #1080 and #1503

aionggf816c3b67334
diff --git a/ROADMAP.md b/ROADMAP.md
index 52bfb0f3b..8b49d2dd1 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -382,6 +382,8 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.m
## Progress log
+- **2026-10-30** · The Color Picker takes an eyedropper: dragged from the picker onto the page, it takes the colour the canvas shows (proofed under Proof Colors). No readiness percentage change.
+- **2026-10-30** · The Color Picker is laid out as the reference app's: a field and slider for the component chosen, HSB, Lab, RGB and CMYK values, the old colour, and Add CMYK Swatch; Enter and Esc close it once. No readiness percentage change.
- **2026-10-18** · Table of Contents gains Create PDF Bookmarks: included headings become nested page destinations, regenerated in their existing outline position on update without replacing or moving surrounding manual bookmarks. The setting survives native and IDML files. No readiness percentage change.
Newest first.
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index 55d88dced..78777fd45 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -8521,9 +8521,12 @@ fn color_picker(app: &mut DesignApp, ui: &mut egui::Ui, d: &mut Dialog) {
}
if p != before {
store_picked(d, &p);
- if let Some(c) = exact_cmyk {
- d.fields.insert("cmyk".into(), json!(c));
- }
+ }
+ // Typed C/M/Y/K are kept as typed, even when the colour shown stays the same (at 100% K, a
+ // device conversion is black whatever C, M and Y are).
+ if let Some(c) = exact_cmyk {
+ d.fields.insert("cmyk".into(), json!(c));
+ d.fields.insert("edited".into(), json!(true));
}
}
@@ -8911,7 +8914,8 @@ mod picker_layout {
pub const RIGHT: f32 = 457.0;
}
-/// A value field: the text typed stays while it has the focus; a number that parses applies.
+/// A value field, named `name` (its caption): the text typed stays while it has the focus; a
+/// number that parses applies.
fn picker_field(ui: &mut egui::Ui, d: &mut Dialog, r: egui::Rect, key: &str, name: &str, value: f32, range: (f32, f32)) -> Option<f32> {
let id = egui::Id::unique(("color_picker_field", key));
let editing = ui.memory(|m| m.has_focus(id));
diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs
index 89e4830b5..6733e9a79 100644
--- a/crates/ui-egui/src/dialogs/tests.rs
+++ b/crates/ui-egui/src/dialogs/tests.rs
@@ -3485,10 +3485,6 @@ fn guide_counts(app: &DesignApp) -> Vec<usize> {
(0..doc.page_count()).map(|abs| doc.page(abs).unwrap().guides.len()).collect()
}
-/// The Color Picker laid out as InDesign's: a field and a slider for the component whose radio
-/// is on, the new colour over the old one, and the values in every space.
-/// The course's chapter 23: the Color Picker's eyedropper, dragged from the picker onto the
-/// page and let go there, takes the colour the page shows.
/// The eyedropper takes the colour the canvas shows: with Proof Colors the proofed colour, and
/// with the ink-limit preview the warning colour over the limit.
#[test]
@@ -3531,6 +3527,8 @@ fn the_eyedropper_samples_what_proof_colors_and_the_ink_limit_show() {
assert_ne!(proofed, plain, "the proof changes this green");
}
+/// The course's chapter 23: the Color Picker's eyedropper, dragged from the picker onto the
+/// page and let go there, takes the colour the page shows.
#[test]
fn the_color_pickers_eyedropper_takes_a_colour_off_the_page() {
use egui_kittest::{Harness, kittest::Queryable};
@@ -3597,6 +3595,28 @@ fn the_color_pickers_eyedropper_takes_a_colour_off_the_page() {
assert_eq!(h.state().ui.dialog.as_ref().unwrap().s("hex"), hex, "the picker isn't sampled");
}
+/// The Color Picker laid out as InDesign's: a field and a slider for the component whose radio
+/// is on, the new colour over the old one, and the values in every space.
+#[test]
+
+fn the_color_picker_keeps_a_typed_cmyk_value_the_colour_shown_does_not_change_with() {
+ use egui_kittest::kittest::Queryable;
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.ui.dialog = Some(Dialog::new("colorPicker", json!({"target": "fill", "cmyk": [0.0, 0.0, 0.0, 100.0], "text": false})));
+ let mut h = crate::test_window::open(app, egui::vec2(1400.0, 900.0));
+ h.run_steps(3);
+ // A C typed at 100% K is kept, whether or not the colour shown changes with it.
+ let rgb = h.state().app.ui.dialog.as_ref().unwrap().fields.get("rgb").cloned();
+ h.get_by_label("C").focus();
+ h.run_steps(1);
+ h.event(egui::Event::Text("50".into()));
+ h.run_steps(2);
+ let d = h.state().app.ui.dialog.as_ref().unwrap();
+ assert_eq!(d.fields["cmyk"], json!([50.0, 0.0, 0.0, 100.0]), "rgb {:?} (was {rgb:?})", d.fields.get("rgb"));
+ assert!(d.b("edited"));
+}
+
#[test]
fn the_color_picker_picks_on_its_field_and_slider_and_adds_a_cmyk_swatch() {
use egui_kittest::kittest::Queryable;