Skip to content

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

Merge PR #1389: Properties: the arrow beside Opacity opens a slider, as in the reference app

aionggde4020ea35f5
diff --cc ROADMAP.md
index 8ca7dbdf6,38216c1cf..9bdfcba21
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@@ -455,9 -443,7 +455,10 @@@ Newest first
- **2026-10-16** · Lock Guides and Lock Column Guides are commands in View ▸ Grids & Guides (`view.lockGuides`, ⌥⌘;, and `view.lockColumnGuides`), so the control channel and MCP reach them. Lock Column Guides is an undo step, is saved with the document, on in new ones, and read from and written to IDML's `ColumnGuideLocked`, which export always wrote as locked (#1096). No readiness percentage change.
- **2026-10-16** · IDML: a page keeps column guides that were dragged off centre (InDesign's Custom columns). They were divided evenly on import, so the gutter sprang back to the middle; the imported positions now place the columns, with the canvas guides, snapping and text placement following them, and they are written back on export. Layout › Margins and Columns re-divides them evenly when the count or gutter changes, as InDesign's does. No readiness percentage change.
- **2026-10-16** · IDML: custom column positions are checked before they are used (#1096). A set must give two edges per column, ascending from the left margin to the right one; any other (a wrong count, unsorted or non-numeric values, a list longer than 216 columns allow, or positions left behind by a margin or page-size change) is the even split, in the canvas, on import and on export, instead of columns drawn outside the margins. No readiness percentage change.
+- **2026-10-21** · Effects dialog: the Angle field of the shadows, Bevel and Emboss, Satin and Gradient Feather has InDesign's dial beside it, its radius pointing where the light comes from; a click or drag on it sets the angle. Found in the Learn Skills Daily course, chapter 14. No readiness percentage change.
+- **2026-10-21** · A double-click on a Fill or Stroke chip of Properties › Appearance opens the Color Picker with its colour, as in InDesign (a click still opens the swatches); for selected text, its own chips open it for the text. Found in the Learn Skills Daily course, chapter 23. No readiness percentage change.
+- **2026-10-20** · Properties › Appearance: with several text frames selected, the Fill and Stroke popups offer Apply To Frame or Text, as with one frame, so their text can be coloured at once, as in InDesign. No readiness percentage change.
+ - **2026-10-20** · Properties › Appearance: the arrow beside Opacity opens a slider under the field, as in InDesign, instead of the Effects panel; a drag shows the opacity live and is one undo step (the Opacity link still opens Effects). No readiness percentage change.
- **2026-10-21** · Properties › Character and Paragraph: ••• (More Options) expands the section in place, as InDesign's: Character adds vertical and horizontal scale, baseline shift, skew, language and OpenType, and All Caps, Small Caps, Superscript, Subscript, Underline and Strikethrough; Paragraph adds the left, right, first line and last line indents, space before and after, the drop cap's lines and characters, Align to Baseline Grid and Hyphenate. It used to open the Character or Paragraph panel; the language field moved under ••• as in InDesign. Found in the Learn Skills Daily course, chapter 16. No readiness percentage change.
- **2026-10-21** · The text Control panel has InDesign's two modes: A (Character Formatting Controls: font and style, size and leading, All Caps/Superscript/Underline and Small Caps/Subscript/Strikethrough, kerning and tracking, vertical and horizontal scale, baseline shift and skew, character style and language) and ¶ (Paragraph Formatting Controls: the nine alignments, left/first line and right/last line indents, space before and after, the drop cap's lines and characters, paragraph style, Hyphenate and Align to Baseline Grid). It used to show a fixed mix of both. Found in the Learn Skills Daily course, chapter 16. No readiness percentage change.
- **2026-10-20** · With the Type tool, the Control panel's font size, leading and tracking fields have a spinner and a list of common values, as in InDesign (auto leading in parentheses). No readiness percentage change.
diff --cc crates/ui-egui/src/panels/properties/object.rs
index 3b51ccca1,36a9fecaa..1da98d069
--- a/crates/ui-egui/src/panels/properties/object.rs
+++ b/crates/ui-egui/src/panels/properties/object.rs
@@@ -380,14 -369,46 +379,54 @@@ pub(super) fn appearance_section(app: &
});
}
+/// The Color Picker for a Fill or Stroke chip (a double-click on it, as in InDesign), with the
+/// chip's colour: the objects', or with `text` the selected text's.
+pub(super) fn open_color_picker(app: &mut DesignApp, doc: &designcraft_doc::Document, swatch: &str, stroke: bool, text: bool) {
+ let mut fields = crate::panels::swatches::picker_fields(doc.resolve_color(swatch, 1.0), stroke);
+ fields["text"] = json!(text);
+ app.ui.dialog = Some(crate::dialogs::Dialog::new("colorPicker", fields));
+}
+
+ /// The Opacity slider that the arrow beside the field opens, as in InDesign: a drag shows the
+ /// new opacity live and is one undo step when let go.
+ fn opacity_slider(app: &mut DesignApp, resp: &egui::Response, opacity: f64) {
+ let (mut slid, mut held, mut shown) = (None, false, false);
+ egui::Popup::menu(resp).close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside).show(|ui| {
+ shown = true;
+ // A thin rail and a round knob, as InDesign draws it.
+ ui.spacing_mut().slider_width = 130.0;
+ ui.spacing_mut().slider_rail_height = 2.0;
+ let mut v = (opacity * 100.0).round();
+ let slider = ui.add(
+ egui::Slider::new(&mut v, 0.0..=100.0).integer().show_value(false).handle_shape(egui::style::HandleShape::Circle).trailing_fill(false),
+ );
+ // The slider has no visible caption (the field beside the arrow is the label), so it's
+ // named for assistive technology only.
+ let label = crate::i18n::tr(&app.ui.language, "Opacity");
+ slider.widget_info(|| egui::WidgetInfo::slider(ui.is_enabled(), v, label));
+ // The release frame can move the value too; it stays part of the drag's preview, which
+ // the next frame commits as the one undo step.
+ let pressed = slider.is_pointer_button_down_on() || slider.dragged() || slider.drag_stopped();
+ if slider.changed() {
+ slid = Some((v, pressed));
+ }
+ held = pressed;
+ });
+ match slid {
+ Some((v, true)) => app.live_preview("Opacity", "object.opacity", json!({"opacity": v / 100.0})),
+ Some((v, false)) => {
+ // The keyboard (arrow keys on the focused slider): applied at once.
+ app.end_live_preview();
+ let _ = app.run("object.opacity", json!({"opacity": v / 100.0}));
+ }
+ None if held => app.hold_live_preview(),
+ // Shown but let go without a change (a click outside, Escape): the drag's preview is
+ // committed now, before whatever that click does, so that keeps its own undo step.
+ None if shown => app.end_live_preview(),
+ None => {}
+ }
+ }
+
/// The Fill (or Stroke) popup of Properties › Appearance, as InDesign's: Apply To (a text frame's
/// frame or its text), the tint, then the swatches. `cur` is the frame's swatch. With `text_only`
/// (text selected) it colours the selected text.