mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
M3.8: register the split paint modules next to paint so the command palette keeps listing them (Stroke Options for "stroke")
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b7969a6a5d
commit
9cabeea68b
2 files changed
+12
-5
No files matched your search
@@ -153,6 +153,13 @@ pub fn command_specs() -> &'static [CommandSpec] {
|
||||
v.extend(select::specs());
|
||||
v.extend(wand::specs());
|
||||
v.extend(paint::specs());
|
||||
// Split out of `paint` (M3.8); kept next to it so lists in registry order (the command
|
||||
// palette, `engine.commands`) show them where they always were.
|
||||
v.extend(stroke::specs());
|
||||
v.extend(appearance::specs());
|
||||
v.extend(style::specs());
|
||||
v.extend(swatch::specs());
|
||||
v.extend(gradient::specs());
|
||||
v.extend(opacitymask::specs());
|
||||
v.extend(layer::specs());
|
||||
v.extend(draw2::specs());
|
||||
@@ -184,11 +191,6 @@ pub fn command_specs() -> &'static [CommandSpec] {
|
||||
v.extend(patterncmds::specs());
|
||||
v.extend(prefscmds::specs());
|
||||
v.extend(distortcmds::specs());
|
||||
v.extend(appearance::specs());
|
||||
v.extend(gradient::specs());
|
||||
v.extend(stroke::specs());
|
||||
v.extend(style::specs());
|
||||
v.extend(swatch::specs());
|
||||
v
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,8 +48,13 @@ fn moved_commands_keep_their_ids() {
|
||||
"swatch.duplicate",
|
||||
"swatch.sortByName",
|
||||
];
|
||||
let pos = |id: &str| command_specs().iter().position(|c| c.id == id).unwrap_or_else(|| panic!("{id}"));
|
||||
let (paint_end, after_paint) = (pos("transparency.set"), pos("transparency.makeOpacityMask"));
|
||||
for id in ids {
|
||||
assert_eq!(command_specs().iter().filter(|c| c.id == id).count(), 1, "{id}");
|
||||
// Registered right after `paint` (where they lived), so the command palette, which lists
|
||||
// the first matches in registry order, still shows them (e.g. Stroke Options for "stroke").
|
||||
assert!((paint_end..after_paint).contains(&pos(id)), "{id}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user