Control bar: Select Similar Objects selects by the attribute its menu keeps

With something selected, the Control bar shows a Select Similar Objects
button and, beside it, the Select Similar Options menu. The button
selects the objects like the first selected one by the attribute kept
for the session; a menu item selects by its attribute and keeps it,
and the kept item is checked. The items are All, Fill Color, Fill &
Stroke, Stroke Color, Stroke Weight, Opacity, Blending Mode,
Appearance, Graphic Style, Shape and Symbol Instance.

- select.similar {by?} runs the select.same command of that name, or
  for "all" matches fill and stroke colors, stroke weight, opacity and
  blending mode together. An unknown by is an error that keeps the
  selection and the kept attribute. The journal records the attribute
  used, so a recorded action repeats it, and a failed script or plug-in
  call puts the kept attribute back.
- The button and menu belong to the Object Options group and sit at
  the right end of the bar, after the X, Y, W and H fields. They take
  only the room the other controls leave, so the bar leaves them out
  before any other control.
- The Paragraph tests' control_bar_node looks for a label before a
  value, so a link's text run listed first no longer stands in for
  the link.

Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-14 18:41:14 -08:00
parent dafd993395
commit f05d481247
42 changed files with 436 additions and 13 deletions
+5 -1
View File
@@ -429,7 +429,7 @@ struct World {
}
/// The choices outside the documents that a script's commands can change: the preferences, the
/// global edit options, the recent URLs, the chosen gradient stop, freeform point and appearance
/// global edit options, the Select Similar Objects attribute, the recent URLs, the chosen gradient stop, freeform point and appearance
/// item, the Eyedropper's sample, the envelope defaults and the Caps Lock state.
#[derive(Clone)]
struct Choices {
@@ -437,6 +437,7 @@ struct Choices {
caps_lock: bool,
eyedropper_sample: Option<Arc<vectorcraft_doc::Node>>,
global_edit_options: cmd::globaledit::Options,
select_similar: &'static str,
recent_urls: Vec<String>,
gradient_stop: Option<(usize, cmd::gradient::StopOwner)>,
freeform_point: Option<(usize, cmd::gradient::StopOwner)>,
@@ -451,6 +452,7 @@ impl Choices {
caps_lock: s.caps_lock,
eyedropper_sample: s.eyedropper_sample.clone(),
global_edit_options: s.global_edit_options.clone(),
select_similar: s.select_similar,
recent_urls: s.recent_urls.clone(),
gradient_stop: s.gradient_stop,
freeform_point: s.freeform_point,
@@ -464,6 +466,7 @@ impl Choices {
s.caps_lock = self.caps_lock;
s.eyedropper_sample = self.eyedropper_sample;
s.global_edit_options = self.global_edit_options;
s.select_similar = self.select_similar;
s.recent_urls = self.recent_urls;
s.gradient_stop = self.gradient_stop;
s.freeform_point = self.freeform_point;
@@ -477,6 +480,7 @@ impl Choices {
swap(&mut self.caps_lock, &mut s.caps_lock);
swap(&mut self.eyedropper_sample, &mut s.eyedropper_sample);
swap(&mut self.global_edit_options, &mut s.global_edit_options);
swap(&mut self.select_similar, &mut s.select_similar);
swap(&mut self.recent_urls, &mut s.recent_urls);
swap(&mut self.gradient_stop, &mut s.gradient_stop);
swap(&mut self.freeform_point, &mut s.freeform_point);