From 37fb9b92b6fe67cef69677c5e49da244b1ec2da1 Mon Sep 17 00:00:00 2001 From: rmsff <17902130+rmsff@users.noreply.github.com> Date: Fri, 27 Nov 2026 16:22:23 +0300 Subject: [PATCH] Contact Sheet II: footer buttons as FooterButton after the craft-libs move craft-libs a46af76 on main takes ParamDialog::extra_buttons as FooterButton. --- .../src/dialogs/contact_sheet_settings_file_tests.rs | 2 +- crates/ui-egui/src/dialogs/contact_sheet_ui.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/contact_sheet_settings_file_tests.rs b/crates/ui-egui/src/dialogs/contact_sheet_settings_file_tests.rs index ff0b2330a84..319e54f2d24 100644 --- a/crates/ui-egui/src/dialogs/contact_sheet_settings_file_tests.rs +++ b/crates/ui-egui/src/dialogs/contact_sheet_settings_file_tests.rs @@ -301,7 +301,7 @@ fn alerts(h: &H) -> Vec { #[test] fn the_dialog_has_load_save_and_reset_buttons() { - let labels: Vec = super::super::footer_buttons().into_iter().map(|(id, label)| format!("{id}:{}", label.as_str())).collect(); + let labels: Vec = super::super::footer_buttons().into_iter().map(|(id, button)| format!("{id}:{}", button.label().as_str())).collect(); assert_eq!(labels, ["load:Load…", "save:Save…", "reset:Reset…"]); let (h, _) = opened(); for label in ["Load…", "Save…", "Reset…"] { diff --git a/crates/ui-egui/src/dialogs/contact_sheet_ui.rs b/crates/ui-egui/src/dialogs/contact_sheet_ui.rs index 980a23e696a..9d80b7639d9 100644 --- a/crates/ui-egui/src/dialogs/contact_sheet_ui.rs +++ b/crates/ui-egui/src/dialogs/contact_sheet_ui.rs @@ -11,6 +11,7 @@ use craft::ui::dialog::{DialogId, PromptAnswer, PromptChoice, StandardPrompt}; use craft::ui::patterns::form_dialogs::{CustomContext, DialogFields, FieldValue, HostedParamDialog, NumberUnit, Param, ParamKind, ParamResult}; use craft::ui::runtime::env::{Label, UnitKind}; use craft::ui::runtime::requests::PathKind; +use craft::ui::sections::{DialogRole, FooterButton}; use photocraft_engine::prefs::Unit; use serde_json::{Map, Value, json}; @@ -163,8 +164,10 @@ pub(crate) fn command_params(map: &mut Map) { mod settings_file; /// The footer buttons after OK and Cancel, as `(action, label)`. -pub(crate) fn footer_buttons() -> Vec<(String, Label)> { - [("load", tl!("Load…")), ("save", tl!("Save…")), ("reset", tl!("Reset…"))].map(|(id, label)| (id.to_owned(), Label::from(label))).into() +pub(crate) fn footer_buttons() -> Vec<(String, FooterButton)> { + [("load", tl!("Load…")), ("save", tl!("Save…")), ("reset", tl!("Reset…"))] + .map(|(id, label)| (id.to_owned(), FooterButton::new(label, DialogRole::Other))) + .into() } /// Every open of the dialog has the same id, so Load…'s pick and Reset…'s question, answered after the dialog closed,