mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Merge PR #11503: Layer > Smart Objects says Reveal in Explorer, Embed Linked and Embed All Linked, in the reference order, without the Warp rows (#11401)
This commit is contained in:
commit
a77d7d6b53
40 files changed
+394
-17
No files matched your search
@@ -407,7 +407,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
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> {
|
||||
CommandSpec {
|
||||
id: PERSPECTIVE_SMART,
|
||||
label: "Perspective Warp",
|
||||
menu: &["Layer", "Smart Objects"],
|
||||
menu: &[],
|
||||
shortcut: None,
|
||||
params: Q,
|
||||
enabled: smart_layer,
|
||||
|
||||
@@ -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<LayerId> {
|
||||
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<Value> {
|
||||
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<SmartContentsId> = ids.iter().map(|id| smart(doc, *id).map(|sm| sm.contents_id)).collect::<Result<_>>()?;
|
||||
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::<Vec<_>>()}))
|
||||
}
|
||||
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<CommandSpec> {
|
||||
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…",
|
||||
|
||||
@@ -664,7 +664,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
CommandSpec {
|
||||
id: "layer.smartObjects.warp",
|
||||
label: "Warp",
|
||||
menu: &["Layer", "Smart Objects"],
|
||||
menu: &[],
|
||||
shortcut: None,
|
||||
params: P,
|
||||
enabled: active_smart,
|
||||
|
||||
@@ -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<u8>) {
|
||||
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<Vec<u8>> = (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();
|
||||
}
|
||||
@@ -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)]
|
||||
|
||||
@@ -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 تحرير المحتويات
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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… Αντικατάσταση περιεχομένου…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 47 and column 53.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 4 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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)
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 4 and column 47.
|
@@ -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…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 79 and column 53.
|
@@ -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 コンテンツを編集
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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 내용 편집
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 63 and column 53.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 34.
|
@@ -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ść
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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 Счёт
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 34.
|
@@ -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 Підрахунок
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 152 and column 53.
|
@@ -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
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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 编辑内容
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 63 and column 53.
|
@@ -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 編輯內容
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 6 and column 47.
|
@@ -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;
|
||||
|
||||
@@ -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, "---"),
|
||||
|
||||
@@ -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"
|
||||
};
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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<MenuItem> {
|
||||
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<String> = 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();
|
||||
}
|
||||
@@ -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% |
|
||||
|
||||
+2
-2
@@ -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 |
|
||||
|---|---|---|---|---|
|
||||
|
||||
Reference in new issue
Block a user