diff --git a/crates/ui-patterns/src/patterns/form_dialogs/dialog.rs b/crates/ui-patterns/src/patterns/form_dialogs/dialog.rs index 3ea9c5279..dcad21a13 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/dialog.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/dialog.rs @@ -522,7 +522,7 @@ impl<'a> ParamDialog<'a> { // The footer rows' buttons follow the extra buttons. A button's label cannot change inside the pass that // draws it, so it shows the state the previous pass left. let footer_rows: Vec<&Param> = params.iter().filter(|param| param.footer_on().is_some()).collect(); - let footer_id = egui::Id::new(("paramDialog.footer", key.as_str())); + let footer_id = egui::Id::unique(("paramDialog.footer", key.as_str())); let flip_id = footer_id.with("flip"); let footer_states: Vec = if footer_rows.is_empty() { Vec::new() } else { ui.data(|data| data.get_temp(footer_id)).unwrap_or_default() }; let footer_buttons = footer_rows.iter().enumerate().map(|(at, param)| { diff --git a/crates/ui-patterns/src/patterns/form_dialogs/param.rs b/crates/ui-patterns/src/patterns/form_dialogs/param.rs index 24616815f..1afac04ee 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/param.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/param.rs @@ -584,11 +584,6 @@ impl RowOptions { self.resettable } - /// The label a footer row shows while on; `Some` for a row drawn in the footer. - pub(crate) fn footer_on(&self) -> Option<&Label> { - self.footer_on.as_ref() - } - /// The lengths a number row keeps and shows. pub(crate) fn length(&self) -> Option { self.length @@ -994,7 +989,7 @@ impl Param { /// The row is shown only while `fields[key]` equals `value`, as [`enabled_when`](Param::enabled_when) enables it; /// otherwise it takes no space. Its value stays in the fields and in the result. #[must_use] - pub fn visible_when(mut self, key: impl Into, value: impl Into) -> Self { + pub fn visible_when(self, key: impl Into, value: impl Into) -> Self { self.visible_when_in(key, [value]) } diff --git a/crates/ui-patterns/tests/it/form_dialogs/list_manager.rs b/crates/ui-patterns/tests/it/form_dialogs/list_manager.rs index d1e037947..5e7d51c7e 100644 --- a/crates/ui-patterns/tests/it/form_dialogs/list_manager.rs +++ b/crates/ui-patterns/tests/it/form_dialogs/list_manager.rs @@ -1,7 +1,8 @@ //! `ListManager`'s in-place rename: a commit is a choice, Escape and an entry of another kind are not. use craft_ui::contract::Bind; -use craft_ui::patterns::form_dialogs::{ActionEnabled, ListManager, ListManagerAction, ListManagerChoice, ListManagerEntry}; +use craft_ui::patterns::form_dialogs::{ListManager, ListManagerAction, ListManagerChoice, ListManagerEntry, ListManagerWords}; +use craft_ui::runtime::env::Env; use craft_ui::testing::{Fixture, trial}; use egui::{Key, Modifiers, Vec2}; use std::cell::{Cell, RefCell}; @@ -19,7 +20,7 @@ fn a_committed_rename_reports_entry_and_name_and_escape_keeps_it() { let (held, seen, ended) = (Rc::clone(&rows), Rc::clone(&choices), Rc::clone(&closed)); let mut fixture = Fixture::new(move |ui| { let entries = held.borrow().clone(); - let actions = vec![ListManagerAction::new("run", "Run", ActionEnabled::OnEntry { kind: None })]; + let actions = vec![ListManagerAction::run(&Env::of(ui).words::())]; let out = ListManager::new("Macros", "Macro name:", entries, actions).renames(1).opened(Bind::given(true)).show(ui); ended.set(ended.get() || out.closed.is_some()); if let Some(choice) = out.choice { diff --git a/crates/ui-patterns/tests/it/form_dialogs/pdf_export.rs b/crates/ui-patterns/tests/it/form_dialogs/pdf_export.rs index 9896faaff..58bfd1bad 100644 --- a/crates/ui-patterns/tests/it/form_dialogs/pdf_export.rs +++ b/crates/ui-patterns/tests/it/form_dialogs/pdf_export.rs @@ -1,6 +1,6 @@ //! The hosted Save PDF dialog on a `DialogHost`: the fields automation lists and sets, Alt-Reset, and the Summary text. -use craft_pdf::settings::{Choice, Compatibility, PdfPreset, PdfSettings, Standard}; +use craft_pdf::settings::{Compatibility, PdfPreset, PdfSettings, Standard}; use craft_ui::dialog::{DialogHost, DialogId}; use craft_ui::patterns::form_dialogs::{HostedPdfExport, PdfExportWords, summary_text}; use craft_ui::runtime::env::Env;