Skip to content

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

Merge PR #1753

Brandon Thomas2a5fae54b01f
diff --cc crates/ui-egui/src/panels/edit.rs
index 3c11cce33,67fd96021..d67f35cc4
--- a/crates/ui-egui/src/panels/edit.rs
+++ b/crates/ui-egui/src/panels/edit.rs
@@@ -1789,18 -1683,15 +1791,27 @@@ fn quick_develop(app: &mut LightcraftAp
});
}
+/// The preview-only notice's Reload from Disk: re-read the photo's file (a raw a newer version can
+/// decode, whose drive was offline when the library opened), and say what came of it.
+pub(crate) fn reload_preview_only(app: &mut LightcraftApp, ctx: &egui::Context, id: PhotoId) {
+ let r = app.run("photo.reload", json!({"ids": [id.0]}));
+ let decoded = app.session.catalog.photo(id).is_some_and(|p| p.preview_only.is_none());
+ match r {
+ Err(e) => app.toast_error(ctx, e),
+ Ok(_) if decoded => app.toast(ctx, crate::i18n::tr("This raw is now developed from its raw data")),
+ Ok(_) => app.toast(ctx, crate::i18n::tr("This raw variant still can't be decoded")),
+ }
+}
+
+ /// The Reset button's tooltip with the reset shortcut as this platform writes it (issue #1751).
+ fn reset_tip(keymap: &crate::shortcuts::Keymap, mac: bool) -> String {
+ let base = crate::i18n::tr("Reset all edits");
+ match crate::shortcuts::shortcut_of(keymap, "develop.reset") {
+ Some(sc) => format!("{base} ({})", crate::menubar::shortcut_text(sc, mac)),
+ None => base.to_string(),
+ }
+ }
+
#[cfg(test)]
mod curve_histogram_tests {
use super::*;