Skip to content

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

Merge branch 'worktree-agent-ad641003294616c82'

Brandon Thomas799ecc08bc85
diff --cc crates/engine/src/library.rs
index 8b8a99824,544769db1..3ec3b58ea
--- a/crates/engine/src/library.rs
+++ b/crates/engine/src/library.rs
@@@ -103,11 -100,15 +103,16 @@@ impl Library
struct PrefsFile {
xmp: crate::sidecar::XmpPrefs,
/// Parameters of the last export (for Export with Previous).
+ #[serde(alias = "last_export")]
last_export: Option<serde_json::Value>,
+ /// Develop defaults for imported photos.
+ import: crate::import::ImportDefaults,
+ /// Thumbnail disk cache budget (MB, 0 = default).
+ cache_mb: u32,
}
-fn presets_json(presets: &[Preset]) -> String {
+fn presets_json(s: &Session) -> String {
+ let presets = &s.presets;
let f = PresetsFile {
user: presets.iter().filter(|p| !p.builtin).cloned().collect(),
favorites: presets.iter().filter(|p| p.builtin && p.favorite).map(|p| p.id.clone()).collect(),
@@@ -179,9 -177,11 +186,11 @@@ impl Session
{
self.selection = Selection::single(*first);
}
- let presets_written = presets_json(&self.presets);
+ let presets_written = presets_json(self);
+ // photo ids are per library: drop decoded sources of the previous one
+ self.media.clear_sources();
if on_disk {
- self.media.attach_disk_cache(&dir.join("thumbs"));
+ self.media.attach_disk_cache(&dir.join("thumbs"), self.cache_bytes());
}
let view_written = self.view_json();
self.library = Some(Library { dir, on_disk, journal, files, report, last_error: None, presets_written, view_written });
diff --cc crates/ui-egui/src/lib.rs
index c0ba22ecc,ca0d7085d..3718fe822
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@@ -94,9 -98,12 +98,15 @@@ pub struct LightcraftApp
pub loupe_shown: Option<(lightcraft_catalog::PhotoId, &'static str)>,
/// Photo Merge dialog previews and background merges.
pub merge: merge::MergeState,
+ /// The look the loupe shows while the pointer rests on a preset or profile (set by the
+ /// panels each frame; nothing is committed, no history entry).
+ pub hover_preview: Option<HoverPreview>,
+ /// The window is in full screen (as last reported by the host, or as last requested).
+ pub window_is_fullscreen: bool,
+ /// The GPU preference last applied (`app.gpu`), to apply Settings changes once.
+ gpu_applied: Option<bool>,
+ /// The memory budget setting last applied (MB, 0 = automatic).
+ memory_applied: Option<u32>,
}
impl LightcraftApp {
@@@ -127,7 -134,9 +137,10 @@@
gesture: None,
loupe_shown: None,
merge: merge::MergeState::default(),
+ hover_preview: None,
+ window_is_fullscreen: false,
+ gpu_applied: None,
+ memory_applied: None,
}
}
@@@ -344,8 -376,15 +380,17 @@@
return;
}
let t0 = now_ms();
+ // panels set it again this frame while the pointer rests on a preset or profile
+ self.hover_preview = None;
+ if self.ui.fullscreen {
+ // full-screen preview: the photo alone on black
+ egui::CentralPanel::default().frame(egui::Frame::NONE.fill(egui::Color32::BLACK)).show(ui, |ui| panels::detail::show(self, ui));
+ panels::dialogs::show(self, &ctx);
+ panels::toast(self, &ctx);
+ self.widgets = widgets::take_registry(&ctx);
+ self.perf.frame_ms = now_ms() - t0;
+ return;
+ }
// Order matters: earlier panels take the full edge (top bar spans the window; the tool strip,
// right panels and left panel run to the bottom; the bottom bar sits between them).
panels::topbar::show(self, ui);
diff --cc crates/ui-egui/src/menubar.rs
index e5efb5fb4,2bfeb9048..065cbb52d
--- a/crates/ui-egui/src/menubar.rs
+++ b/crates/ui-egui/src/menubar.rs
@@@ -202,8 -221,10 +221,11 @@@ pub fn checked(app: &LightcraftApp, id
"view.beforeAfterSplit" => Some(u.before_after == crate::state::BeforeAfter::Split),
"view.autoAdvance" => Some(u.auto_advance),
"view.filterBar" => Some(u.filter_bar),
+ "view.navigator" => Some(u.navigator),
+ "view.fullScreenPreview" => Some(u.fullscreen),
+ "view.enterFullScreen" => Some(app.window_is_fullscreen),
"panel.edit" => panel(RightPanel::Edit),
+ "panel.profiles" => panel(RightPanel::Profiles),
"panel.crop" => panel(RightPanel::Crop),
"panel.remove" => panel(RightPanel::Remove),
"panel.masking" => panel(RightPanel::Masking),
diff --cc crates/ui-egui/src/menus.rs
index c3c979cf6,5c9c886a1..820a838c6
--- a/crates/ui-egui/src/menus.rs
+++ b/crates/ui-egui/src/menus.rs
@@@ -38,8 -38,11 +38,12 @@@ pub const UI_COMMANDS: &[UiCommand] = &
("view.cropOverlay", "Cycle Crop Overlay", Some("Shift+O"), "View"),
("view.back", "Back to Grid", Some("Escape"), ""),
("view.filterBar", "Filter Bar", Some("Shift+F"), "View"),
+ ("view.fullScreenPreview", "Full Screen Preview", Some("F"), "View"),
+ ("view.enterFullScreen", "Enter Full Screen", Some("Cmd+Shift+F"), "View"),
+ ("view.infoOverlay", "Cycle Info Overlay", Some("Cmd+I"), "View"),
+ ("view.navigator", "Navigator", None, "View"),
("panel.edit", "Edit", Some("E"), "Window"),
+ ("panel.profiles", "Profile Browser", None, "Window"),
("panel.crop", "Crop & Rotate", Some("C"), "Window"),
("panel.remove", "Remove", Some("H"), "Window"),
("panel.masking", "Masking", Some("M"), "Window"),
diff --cc crates/ui-egui/src/panels/mod.rs
index 677870286,8b96d690e..ee238621a
--- a/crates/ui-egui/src/panels/mod.rs
+++ b/crates/ui-egui/src/panels/mod.rs
@@@ -10,8 -10,8 +10,9 @@@ pub mod grid
pub mod left;
pub mod masking;
pub mod presets;
+pub mod profiles;
pub mod right;
+ pub mod settings;
pub mod strip;
pub mod topbar;
diff --cc docs/parity.md
index f3473fbb4,8bedebf98..bd7bfb0dd
--- a/docs/parity.md
+++ b/docs/parity.md
@@@ -39,16 -39,16 +39,16 @@@ and prints the summary; `cargo xtask pa
| P. Enhance (ENH) | 0 | 0 | 2 | 0 | — | — |
| Q. HDR (HDR) | 0 | 0 | 5 | 0 | — | — |
| R. Video (VID) | 0 | 0 | 5 | 1 | — | 0/2 (0%) |
-| S. Export (EXP) | 4 | 6 | 8 | 0 | 2/7 (29%) | 2/7 (29%) |
+| S. Export (EXP) | 6 | 6 | 6 | 0 | 3/7 (43%) | 3/7 (43%) |
| T. Share (SHARE) | 0 | 0 | 0 | 4 | — | — |
| U. Map & location (MAP) | 0 | 1 | 1 | 0 | — | 0/1 (0%) |
- | V. Preferences (PREF) | 0 | 3 | 5 | 3 | 0/1 (0%) | 0/4 (0%) |
+ | V. Preferences (PREF) | 4 | 1 | 3 | 3 | 1/1 (100%) | 3/4 (75%) |
| W. Cloud & AI infrastructure (CLOUD / AI) | 0 | 1 | 1 | 2 | — | — |
-| X. Cross-cutting behaviours (BEHAV) | 10 | 2 | 5 | 1 | 7/8 (88%) | 3/5 (60%) |
+| X. Cross-cutting behaviours (BEHAV) | 10 | 3 | 4 | 1 | 7/8 (88%) | 3/5 (60%) |
- | Y. Menus | 46 | 18 | 21 | 8 | 37/47 (79%) | 7/23 (30%) |
- | Z. Keyboard shortcuts (desktop) | 46 | 16 | 18 | 1 | 39/52 (75%) | 7/23 (30%) |
+ | Y. Menus | 50 | 18 | 17 | 8 | 38/47 (81%) | 10/23 (43%) |
+ | Z. Keyboard shortcuts (desktop) | 49 | 16 | 15 | 1 | 40/52 (77%) | 9/23 (39%) |
| Lightroom Classic extras | 4 | 19 | 56 | 9 | — | 3/21 (14%) |
- | **Total** | 215 | 101 | 184 | 37 | 156/198 (79%) | 50/144 (35%) |
-| **Total** | 223 | 101 | 176 | 37 | 155/198 (78%) | 60/144 (42%) |
++| **Total** | 230 | 99 | 171 | 37 | 159/198 (80%) | 62/144 (43%) |
<!-- /parity:summary -->
## Top gaps