Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Merge commit 'refs/check/bf2856-main' into resume-2856

dotCooCoofed2423f2c7a
diff --cc crates/ui-egui/src/menus/run.rs
index 6214c4b56,c88a50207..e08cd377f
--- a/crates/ui-egui/src/menus/run.rs
+++ b/crates/ui-egui/src/menus/run.rs
@@@ -203,27 -222,10 +222,27 @@@ fn ui_commands_1(app: &mut LightcraftAp
app.ui.view = ViewMode::PhotoGrid;
}
if let Some(k) = app.ui.keyword_painter.clone() {
+ app.ui.keyword_painter_text = k.clone();
- app.toast(&ctx, crate::i18n::tr_format!("Painting “{k}”: click photos to add or remove it · Esc stops", k = k));
+ app.toast(ctx, crate::i18n::tr_format!("Painting “{k}”: click photos to add or remove it · Esc stops", k = k));
}
Ok(json!({"keyword": app.ui.keyword_painter}))
}
+ "tool.enablePainting" => {
+ let k = app.ui.keyword_painter_text.trim().to_string();
+ if app.ui.keyword_painter.is_some() {
+ app.ui.keyword_painter = None;
+ Ok(json!({"keyword": null}))
+ } else if k.is_empty() {
+ app.ui.right = RightPanel::Keywords;
+ if app.ui.section_folded("keywording") {
+ app.ui.toggle_folded("keywording");
+ }
- app.toast(&ctx, crate::i18n::tr("Type a keyword to paint in the Keywords panel"));
++ app.toast(ctx, crate::i18n::tr("Type a keyword to paint in the Keywords panel"));
+ Ok(json!({"keyword": null}))
+ } else {
+ run_ui_command(app, "tool.keywordPainter", &json!({"keyword": k})).unwrap_or(Ok(Value::Null))
+ }
+ }
"view.secondWindow" => {
app.ui.second_window = p.get("show").and_then(Value::as_bool).unwrap_or(!app.ui.second_window);
Ok(json!({"show": app.ui.second_window}))