mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Wire settings buttons into the Image Processor menu form
This commit is contained in:
1 parent
e399a61719
commit
ddff72c405
2 files changed
+7
-7
No files matched your search
@@ -519,9 +519,6 @@ fn builder(
|
||||
dialog = dialog
|
||||
.extra_buttons(vec![("load".to_owned(), Label::from(tl!("Load…").to_string())), ("save".to_owned(), Label::from(tl!("Save…").to_string()))]);
|
||||
}
|
||||
if key == crate::dialogs::image_processor_ui::COMMAND {
|
||||
dialog = crate::dialogs::image_processor_ui::settings_footer(dialog);
|
||||
}
|
||||
dialog
|
||||
}
|
||||
}
|
||||
@@ -539,9 +536,6 @@ pub fn open(app: &mut PhotocraftApp, command: &str) -> Result<DialogId, String>
|
||||
if command == MATCH_COLOR {
|
||||
reconcile_match_color(app);
|
||||
}
|
||||
if command == crate::dialogs::image_processor_ui::COMMAND {
|
||||
crate::dialogs::image_processor_ui::settings_opened(app.ctx());
|
||||
}
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use super::dispatch::no_params;
|
||||
use super::{PhotocraftApp, Value, json};
|
||||
use crate::dialogs::image_processor_ui;
|
||||
use craft::ui::choice::Checkbox;
|
||||
use craft::ui::contract::{Bind, Outcome as _, Props as _, Show as _};
|
||||
use craft::ui::dialog::DialogId;
|
||||
@@ -49,8 +50,13 @@ fn opened(id: DialogId) -> Value {
|
||||
fn open_form(app: &mut PhotocraftApp, id: &str, title: &str, params: Vec<Param>, fields: DialogFields, fixed: Value) -> DialogId {
|
||||
let title = crate::dialogs::filter_dialog::title_of(title);
|
||||
let key = id.to_owned();
|
||||
let image_processor = id == image_processor_ui::COMMAND;
|
||||
if image_processor {
|
||||
image_processor_ui::settings_opened(app.ctx());
|
||||
}
|
||||
crate::dialogs::params::open_param(app, id, fields, fixed, move |fields: &mut DialogFields| {
|
||||
ParamDialog::command(key.clone(), title.clone(), params.clone()).values(Bind::bound(fields))
|
||||
let dialog = ParamDialog::command(key.clone(), title.clone(), params.clone()).values(Bind::bound(fields));
|
||||
if image_processor { image_processor_ui::settings_footer(dialog) } else { dialog }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user