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