diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index f2444bc019..05d3676e2f 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1256,7 +1256,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.layerOptions", "Options for Selection…", "", - "{ids?|id?} open Layer Options for Layers panel rows (default: the highlighted rows, else the current layer), filled in from the first: dialog `layerOptions`, fields name, color (a preset name such as \"Light Blue\" or #rrggbb), template, locked, visible, printable, preview, dimImages (bool), dimPercent (0–100); an object's row has name, visible and locked. OK runs layer.setProps (one undo step); for several rows it sends only the fields set in the dialog", + "{ids?|id?} open Layer Options for Layers panel rows (default: the highlighted rows, else the current layer), filled in from the first: dialog `layerOptions`, fields name, color (a preset name such as \"Light Blue\" or #rrggbb), template, locked, visible, printable, preview, dimImages (bool), dimPercent (0–100); an object's row has name, visible and locked. Unchanged OK adds no undo step; edits run layer.setProps in one undo step. Existing names are preserved unless Name is edited or explicitly set; for several rows it sends only the fields set in the dialog", ), ( "ui.layerDelete", diff --git a/crates/ui-egui/src/dialogs/layer_options.rs b/crates/ui-egui/src/dialogs/layer_options.rs index c25df0cf41..fb0ad99911 100644 --- a/crates/ui-egui/src/dialogs/layer_options.rs +++ b/crates/ui-egui/src/dialogs/layer_options.rs @@ -7,6 +7,7 @@ //! `#rrggbb`), `template`, `locked`, `visible`, `printable`, `preview`, `dimImages` and //! `dimPercent`. OK runs `layer.setProps`, `layer.new` or `layer.newSublayer`. For several rows //! the dialog shows the first row's settings, and OK sends only the ones set in the dialog. +//! Existing rows keep their stored names unless Name is edited; unchanged approval adds no Undo step. use std::cell::RefCell; @@ -327,7 +328,9 @@ fn flag_row(ui: &mut egui::Ui, v: &mut LayerOptionsValue, key: &'static str, tex fn body(ui: &mut egui::Ui, v: &mut LayerOptionsValue, requested: &RefCell>) { if v.shows("name") { Field::new(tl!("Name:")).id_salt("name").show(ui, |ui, _| { - TextField::new(tl!("Name:"), Bind::bound(&mut v.name)).show(ui); + if TextField::new(tl!("Name:"), Bind::bound(&mut v.name)).show(ui).value().is_some() { + v.mark("name"); + } }); } if v.layer { @@ -379,7 +382,7 @@ fn body(ui: &mut egui::Ui, v: &mut LayerOptionsValue, requested: &RefCell