Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

Merge pull request #907 from tylerjenningsw/enhance/toolbar-gradient-swatch

Brandon Thomase0b770a9eaa9
diff --cc crates/ui-egui/src/header.rs
index 09bc13bb1,14e676fca..fb381cfd3
--- a/crates/ui-egui/src/header.rs
+++ b/crates/ui-egui/src/header.rs
@@@ -391,10 -382,20 +410,19 @@@ fn fill_stroke_options(app: &mut Effect
if ui.input(|i| i.modifiers.alt) {
let at = PaintKind::ALL.iter().position(|k| *k == tp.kind).unwrap_or(0);
let next = PaintKind::ALL.get((at + 1) % PaintKind::ALL.len()).copied().unwrap_or_default();
- let k = format!("{key}Type");
- tool_options(app, json!({k: next.id()}));
+ paint_kind(app, shape_layers, key, next);
} else if tp.kind == PaintKind::Solid {
widgets::open_popup(ui, picker_id(key));
+ } else if let Some((layer, prop)) = matches!(tp.kind, PaintKind::Linear | PaintKind::Radial)
+ .then(|| gradient_colors(app, shape_layers, if key == "fill" { "gfill" } else { "gstroke" }))
+ .flatten()
+ {
+ let ctx = ui.ctx().clone();
+ if let Err(e) = crate::menus::invoke(app, &ctx, "prop.editGradient", json!({"layer": layer, "prop": prop})) {
+ app.ui.status = e;
+ }
} else {
+ // No selected shape layer with that gradient: its options (new shapes' kind).
widgets::open_popup(ui, opts);
}
}
diff --cc docs/gaps.md
index eb3a8c348,cbd527b88..e621ee876
--- a/docs/gaps.md
+++ b/docs/gaps.md
@@@ -141,10 -141,12 +141,15 @@@ The most important missing piece: it tu
Location keeps its selection and fields; a layer deleted while editing is reported; and
`prop.editGradient` is an error for a target that isn't a gradient. Unit tests in `keyframe`
and `gradient_editor` cover per-track sampling (no double opacity), the typed one-stop round
- trip, and stops staying in order, and selected, while they move.
+ trip, and stops staying in order, and selected, while they move. The `ui_gradient_handles`
+ tests, checked headlessly on Windows, drag a selected Gradient Fill's start and end points in
+ the Composition viewer: one undo step, the layer stays, a point inside a moved and scaled group
+ converts to the group's space, and the handles show only for a selected gradient.
+ - Regression evidence for the toolbar's gradient swatches (#612, reported on Discord): the
+ `ui_toolbar_gradient` input tests, checked headlessly on Windows, click a Linear Fill swatch and
+ a Radial Stroke swatch on a selected shape layer and get the Gradient Editor on its Gradient Fill
+ / Gradient Stroke Colors (OK saves); without such a gradient the swatch still opens the options,
+ and the words, Solid swatches and Alt-click are unchanged.
- Regression evidence for the reports of 6 October, checked headlessly on Windows: real pointer
drags in `ui_drag_drop` (Project items into the Timeline between layers and at a time, and onto
the viewer; an effect onto a layer in the viewer: #85, #88, #89), `ui_render_queue` (a template