diff --git a/crates/engine/src/cmd/distort_cmds.rs b/crates/engine/src/cmd/distort_cmds.rs index 156095288f..7d820f0620 100644 --- a/crates/engine/src/cmd/distort_cmds.rs +++ b/crates/engine/src/cmd/distort_cmds.rs @@ -407,7 +407,7 @@ pub fn specs() -> Vec { CommandSpec { id: PUPPET_SMART, label: "Puppet Warp", - menu: &["Layer", "Smart Objects"], + menu: &[], shortcut: None, params: P, enabled: smart_layer, @@ -427,7 +427,7 @@ pub fn specs() -> Vec { CommandSpec { id: PERSPECTIVE_SMART, label: "Perspective Warp", - menu: &["Layer", "Smart Objects"], + menu: &[], shortcut: None, params: Q, enabled: smart_layer, diff --git a/crates/engine/src/cmd/smart_cmds.rs b/crates/engine/src/cmd/smart_cmds.rs index fd9234fc3e..a79927652c 100644 --- a/crates/engine/src/cmd/smart_cmds.rs +++ b/crates/engine/src/cmd/smart_cmds.rs @@ -101,6 +101,48 @@ fn has_linked(s: &Session) -> std::result::Result<(), String> { _ => Err("the smart object is embedded".into()), } } +fn linked_layers(doc: &Document) -> Vec { + doc.walk() + .into_iter() + .filter(|(_, _, l)| matches!(&l.content, LayerContent::Smart(sm) if matches!(sm.source, SmartSource::Linked { .. }))) + .map(|(_, _, l)| l.id) + .collect() +} +fn has_any_linked(s: &Session) -> std::result::Result<(), String> { + let d = s.active().ok_or("no document open")?; + if linked_layers(&d.doc).is_empty() { Err("the document has no linked smart object".into()) } else { Ok(()) } +} +/// Embed All Linked: reads every linked file first, so a missing one refuses the whole step. +fn embed_all_linked(s: &mut Session, _p: &Value) -> Result { + let doc = &s.active().ok_or(EngineError::NoDocument)?.doc; + let ids = linked_layers(doc); + if ids.is_empty() { + return Err(other("the document has no linked smart object")); + } + let mut sources = Vec::with_capacity(ids.len()); + for id in &ids { + let src = &smart(doc, *id)?.source; + let (file_name, bytes) = source_bytes(&doc.metadata, src).ok_or_else(|| { + let path = match src { + SmartSource::Linked { path } => path.as_str(), + SmartSource::Embedded { .. } => "", + }; + other(format!("the linked file can't be read: {path}")) + })?; + sources.push(SmartSource::Embedded { file_name, bytes }); + } + let parent = doc.id; + let contents: Vec = ids.iter().map(|id| smart(doc, *id).map(|sm| sm.contents_id)).collect::>()?; + s.edit("Embed All Linked", |doc, _| { + for (id, src) in ids.iter().zip(sources) { + smart_mut(doc, *id)?.source = src; + refresh_or_fail(doc, *id)?; + } + Ok(()) + })?; + s.smart_links.retain(|l| l.parent != parent || !contents.contains(&l.contents_id)); + Ok(json!({"embedded": ids.iter().map(|l| l.0).collect::>()})) +} fn has_doc(s: &Session) -> std::result::Result<(), String> { s.active().map(|_| ()).ok_or_else(|| "no document open".into()) } @@ -146,7 +188,6 @@ mod source; pub(crate) use contents::on_close; pub use contents::{commit_child, contents_of, replace_contents_bytes, replace_contents_from_bytes}; use contents::{edit_contents, export_contents, is_smart_child, path_param, replace_contents, set_source, update_all}; -#[cfg(test)] use filters::smart_mut; pub(crate) use filters::{add_smart_filter, add_smart_filter_in, filter_mask_paintable, filter_mask_surface, refresh_after_filter_mask_edit}; use filters::{blending_options, delete_filter, edit_filters, move_filter, set_filter_params, set_filter_visible, smart, transfer_filters}; @@ -244,12 +285,20 @@ pub fn specs() -> Vec { has_smart, unpack::convert_to_layers ), - spec!("layer.smartObjects.convertToEmbedded", "Convert to Embedded", SO, r##"{"layer":id?}"##, has_linked, |s, p| { + spec!("layer.smartObjects.convertToEmbedded", "Embed Linked", SO, r##"{"layer":id?}"##, has_linked, |s, p| { set_source(s, p, "Convert to Embedded", true, |meta, src| { let (file_name, bytes) = source_bytes(meta, src).ok_or_else(|| other("the linked file can't be read"))?; Ok(SmartSource::Embedded { file_name, bytes }) }) }), + spec!( + "layer.smartObjects.embedAllLinked", + "Embed All Linked", + SO, + "{} (every linked smart object of the active document becomes embedded in one history step; a linked file that can't be read refuses the whole step and the error names it) -> {embedded: [layer ids]}", + has_any_linked, + embed_all_linked + ), spec!( "layer.smartObjects.convertToLinked", "Convert to Linked…", diff --git a/crates/engine/src/cmd/warp_cmds.rs b/crates/engine/src/cmd/warp_cmds.rs index c2f434fb1e..4b94af82a9 100644 --- a/crates/engine/src/cmd/warp_cmds.rs +++ b/crates/engine/src/cmd/warp_cmds.rs @@ -664,7 +664,7 @@ pub fn specs() -> Vec { CommandSpec { id: "layer.smartObjects.warp", label: "Warp", - menu: &["Layer", "Smart Objects"], + menu: &[], shortcut: None, params: P, enabled: active_smart, diff --git a/crates/engine/src/embed_all_linked_tests.rs b/crates/engine/src/embed_all_linked_tests.rs new file mode 100644 index 0000000000..70bed5c0c1 --- /dev/null +++ b/crates/engine/src/embed_all_linked_tests.rs @@ -0,0 +1,144 @@ +//! Layer > Smart Objects > Embed Linked and Embed All Linked (#11401). + +use photocraft_doc::{LayerContent, SmartSource}; +use serde_json::json; + +use crate::Session; +use crate::cmd::command_specs; + +fn label(id: &str) -> &'static str { + command_specs().iter().find(|c| c.id == id).map(|c| c.label).unwrap_or_else(|| panic!("{id} is not registered")) +} + +/// Adds a layer with a few painted pixels (an empty layer can't become a smart object). +fn painted_layer(s: &mut Session, red: f32) { + s.execute("layer.new.layer", json!({})).unwrap(); + s.edit("setup", |doc, active| { + let surf = doc.layer_mut(active.unwrap()).unwrap().surface_mut().unwrap(); + surf.fill_rect(photocraft_geom::Rect::new(2, 2, 10, 10), &[red, 1.0 - red, 0.0, 1.0]); + Ok(()) + }) + .unwrap(); +} + +/// Three smart objects: the first two linked to files in `dir`, the third embedded. +fn three(dir: &std::path::Path) -> (Session, [u64; 3]) { + let mut s = Session::new(); + s.execute("file.new", json!({"width": 32, "height": 24})).unwrap(); + let mut ids = [0u64; 3]; + for (i, slot) in ids.iter_mut().enumerate() { + painted_layer(&mut s, 0.25 * (i + 1) as f32); + *slot = s.execute("layer.smartObjects.convertToSmartObject", json!({})).unwrap()["layer"].as_u64().unwrap(); + if i < 2 { + let path = dir.join(format!("linked{i}.pcraft")); + s.execute("layer.smartObjects.convertToLinked", json!({"path": path.to_str().unwrap()})).unwrap(); + } + } + (s, ids) +} + +fn is_linked(s: &Session, id: u64) -> bool { + let doc = &s.active().unwrap().doc; + let layer = doc.walk().into_iter().map(|(_, _, l)| l).find(|l| l.id.0 == id).unwrap(); + match &layer.content { + LayerContent::Smart(sm) => matches!(sm.source, SmartSource::Linked { .. }), + other => panic!("not smart: {}", other.kind_name()), + } +} + +/// The file name and bytes an embedded smart object carries. +fn embedded(s: &Session, id: u64) -> (String, Vec) { + let doc = &s.active().unwrap().doc; + let layer = doc.walk().into_iter().map(|(_, _, l)| l).find(|l| l.id.0 == id).unwrap(); + match &layer.content { + LayerContent::Smart(sm) => match &sm.source { + SmartSource::Embedded { file_name, bytes } => (file_name.clone(), bytes.to_vec()), + SmartSource::Linked { .. } => panic!("still linked"), + }, + other => panic!("not smart: {}", other.kind_name()), + } +} + +fn temp_dir(name: &str) -> std::path::PathBuf { + let dir = std::env::temp_dir().join(format!("pc-embed-all-{name}-{}", std::process::id())); + std::fs::remove_dir_all(&dir).ok(); + std::fs::create_dir_all(&dir).unwrap(); + dir +} + +#[test] +fn embed_linked_and_embed_all_linked_are_named_in_the_engine() { + assert_eq!(label("layer.smartObjects.convertToEmbedded"), "Embed Linked"); + assert_eq!(label("layer.smartObjects.embedAllLinked"), "Embed All Linked"); + // The warp commands stay registered for scripts and the Edit menu routes. + for id in ["layer.smartObjects.warp", "layer.smartObjects.perspectiveWarp", "layer.smartObjects.puppetWarp"] { + label(id); + } +} + +#[test] +fn embed_all_linked_embeds_both_linked_objects_in_one_undoable_step() { + let dir = temp_dir("both"); + let (mut s, ids) = three(&dir); + assert!(is_linked(&s, ids[0]) && is_linked(&s, ids[1]) && !is_linked(&s, ids[2])); + assert!(s.is_enabled("layer.smartObjects.embedAllLinked")); + let before = s.active().unwrap().history.entries().len(); + let files: Vec> = (0..2).map(|i| photocraft_format::read_file(&dir.join(format!("linked{i}.pcraft"))).unwrap()).collect(); + assert_ne!(files[0], files[1], "the fixtures differ"); + let third = embedded(&s, ids[2]); + + let r = s.execute("layer.smartObjects.embedAllLinked", json!({})).unwrap(); + assert_eq!(r["embedded"], json!([ids[0], ids[1]])); + assert!(ids.iter().all(|&id| !is_linked(&s, id))); + for (i, file) in files.iter().enumerate() { + let (name, bytes) = embedded(&s, ids[i]); + assert_eq!(name, format!("linked{i}.pcraft"), "object {i} keeps its own file name"); + assert_eq!(&bytes, file, "object {i} carries its own linked file's bytes"); + } + assert_eq!(embedded(&s, ids[2]), third, "the already embedded object is untouched"); + let entries = s.active().unwrap().history.entries(); + assert_eq!(entries.len(), before + 1, "one history step"); + assert_eq!(entries.last().map(String::as_str), Some("Embed All Linked")); + assert!(!s.is_enabled("layer.smartObjects.embedAllLinked"), "nothing left to embed"); + + s.execute("edit.undo", json!({})).unwrap(); + assert!(is_linked(&s, ids[0]) && is_linked(&s, ids[1]) && !is_linked(&s, ids[2])); + assert_eq!(s.active().unwrap().history.entries().len(), before); + std::fs::remove_dir_all(&dir).ok(); +} + +#[test] +fn embed_all_linked_with_no_linked_object_is_an_error_not_a_panic() { + let mut s = Session::new(); + assert!(!s.is_enabled("layer.smartObjects.embedAllLinked"), "no document"); + assert!(s.execute("layer.smartObjects.embedAllLinked", json!({})).is_err()); + s.execute("file.new", json!({"width": 16, "height": 16})).unwrap(); + painted_layer(&mut s, 1.0); + s.execute("layer.smartObjects.convertToSmartObject", json!({})).unwrap(); + assert!(!s.is_enabled("layer.smartObjects.embedAllLinked"), "only embedded objects"); + let before = s.active().unwrap().history.entries().len(); + assert!(s.execute("layer.smartObjects.embedAllLinked", json!({})).is_err()); + assert_eq!(s.active().unwrap().history.entries().len(), before); +} + +#[test] +fn embed_all_linked_refuses_the_whole_step_when_a_linked_file_is_missing() { + let dir = temp_dir("missing"); + let (mut s, ids) = three(&dir); + std::fs::remove_file(dir.join("linked1.pcraft")).unwrap(); + let before = s.active().unwrap().history.entries().len(); + let err = s.execute("layer.smartObjects.embedAllLinked", json!({})).unwrap_err().to_string(); + assert!(err.contains("linked1.pcraft"), "the error names the missing file: {err}"); + assert!(is_linked(&s, ids[0]) && is_linked(&s, ids[1]), "nothing was embedded"); + assert_eq!(s.active().unwrap().history.entries().len(), before); + std::fs::remove_dir_all(&dir).ok(); +} + +#[test] +fn embed_linked_still_embeds_one_object_under_its_old_id() { + let dir = temp_dir("one"); + let (mut s, ids) = three(&dir); + s.execute("layer.smartObjects.convertToEmbedded", json!({"layer": ids[0]})).unwrap(); + assert!(!is_linked(&s, ids[0]) && is_linked(&s, ids[1])); + std::fs::remove_dir_all(&dir).ok(); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index f247806b5e..a58b01695a 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -322,6 +322,8 @@ pub struct Session { pub damage_misses: usize, } +#[cfg(test)] +mod embed_all_linked_tests; #[cfg(test)] mod fill_layer_mode_tests; #[cfg(test)] diff --git a/crates/ui-egui/src/i18n/ar.tsv b/crates/ui-egui/src/i18n/ar.tsv index 0aeb1384d2..3534b3c5ff 100644 --- a/crates/ui-egui/src/i18n/ar.tsv +++ b/crates/ui-egui/src/i18n/ar.tsv @@ -142,6 +142,7 @@ Create Smart Object after Loading Layers إنشاء كائن ذكي بعد تحميل الطبقات Reveal in Finder إظهار في Finder Show in Explorer إظهار في Explorer + Reveal in Explorer إظهار في Explorer Show in Folder إظهار في المجلد File Info… معلومات الملف… Print… طباعة… @@ -387,6 +388,8 @@ Smart Object كائن ذكي Convert to Smart Object تحويل إلى كائن ذكي Convert to Embedded تحويل إلى مضمّن + Embed Linked تضمين المرتبط + Embed All Linked تضمين كل المرتبط Convert to Layers تحويل إلى طبقات Convert to Linked… تحويل إلى مرتبط… Edit Contents تحرير المحتويات diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 0cd4c6e7f0..38de7ad19a 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -124,6 +124,7 @@ Create Smart Object after Loading Layers Kreiraj pametni objekat nakon učitavanja slojeva Reveal in Finder Prikaži u Finderu Show in Explorer Prikaži u Exploreru + Reveal in Explorer Prikaži u Exploreru Show in Folder Prikaži u folderu File Info… Informacije o datoteci… Print… Štampaj… @@ -356,6 +357,8 @@ Smart Object Pametni objekat Convert to Smart Object Pretvori u pametni objekat Convert to Embedded Pretvori u ugrađeno + Embed Linked Ugradi povezano + Embed All Linked Ugradi sve povezano Convert to Layers Pretvori u slojeve Convert to Linked… Pretvori u povezano… Edit Contents Uredi sadržaj diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 1734583759..7d94b24155 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -263,6 +263,7 @@ Create Smart Object after Loading Layers Po načtení vrstev vytvořit chytrý objekt Reveal in Finder Zobrazit ve Finderu Show in Explorer Zobrazit v Průzkumníkovi + Reveal in Explorer Zobrazit v Průzkumníkovi Show in Folder Zobrazit ve složce File Info… Informace o souboru… Print… Tisk… @@ -508,6 +509,8 @@ Smart Object Chytrý objekt Convert to Smart Object Převést na chytrý objekt Convert to Embedded Převést na vložený + Embed Linked Vložit propojené + Embed All Linked Vložit všechna propojená Convert to Layers Převést na vrstvy Convert to Linked… Převést na propojený… Edit Contents Upravit obsah diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index c908e412bf..c511dc6391 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -1742,6 +1742,7 @@ Saved Gemt Reveal in Finder Vis i Finder Show in Explorer Vis i Stifinder + Reveal in Explorer Vis i Stifinder Show in Folder Vis i mappe Before (Y) Før (Y) Save Settings… Gem indstillinger… @@ -1921,6 +1922,8 @@ Combine Shapes Kombinér former Contract… Formindsk… Convert to Embedded Konvertér til indlejret + Embed Linked Indlejr sammenkædet + Embed All Linked Indlejr alle sammenkædede Convert to Layers Konvertér til lag Convert to Linked… Konvertér til sammenkædet… Count Optælling diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index fd8e206956..ba0c78f6c2 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -234,6 +234,7 @@ Create Smart Object after Loading Layers Nach dem Laden der Ebenen Smart-Objekt erstellen Reveal in Finder Im Finder anzeigen Show in Explorer Im Explorer anzeigen + Reveal in Explorer Im Explorer anzeigen Show in Folder Im Ordner anzeigen File Info… Dateiinformationen… Print… Drucken… @@ -479,6 +480,8 @@ Smart Object Smart-Objekt Convert to Smart Object In Smart-Objekt konvertieren Convert to Embedded In eingebettetes Smart-Objekt konvertieren + Embed Linked Verknüpftes einbetten + Embed All Linked Alle verknüpften einbetten Convert to Layers In Ebenen konvertieren Convert to Linked… In verknüpftes Smart-Objekt konvertieren… Edit Contents Inhalt bearbeiten diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 977ffa8ea5..e867c7a3f4 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -204,6 +204,7 @@ Create Smart Object after Loading Layers Δημιουργία έξυπνου αντικειμένου μετά τη φόρτωση επιπέδων Reveal in Finder Εμφάνιση στο Finder Show in Explorer Εμφάνιση στην Εξερεύνηση αρχείων + Reveal in Explorer Εμφάνιση στην Εξερεύνηση αρχείων Show in Folder Εμφάνιση στον φάκελο File Info… Πληροφορίες αρχείου… Print… Εκτύπωση… @@ -1952,6 +1953,8 @@ Hide Selection Απόκρυψη επιλογής From Transparency Από διαφάνεια Convert to Embedded Μετατροπή σε ενσωματωμένο + Embed Linked Ενσωμάτωση συνδεδεμένου + Embed All Linked Ενσωμάτωση όλων των συνδεδεμένων Convert to Linked… Μετατροπή σε συνδεδεμένο… Edit Contents Επεξεργασία περιεχομένου Replace Contents… Αντικατάσταση περιεχομένου… diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c3915b7471..23902a55f8 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -200,6 +200,7 @@ Create Smart Object after Loading Layers Crear objeto inteligente tras cargar las capas Reveal in Finder Mostrar en Finder Show in Explorer Mostrar en el Explorador + Reveal in Explorer Mostrar en el Explorador Show in Folder Mostrar en la carpeta File Info… Información del archivo… Print… Imprimir… @@ -445,6 +446,8 @@ Smart Object Objeto inteligente Convert to Smart Object Convertir en objeto inteligente Convert to Embedded Convertir en incrustado + Embed Linked Incrustar vinculado + Embed All Linked Incrustar todos los vinculados Convert to Layers Convertir en capas Convert to Linked… Convertir en vinculado… Edit Contents Editar contenido diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index d09249c9c4..f61aedeec2 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1743,6 +1743,7 @@ Saved Tallennettu Reveal in Finder Näytä Finderissa Show in Explorer Näytä Resurssienhallinnassa + Reveal in Explorer Näytä Resurssienhallinnassa Show in Folder Näytä kansiossa Before (Y) Ennen (Y) Save Settings… Tallenna asetukset… @@ -1922,6 +1923,8 @@ Combine Shapes Yhdistä muodot Contract… Supista… Convert to Embedded Muunna upotetuksi + Embed Linked Upota linkitetty + Embed All Linked Upota kaikki linkitetyt Convert to Layers Muunna tasoiksi Convert to Linked… Muunna linkitetyksi… Count Laskuri diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 6101bc103c..09b9843867 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -232,6 +232,7 @@ Create Smart Object after Loading Layers Créer un objet intelligent après le chargement des calques Reveal in Finder Afficher dans le Finder Show in Explorer Afficher dans l'Explorateur + Reveal in Explorer Afficher dans l'Explorateur Show in Folder Afficher dans le dossier File Info… Informations sur le fichier… Print… Imprimer… @@ -467,6 +468,8 @@ Smart Object Objet intelligent Convert to Smart Object Convertir en objet intelligent Convert to Embedded Convertir en objet incorporé + Embed Linked Incorporer le lié + Embed All Linked Incorporer tous les liés Convert to Layers Convertir en calques Convert to Linked… Convertir en objet lié… Edit Contents Modifier le contenu diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index b1fc4631e0..8c78fe8a94 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -630,6 +630,8 @@ cameraRaw Yellow पीला @plural {n} action file loaded|{n} action files loaded {n} एक्शन फ़ाइल लोड हुई|{n} एक्शन फ़ाइलें लोड हुईं {set} from {file} replaced the one from {earlier} {file} के सेट {set} ने {earlier} वाले सेट की जगह ले ली @plural {n} file could not be loaded: {errors}|{n} files could not be loaded: {errors} {n} फ़ाइल लोड नहीं हो सकी: {errors}|{n} फ़ाइलें लोड नहीं हो सकीं: {errors} + Embed Linked लिंक किए गए को एम्बेड करें + Embed All Linked सभी लिंक किए गए को एम्बेड करें Toggle reference point संदर्भ बिंदु दिखाएँ/छिपाएँ # Action Stop message (#8386) diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 6a26db3b36..07f05b94a4 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -342,6 +342,8 @@ Combine Shapes Alakzatok kombinálása Contract… Szűkítés… Convert to Embedded Átalakítás beágyazottá + Embed Linked Csatolt beágyazása + Embed All Linked Összes csatolt beágyazása Convert to Layers Átalakítás rétegekké Convert to Linked… Átalakítás csatolttá… Convert to Smart Object Átalakítás intelligens objektummá @@ -854,6 +856,7 @@ Show All Összes megjelenítése Show Extras Options… Segédelemek beállításai… Show in Explorer Megjelenítés az Intézőben + Reveal in Explorer Megjelenítés az Intézőben Show in Folder Megjelenítés mappában Show menu colors Menüszínek megjelenítése Show/Hide All Panels Összes panel megjelenítése/elrejtése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 564eb62c64..435b435dfa 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -225,6 +225,7 @@ Create Smart Object after Loading Layers Buat Smart Object setelah Memuat Layer Reveal in Finder Tampilkan di Finder Show in Explorer Tampilkan di Explorer + Reveal in Explorer Tampilkan di Explorer Show in Folder Tampilkan di Folder File Info… Info Berkas… Print… Cetak… @@ -460,6 +461,8 @@ Smart Object Smart Object Convert to Smart Object Konversi ke Smart Object Convert to Embedded Konversi ke Tertanam + Embed Linked Tanamkan yang Tertaut + Embed All Linked Tanamkan Semua yang Tertaut Convert to Layers Konversi ke Layer Convert to Linked… Konversi ke Tertaut… Edit Contents Edit Isi diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 9fae131306..abe13a90b5 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -246,6 +246,7 @@ Create Smart Object after Loading Layers Crea oggetto avanzato dopo il caricamento dei livelli Reveal in Finder Mostra nel Finder Show in Explorer Mostra in Esplora file + Reveal in Explorer Mostra in Esplora file Show in Folder Mostra nella cartella File Info… Info file… Print… Stampa… @@ -491,6 +492,8 @@ Smart Object Oggetto avanzato Convert to Smart Object Converti in oggetto avanzato Convert to Embedded Converti in incorporato + Embed Linked Incorpora collegato + Embed All Linked Incorpora tutti i collegati Convert to Linked… Converti in oggetto collegato… Edit Contents Modifica contenuto Replace Contents… Sostituisci contenuto… diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index a5e8d6b72e..52860b6512 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -256,6 +256,7 @@ Create Smart Object after Loading Layers レイヤーの読み込み後にスマートオブジェクトを作成 Reveal in Finder Finder で表示 Show in Explorer エクスプローラーで表示 + Reveal in Explorer エクスプローラーで表示 Show in Folder フォルダーで表示 File Info… ファイル情報… Print… プリント… @@ -500,6 +501,8 @@ Smart Object スマートオブジェクト Convert to Smart Object スマートオブジェクトに変換 Convert to Embedded 埋め込みに変換 + Embed Linked リンクを埋め込む + Embed All Linked すべてのリンクを埋め込む Convert to Layers レイヤーに変換 Convert to Linked… リンクに変換… Edit Contents コンテンツを編集 diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbe04fbe66..d75785a57e 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -227,6 +227,7 @@ Create Smart Object after Loading Layers 레이어를 불러온 후 스마트 오브젝트 만들기 Reveal in Finder Finder에서 보기 Show in Explorer 파일 탐색기에서 보기 + Reveal in Explorer 파일 탐색기에서 보기 Show in Folder 폴더에서 보기 File Info… 파일 정보… Print… 인쇄… @@ -465,6 +466,8 @@ Smart Object 스마트 오브젝트 Convert to Smart Object 스마트 오브젝트로 변환 Convert to Embedded 포함된 오브젝트로 변환 + Embed Linked 연결된 항목 포함 + Embed All Linked 모든 연결된 항목 포함 Convert to Layers 레이어로 변환 Convert to Linked… 연결된 오브젝트로 변환… Edit Contents 내용 편집 diff --git a/crates/ui-egui/src/i18n/nb.tsv b/crates/ui-egui/src/i18n/nb.tsv index 05d0d7659b..3524b51ef0 100644 --- a/crates/ui-egui/src/i18n/nb.tsv +++ b/crates/ui-egui/src/i18n/nb.tsv @@ -1742,6 +1742,7 @@ Saved Lagret Reveal in Finder Vis i Finder Show in Explorer Vis i Utforsker + Reveal in Explorer Vis i Utforsker Show in Folder Vis i mappe Before (Y) Før (Y) Save Settings… Lagre innstillinger… @@ -1921,6 +1922,8 @@ Combine Shapes Kombiner former Contract… Trekk sammen… Convert to Embedded Konverter til innebygd + Embed Linked Bygg inn koblet + Embed All Linked Bygg inn alle koblede Convert to Layers Konverter til lag Convert to Linked… Konverter til koblet… Count Telling diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 0a306cc07a..f8944df39a 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -188,6 +188,7 @@ Create Smart Object after Loading Layers Slim object maken na laden van lagen Reveal in Finder Weergeven in Finder Show in Explorer Weergeven in Verkenner + Reveal in Explorer Weergeven in Verkenner Show in Folder Weergeven in map File Info… Bestandsinformatie… Print… Afdrukken… @@ -432,6 +433,8 @@ Smart Object Slim object Convert to Smart Object Omzetten naar slim object Convert to Embedded Omzetten naar ingesloten + Embed Linked Gekoppeld insluiten + Embed All Linked Alles gekoppeld insluiten Convert to Layers Omzetten naar lagen Convert to Linked… Omzetten naar gekoppeld… Edit Contents Inhoud bewerken diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 3ae45cb51d..dfd5cd61e2 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -232,6 +232,7 @@ Create Smart Object after Loading Layers Utwórz obiekt inteligentny po wczytaniu warstw Reveal in Finder Pokaż w Finderze Show in Explorer Pokaż w Eksploratorze + Reveal in Explorer Pokaż w Eksploratorze Show in Folder Pokaż w folderze File Info… Informacje o pliku… Print… Drukuj… @@ -475,6 +476,8 @@ Smart Object Obiekt inteligentny Convert to Smart Object Konwertuj na obiekt inteligentny Convert to Embedded Konwertuj na osadzony + Embed Linked Osadź połączony + Embed All Linked Osadź wszystkie połączone Convert to Layers Konwertuj na warstwy Convert to Linked… Konwertuj na połączony… Edit Contents Edytuj zawartość diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 74b15cc6d3..3fac49ade6 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -228,6 +228,7 @@ Create Smart Object after Loading Layers Criar objeto inteligente após carregar as camadas Reveal in Finder Mostrar no Finder Show in Explorer Mostrar no Explorador + Reveal in Explorer Mostrar no Explorador Show in Folder Mostrar na pasta File Info… Informações do arquivo… Print… Imprimir… @@ -463,6 +464,8 @@ Smart Object Objeto inteligente Convert to Smart Object Converter em objeto inteligente Convert to Embedded Converter em incorporado + Embed Linked Incorporar vinculado + Embed All Linked Incorporar todos os vinculados Convert to Layers Converter em camadas Convert to Linked… Converter em vinculado… Edit Contents Editar conteúdo diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index fe3b88318a..a3ce65fe67 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1853,6 +1853,7 @@ Saved Сохранено Reveal in Finder Показать в Finder Show in Explorer Показать в Проводнике + Reveal in Explorer Показать в Проводнике Show in Folder Показать в папке Before (Y) До (Y) Save Settings… Сохранить настройки… @@ -2018,6 +2019,8 @@ Combine Shapes Комбинировать фигуры Contract… Сжать… Convert to Embedded Преобразовать во встроенный + Embed Linked Встроить связанный + Embed All Linked Встроить все связанные Convert to Layers Преобразовать в слои Convert to Linked… Преобразовать в связанный… Count Счёт diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv index 1fcd6b0840..1d8e8dce36 100644 --- a/crates/ui-egui/src/i18n/sr.tsv +++ b/crates/ui-egui/src/i18n/sr.tsv @@ -256,6 +256,7 @@ Create Smart Object after Loading Layers Napravi pametni objekat posle učitavanja slojeva Reveal in Finder Prikaži u Finderu Show in Explorer Prikaži u Exploreru + Reveal in Explorer Prikaži u Exploreru Show in Folder Prikaži u fascikli File Info… Informacije o datoteci… Print… Štampaj… @@ -488,6 +489,8 @@ Smart Object Pametni objekat Convert to Smart Object Pretvori u pametni objekat Convert to Embedded Pretvori u ugrađeni + Embed Linked Ugradi povezani + Embed All Linked Ugradi sve povezane Convert to Layers Pretvori u slojeve Convert to Linked… Pretvori u povezani… Edit Contents Uredi sadržaj diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 23583538be..2199445151 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1740,6 +1740,7 @@ Saved Sparat Reveal in Finder Visa i Finder Show in Explorer Visa i Utforskaren + Reveal in Explorer Visa i Utforskaren Show in Folder Visa i mapp Before (Y) Före (Y) Save Settings… Spara inställningar… @@ -1919,6 +1920,8 @@ Combine Shapes Kombinera former Contract… Dra ihop… Convert to Embedded Konvertera till inbäddat + Embed Linked Bädda in länkat + Embed All Linked Bädda in alla länkade Convert to Layers Konvertera till lager Convert to Linked… Konvertera till länkat… Count Antal diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 24fd991966..0ac2fa6e56 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -155,6 +155,7 @@ Create Smart Object after Loading Layers Katmanları Yükledikten Sonra Akıllı Nesne Oluştur Reveal in Finder Finder'da Göster Show in Explorer Explorer'da Göster + Reveal in Explorer Explorer'da Göster Show in Folder Klasörde Göster File Info… Dosya Bilgileri… Print… Yazdır… @@ -398,6 +399,8 @@ Smart Object Akıllı Nesne Convert to Smart Object Akıllı Nesneye Dönüştür Convert to Embedded Gömülüye Dönüştür + Embed Linked Bağlantılıyı Göm + Embed All Linked Tüm Bağlantılıları Göm Convert to Layers Katmanlara Dönüştür Convert to Linked… Bağlantılıya Dönüştür… Edit Contents İçeriği Düzenle diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 35754edc42..fdf2fdc857 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1823,6 +1823,7 @@ Saved Збережено Reveal in Finder Показати у Finder Show in Explorer Показати у Провіднику + Reveal in Explorer Показати у Провіднику Show in Folder Показати в теці Before (Y) До (Y) Save Settings… Зберегти налаштування… @@ -1986,6 +1987,8 @@ Combine Shapes Об'єднати фігури Contract… Стиснути… Convert to Embedded Перетворити на вбудований + Embed Linked Вбудувати пов'язаний + Embed All Linked Вбудувати всі пов'язані Convert to Layers Перетворити на шари Convert to Linked… Перетворити на пов'язаний… Count Підрахунок diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 6745f2f33d..2d4c1cffb4 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -374,6 +374,8 @@ Color Table… Bảng màu… Combine Shapes Kết hợp hình Convert to Embedded Chuyển thành nhúng + Embed Linked Nhúng mục liên kết + Embed All Linked Nhúng tất cả mục liên kết Convert to Layers Chuyển thành lớp Convert to Linked… Chuyển thành liên kết… Convert to Smart Object Chuyển thành đối tượng thông minh @@ -2617,6 +2619,7 @@ shape Appearance Diện mạo (coming soon) (sắp có) Add beauty precomp from the AOVs Thêm precomp beauty từ các AOV Show in Explorer Hiện trong Explorer + Reveal in Explorer Hiện trong Explorer Show in Folder Hiện trong thư mục Delete and Fill Selection Xoá và tô vùng chọn Transform Again on a Copy Biến đổi lại trên một bản sao diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index a31d2c6d03..82c9b7dda3 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -235,6 +235,7 @@ Create Smart Object after Loading Layers 载入图层后创建智能对象 Reveal in Finder 在 Finder 中显示 Show in Explorer 在文件资源管理器中显示 + Reveal in Explorer 在文件资源管理器中显示 Show in Folder 在文件夹中显示 File Info… 文件信息… Print… 打印… @@ -483,6 +484,8 @@ Smart Object 智能对象 Convert to Smart Object 转换为智能对象 Convert to Embedded 转换为嵌入对象 + Embed Linked 嵌入链接对象 + Embed All Linked 嵌入所有链接对象 Convert to Layers 转换为图层 Convert to Linked… 转换为链接对象… Edit Contents 编辑内容 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index d1c2346267..d197d699a1 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -237,6 +237,7 @@ Create Smart Object after Loading Layers 載入圖層後建立智慧型物件 Reveal in Finder 在 Finder 中顯示 Show in Explorer 在檔案總管中顯示 + Reveal in Explorer 在檔案總管中顯示 Show in Folder 在資料夾中顯示 File Info… 檔案資訊… Print… 列印… @@ -482,6 +483,8 @@ Smart Object 智慧型物件 Convert to Smart Object 轉換為智慧型物件 Convert to Embedded 轉換為嵌入 + Embed Linked 嵌入連結 + Embed All Linked 嵌入所有連結 Convert to Layers 轉換為圖層 Convert to Linked… 轉換為連結… Edit Contents 編輯內容 diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 4dfd00447d..e75e8994c1 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -796,6 +796,8 @@ mod lock_layers_shortcut_tests; #[cfg(test)] mod pencil_tests; #[cfg(test)] +mod smart_objects_menu_tests; +#[cfg(test)] mod tool_options_theme_tests; #[cfg(test)] mod tool_shift_cycle_order_tests; diff --git a/crates/ui-egui/src/menu_catalog.rs b/crates/ui-egui/src/menu_catalog.rs index 3b4090b3e1..d9f6c72bf4 100644 --- a/crates/ui-egui/src/menu_catalog.rs +++ b/crates/ui-egui/src/menu_catalog.rs @@ -350,8 +350,9 @@ pub static CATALOG: &[(&[&str], &str, Option<&str>, &str)] = &[ (&["Layer", "Smart Objects"], "Replace Contents…", None, "layer.smartObjects.replaceContents"), (&["Layer", "Smart Objects"], "Export Contents…", None, "layer.smartObjects.exportContents"), (&["Layer", "Smart Objects"], "---", None, "---"), + (&["Layer", "Smart Objects"], "Embed Linked", None, "layer.smartObjects.convertToEmbedded"), + (&["Layer", "Smart Objects"], "Embed All Linked", None, "layer.smartObjects.embedAllLinked"), (&["Layer", "Smart Objects"], "Convert to Linked…", None, "layer.smartObjects.convertToLinked"), - (&["Layer", "Smart Objects"], "Convert to Embedded", None, "layer.smartObjects.convertToEmbedded"), (&["Layer", "Smart Objects"], "Convert to Layers", None, "layer.smartObjects.convertToLayers"), (&["Layer", "Smart Objects"], "---", None, "---"), (&["Layer", "Smart Objects", "Stack Mode"], "Entropy", None, "layer.smartObjects.stackMode.entropy"), @@ -367,10 +368,6 @@ pub static CATALOG: &[(&[&str], &str, Option<&str>, &str)] = &[ (&["Layer", "Smart Objects", "Stack Mode"], "Variance", None, "layer.smartObjects.stackMode.variance"), (&["Layer", "Smart Objects"], "---", None, "---"), (&["Layer", "Smart Objects"], "Rasterize", None, "layer.smartObjects.rasterize"), - (&["Layer", "Smart Objects"], "---", None, "---"), - (&["Layer", "Smart Objects"], "Warp", None, "layer.smartObjects.warp"), - (&["Layer", "Smart Objects"], "Perspective Warp", None, "layer.smartObjects.perspectiveWarp"), - (&["Layer", "Smart Objects"], "Puppet Warp", None, "layer.smartObjects.puppetWarp"), (&["Layer", "Video Layers"], "New Blank Video Layer", None, "layer.videoLayers.newBlankVideoLayer"), (&["Layer", "Video Layers"], "New Video Layer from File…", None, "layer.videoLayers.newVideoLayerFromFile"), (&["Layer", "Video Layers"], "---", None, "---"), diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 01195598c0..95a57d9588 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -203,7 +203,7 @@ mod reveal_label_tests { let expected = if cfg!(target_os = "macos") { "Reveal in Finder" } else if cfg!(windows) { - "Show in Explorer" + "Reveal in Explorer" } else { "Show in Folder" }; diff --git a/crates/ui-egui/src/menus/parity.rs b/crates/ui-egui/src/menus/parity.rs index a185b3576e..520aca1181 100644 --- a/crates/ui-egui/src/menus/parity.rs +++ b/crates/ui-egui/src/menus/parity.rs @@ -7,7 +7,7 @@ use crate::menu_catalog::CATALOG; use crate::menus::is_live; /// Minimum number of live catalog items. Raise it when parity grows; never lower it. -pub const FLOOR: usize = 660; +pub const FLOOR: usize = 658; /// One top-level menu's coverage. #[derive(Clone, Debug, serde::Serialize)] diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index c932ca092c..924a6ed7ee 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -211,7 +211,7 @@ pub(crate) fn reveal_label() -> &'static str { if cfg!(target_os = "macos") { "Reveal in Finder" } else if cfg!(windows) { - "Show in Explorer" + "Reveal in Explorer" } else { "Show in Folder" } diff --git a/crates/ui-egui/src/smart_objects_menu_tests.rs b/crates/ui-egui/src/smart_objects_menu_tests.rs new file mode 100644 index 0000000000..dd6d7947a6 --- /dev/null +++ b/crates/ui-egui/src/smart_objects_menu_tests.rs @@ -0,0 +1,103 @@ +//! Layer > Smart Objects menu rows, labels and order (#11401). + +use serde_json::json; + +use crate::PhotocraftApp; +use crate::menus::{MenuItem, menu_items}; + +fn app() -> PhotocraftApp { + PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()) +} + +fn submenu(app: &PhotocraftApp) -> Vec { + menu_items(app).into_iter().filter(|i| i.path == ["Layer", "Smart Objects"]).collect() +} + +fn reveal() -> &'static str { + if cfg!(target_os = "macos") { + "Reveal in Finder" + } else if cfg!(windows) { + "Reveal in Explorer" + } else { + "Show in Folder" + } +} + +#[test] +fn the_rows_follow_the_reference_order() { + let labels: Vec = submenu(&app()).into_iter().map(|i| i.label).collect(); + let expected = [ + "Convert to Smart Object", + "New Smart Object via Copy", + "---", + reveal(), + "---", + "Update Modified Content", + "Update All Modified Content", + "---", + "Edit Contents", + "Relink to File…", + "Replace Contents…", + "Export Contents…", + "---", + "Embed Linked", + "Embed All Linked", + "Convert to Linked…", + "Convert to Layers", + "---", + "---", + "Rasterize", + ]; + assert_eq!(labels, expected, "{labels:?}"); +} + +#[test] +fn embed_rows_use_the_new_labels_and_the_ids_stay() { + let items = submenu(&app()); + let by_id = |id: &str| items.iter().find(|i| i.id == id).unwrap_or_else(|| panic!("{id} missing")); + assert_eq!(by_id("layer.smartObjects.convertToEmbedded").label, "Embed Linked"); + assert_eq!(by_id("layer.smartObjects.embedAllLinked").label, "Embed All Linked"); + assert_eq!(by_id("layer.smartObjects.revealInFinder").label, reveal()); +} + +#[cfg(windows)] +#[test] +fn windows_says_reveal_in_explorer() { + assert_eq!(crate::menus::reveal_label(), "Reveal in Explorer"); +} + +#[test] +fn the_warp_rows_are_gone_from_the_submenu_but_the_commands_stay() { + let app = app(); + for id in ["layer.smartObjects.warp", "layer.smartObjects.perspectiveWarp", "layer.smartObjects.puppetWarp"] { + assert!(!submenu(&app).iter().any(|i| i.id == id), "{id}"); + assert!(photocraft_engine::cmd::command_specs().iter().any(|c| c.id == id), "{id} stays registered"); + } + let all = menu_items(&app); + for id in ["edit.puppetWarp", "edit.perspectiveWarp", "edit.transform.warp"] { + assert!(all.iter().any(|i| i.id == id), "{id} stays in the Edit menu"); + } +} + +#[test] +fn embed_all_linked_is_disabled_without_a_linked_smart_object_and_enabled_with_one() { + let mut app = app(); + app.run("file.new", json!({"width": 32, "height": 24})).unwrap(); + app.run("layer.new.layer", json!({})).unwrap(); + app.session + .edit("setup", |doc, active| { + doc.layer_mut(active.unwrap()).unwrap().surface_mut().unwrap().fill_rect(photocraft_geom::Rect::new(2, 2, 10, 10), &[1.0, 0.0, 0.0, 1.0]); + Ok(()) + }) + .unwrap(); + app.run("layer.smartObjects.convertToSmartObject", json!({})).unwrap(); + app.sync_views(); + let enabled = |app: &PhotocraftApp, id: &str| submenu(app).iter().find(|i| i.id == id).unwrap().enabled; + assert!(!enabled(&app, "layer.smartObjects.embedAllLinked")); + let path = std::env::temp_dir().join(format!("pc-so-menu-{}.pcraft", std::process::id())); + app.run("layer.smartObjects.convertToLinked", json!({"path": path.to_str().unwrap()})).unwrap(); + app.sync_views(); + assert!(enabled(&app, "layer.smartObjects.embedAllLinked")); + assert!(enabled(&app, "layer.smartObjects.convertToEmbedded")); + std::fs::remove_file(&path).ok(); +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index ccc77e95bc..a8899fdc2c 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -2,14 +2,14 @@ Generated by `cargo xtask parity` from `crates/ui-egui/src/menu_catalog.rs` (Photoshop's menu tree) and the live command registry. Do not edit by hand. -**660 of 660 menu items live (100.0%).** +**658 of 658 menu items live (100.0%).** | Menu | Live | Total | % | |---|---:|---:|---:| | File | 52 | 52 | 100% | | Edit | 75 | 75 | 100% | | Image | 61 | 61 | 100% | -| Layer | 163 | 163 | 100% | +| Layer | 161 | 161 | 100% | | Type | 74 | 74 | 100% | | Select | 25 | 25 | 100% | | Filter | 75 | 75 | 100% | diff --git a/docs/scorecard.md b/docs/scorecard.md index bf6ebcfb9b..c549146a54 100644 --- a/docs/scorecard.md +++ b/docs/scorecard.md @@ -11,7 +11,7 @@ Generated by `cargo xtask scorecard` from `perf/budgets.toml`, `perf/baseline.js | [Tools](#tools) | 36 | 9 | 0 | | | [Workspace and UI](#workspace-and-ui) | 15 | 6 | 2 | settings that do nothing: 10 of 189 (target 0) | | [Type](#type) | 5 | 5 | 0 | | -| [Automation](#automation) | 5 | 3 | 3 | 660 of 660 menu items live (100.0%) | +| [Automation](#automation) | 5 | 3 | 3 | 658 of 658 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 30 of 30 crates; panic_hunt present | | [Distribution](#distribution) | 5 | 5 | 1 | | | [Open bugs](#open-bugs) | 31 | 1 | 0 | | @@ -256,7 +256,7 @@ Unread: `general.color_picker`, `workspace.auto_show_hidden_panels`, `workspace. ## Automation -Menu wiring (`docs/parity-checklist.md`): 660 of 660 menu items live (100.0%). This counts dispatch, not behaviour. +Menu wiring (`docs/parity-checklist.md`): 658 of 658 menu items live (100.0%). This counts dispatch, not behaviour. | Id | Target | Status | Issue | Note | |---|---|---|---|---|