mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-28 09:19:25 +01:00
Merge remote-tracking branch 'origin/main' into pr2828
# Conflicts: # crates/ui-egui/locales/cs-formats.json # crates/ui-egui/locales/cs.json # crates/ui-egui/locales/de-formats.json # crates/ui-egui/locales/de.json # crates/ui-egui/locales/es-formats.json # crates/ui-egui/locales/es.json # crates/ui-egui/locales/fi-formats.json # crates/ui-egui/locales/fi.json # crates/ui-egui/locales/fr-formats.json # crates/ui-egui/locales/fr.json # crates/ui-egui/locales/id-formats.json # crates/ui-egui/locales/id.json # crates/ui-egui/locales/it-formats.json # crates/ui-egui/locales/it.json # crates/ui-egui/locales/ja-formats.json # crates/ui-egui/locales/ja.json # crates/ui-egui/locales/ka-formats.json # crates/ui-egui/locales/ka.json # crates/ui-egui/locales/pl-formats.json # crates/ui-egui/locales/pl.json # crates/ui-egui/locales/pt-br-formats.json # crates/ui-egui/locales/pt-br.json # crates/ui-egui/locales/ru-formats.json # crates/ui-egui/locales/ru.json # crates/ui-egui/locales/sv-formats.json # crates/ui-egui/locales/sv.json # crates/ui-egui/locales/uk-formats.json # crates/ui-egui/locales/uk.json # crates/ui-egui/locales/vi-formats.json # crates/ui-egui/locales/vi.json # crates/ui-egui/locales/zh-hans-formats.json # crates/ui-egui/locales/zh-hans.json # crates/ui-egui/locales/zh-hant-formats.json # crates/ui-egui/locales/zh-hant.json # docs/parity-checklist.md
This commit is contained in:
commit
fc79e047dc
60 files changed
+2013
-367
No files matched your search
@@ -18,7 +18,6 @@
|
||||
"+{} more": "+{} dalších",
|
||||
", {failed} file{} not readable": ", nečitelné soubory: {failed}{:.0}",
|
||||
", {} label": ", štítek: {}",
|
||||
", {} star{}": ", hvězdičky: {}{:.0}",
|
||||
"1 task is still running: {names}. Quitting stops it.": "Stále běží 1 úloha: {names}. Ukončení aplikace ji zastaví.",
|
||||
"; {kept} already had a location": "; {kept} již mělo polohu",
|
||||
"; {n} gained synonyms": "; {n} získalo synonyma",
|
||||
@@ -328,5 +327,6 @@
|
||||
"{n} folder{} could not be read": "Složky, které se nepodařilo přečíst: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "Přeskočené soubory (nejde o podporovaný typ fotografie): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Pravidlo {n} z {m}: {what}. Přesun pomocí šipek",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Skupina {n} z {m}: shoda {mode}, uvnitř {count}. Přesun pomocí šipek"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Skupina {n} z {m}: shoda {mode}, uvnitř {count}. Přesun pomocí šipek",
|
||||
", rating {} of 5": ", hodnocení: {} z 5"
|
||||
}
|
||||
@@ -2047,7 +2047,8 @@
|
||||
"We": "St",
|
||||
"Wednesday": "Středa",
|
||||
"What's New": "Co je nového",
|
||||
"When rated or hovered": "Při hodnocení nebo najetí myší",
|
||||
"Stars on hover": "Hvězdy při najetí",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Hvězdy při najetí: vlajky a barevné štítky jsou vidět vždy; hvězdy a značka úprav se zobrazí, když je fotka pod myší nebo vybraná.",
|
||||
"White Balance": "Vyvážení bílé",
|
||||
"White Balance Selector": "Kapátko vyvážení bílé",
|
||||
"White Balance Selector (W)": "Kapátko vyvážení bílé (W)",
|
||||
@@ -2506,5 +2507,10 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Zastaveno na limitu skenování: je možné, že existují další fotografie",
|
||||
"Drag to move, or use the arrow keys": "Přetažením přesunete, nebo použijte šipky",
|
||||
"A group can't go inside itself": "Skupinu nelze vložit do sebe samé",
|
||||
"Groups can't nest any deeper": "Skupiny nelze vnořovat hlouběji"
|
||||
"Groups can't nest any deeper": "Skupiny nelze vnořovat hlouběji",
|
||||
"Stack — click to expand (S)": "Sada — kliknutím rozbalíte (S)",
|
||||
"Stack — click to collapse (S)": "Sada — kliknutím sbalíte (S)",
|
||||
"Virtual copy": "Virtuální kopie",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Klikněte pravým tlačítkem → Najít chybějící soubor… a najděte jej znovu.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Klikněte pravým tlačítkem → Znovu načíst z disku a zkuste to znovu."
|
||||
}
|
||||
@@ -204,7 +204,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "Ähnliche Fotos: {n}{:.0} · Ansicht → Filter löschen zeigt alle Fotos",
|
||||
"Moved; {} photo(s) relinked": "Verschoben; {} Foto(s) neu verknüpft",
|
||||
"{} label (click more labels to show any of them)": "Farbmarkierung {} (weitere Farbmarkierungen auswählen, um alle passenden Fotos zu zeigen)",
|
||||
", {} star{}": ", Sterne: {}{:.0}",
|
||||
", {} label": ", Farbmarkierung: {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Lädt von {host} herunter. Sobald es angekommen und geprüft ist, installiert LightCraft es und {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "Ansicht › Detailansicht ({keys}).",
|
||||
"File › Export… · File › Print… ({keys}).": "Datei › Exportieren… · Datei › Drucken… ({keys}).",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Regel {n} von {m}: {what}. Mit den Pfeiltasten verschieben",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Gruppe {n} von {m}: erfülle {mode}, {count} darin. Mit den Pfeiltasten verschieben"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Gruppe {n} von {m}: erfülle {mode}, {count} darin. Mit den Pfeiltasten verschieben",
|
||||
", rating {} of 5": ", Bewertung: {} von 5"
|
||||
}
|
||||
@@ -1652,7 +1652,8 @@
|
||||
"Watermark": "Wasserzeichen",
|
||||
"Wednesday": "Mittwoch",
|
||||
"What's New": "Neuigkeiten",
|
||||
"When rated or hovered": "Bei Bewertung oder unter dem Mauszeiger",
|
||||
"Stars on hover": "Sterne beim Überfahren",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Sterne beim Überfahren: Flaggen und Farbmarkierungen sind immer sichtbar; die Sterne und das Bearbeitet-Zeichen erscheinen, solange ein Foto überfahren oder ausgewählt ist.",
|
||||
"White Balance": "Weißabgleich",
|
||||
"White Balance Selector": "Weißabgleich-Pipette",
|
||||
"White Balance Selector (W)": "Weißabgleich-Pipette (W)",
|
||||
@@ -3541,5 +3542,10 @@
|
||||
"Get Started": "Loslegen",
|
||||
"Drag to move, or use the arrow keys": "Zum Verschieben ziehen oder die Pfeiltasten verwenden",
|
||||
"A group can't go inside itself": "Eine Gruppe kann nicht in sich selbst liegen",
|
||||
"Groups can't nest any deeper": "Gruppen lassen sich nicht tiefer verschachteln"
|
||||
"Groups can't nest any deeper": "Gruppen lassen sich nicht tiefer verschachteln",
|
||||
"Stack — click to expand (S)": "Stapel — Klicken zum Aufklappen (S)",
|
||||
"Stack — click to collapse (S)": "Stapel — Klicken zum Zuklappen (S)",
|
||||
"Virtual copy": "Virtuelle Kopie",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Rechtsklick → Fehlende Datei suchen…, um sie wiederzufinden.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Rechtsklick → Vom Datenträger neu laden, um es erneut zu versuchen."
|
||||
}
|
||||
@@ -205,7 +205,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "Fotos similares: {n}{:.0} · Vista → Borrar filtros para ver todas",
|
||||
"Moved; {} photo(s) relinked": "Movida; {} foto(s) vinculada(s) de nuevo",
|
||||
"{} label (click more labels to show any of them)": "Etiqueta {} (hacer clic en más etiquetas para mostrar cualquiera de ellas)",
|
||||
", {} star{}": ", {} estrella{}",
|
||||
", {} label": ", etiqueta {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Se descarga desde {host}. Cuando llega y se comprueba, LightCraft lo instala y {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "Vista › Vista de detalle ({keys}).",
|
||||
"File › Export… · File › Print… ({keys}).": "Archivo › Exportar… · Archivo › Imprimir… ({keys}).",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Regla {n} de {m}: {what}. Mover con las teclas de flecha",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupo {n} de {m}: coincidir con {mode}, {count} dentro. Mover con las teclas de flecha"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupo {n} de {m}: coincidir con {mode}, {count} dentro. Mover con las teclas de flecha",
|
||||
", rating {} of 5": ", valoración: {} de 5"
|
||||
}
|
||||
@@ -1760,7 +1760,8 @@
|
||||
"Watermark": "Marca de agua",
|
||||
"Wednesday": "Miércoles",
|
||||
"What's New": "Novedades",
|
||||
"When rated or hovered": "Al valorar o pasar el puntero",
|
||||
"Stars on hover": "Estrellas al pasar el puntero",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Estrellas al pasar el puntero: las marcas y las etiquetas de color se ven siempre; las estrellas y la marca de edición aparecen mientras una foto está bajo el puntero o seleccionada.",
|
||||
"White Balance": "Balance de blancos",
|
||||
"White Balance Selector": "Selector de balance de blancos",
|
||||
"White Balance Selector (W)": "Selector de balance de blancos (W)",
|
||||
@@ -2460,5 +2461,10 @@
|
||||
"Get Started": "Empezar",
|
||||
"Drag to move, or use the arrow keys": "Arrastra para mover, o usa las teclas de flecha",
|
||||
"A group can't go inside itself": "Un grupo no puede ir dentro de sí mismo",
|
||||
"Groups can't nest any deeper": "Los grupos no se pueden anidar más"
|
||||
"Groups can't nest any deeper": "Los grupos no se pueden anidar más",
|
||||
"Stack — click to expand (S)": "Pila — clic para expandir (S)",
|
||||
"Stack — click to collapse (S)": "Pila — clic para contraer (S)",
|
||||
"Virtual copy": "Copia virtual",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Clic derecho → Localizar archivo que falta… para encontrarlo de nuevo.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Clic derecho → Recargar desde el disco para intentarlo de nuevo."
|
||||
}
|
||||
@@ -22,7 +22,6 @@
|
||||
"+{} more": "+{} lisää",
|
||||
", {failed} file{} not readable": ", ei luettavissa olevia tiedostoja: {failed}{:.0}",
|
||||
", {} label": ", {} merkintä",
|
||||
", {} star{}": ", tähtiä {}{:.0}",
|
||||
"1 task is still running: {names}. Quitting stops it.": "1 tehtävä on yhä käynnissä: {names}. Lopettaminen pysäyttää sen.",
|
||||
"; {kept} already had a location": "; jo sijaintitiedolliset: {kept}",
|
||||
"; {n} gained synonyms": "; {n} sai synonyymejä",
|
||||
@@ -325,5 +324,6 @@
|
||||
"{n} folder{} could not be read": "Kansiot, joita ei voitu lukea: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "Ohitetut tiedostot (ei tuettu valokuvatyyppi): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Sääntö {n}/{m}: {what}. Siirrä nuolinäppäimillä",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Ryhmä {n}/{m}: täsmää {mode}, sisällä: {count}. Siirrä nuolinäppäimillä"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Ryhmä {n}/{m}: täsmää {mode}, sisällä: {count}. Siirrä nuolinäppäimillä",
|
||||
", rating {} of 5": ", luokitus: {} / 5"
|
||||
}
|
||||
@@ -2193,7 +2193,6 @@
|
||||
"Wednesday": "keskiviikko",
|
||||
"What's New": "Mitä uutta",
|
||||
"When pins show on the photo (Shift+H cycles)": "Milloin nastat näkyvät kuvassa (Shift+H vaihtaa)",
|
||||
"When rated or hovered": "Luokiteltaessa tai osoitettaessa",
|
||||
"White Balance": "Valkotasapaino",
|
||||
"White Balance Selector": "Valkotasapainon valitsin",
|
||||
"White Balance Selector (W)": "Valkotasapainon valitsin (W)",
|
||||
@@ -2417,5 +2416,12 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Skannauksen raja saavutettiin: valokuvia voi olla lisää",
|
||||
"Drag to move, or use the arrow keys": "Siirrä vetämällä tai käytä nuolinäppäimiä",
|
||||
"A group can't go inside itself": "Ryhmää ei voi siirtää itsensä sisään",
|
||||
"Groups can't nest any deeper": "Ryhmiä ei voi sisentää syvemmälle"
|
||||
"Groups can't nest any deeper": "Ryhmiä ei voi sisentää syvemmälle",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Napsauta hiiren kakkospainikkeella → Paikanna puuttuva tiedosto… löytääksesi sen uudelleen.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Napsauta hiiren kakkospainikkeella → Lataa levyltä uudelleen yrittääksesi uudelleen.",
|
||||
"Stack — click to collapse (S)": "Pino — napsauta tiivistääksesi (S)",
|
||||
"Stack — click to expand (S)": "Pino — napsauta laajentaaksesi (S)",
|
||||
"Stars on hover": "Tähdet osoitettaessa",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Tähdet osoitettaessa: liput ja värimerkinnät näkyvät aina; tähdet ja muokattu-merkki näkyvät, kun kuvaa osoitetaan tai se on valittuna.",
|
||||
"Virtual copy": "Virtuaalikopio"
|
||||
}
|
||||
@@ -205,7 +205,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "{n} photo{} similaire(s) · Affichage → Effacer les filtres pour tout voir",
|
||||
"Moved; {} photo(s) relinked": "Déplacé ; {} photo(s) de nouveau associée(s)",
|
||||
"{} label (click more labels to show any of them)": "Étiquette {} (cliquez sur « autres étiquettes » pour afficher celles de votre choix)",
|
||||
", {} star{}": ", {} étoile{}",
|
||||
", {} label": ", étiquette {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Téléchargement depuis {host}. Une fois le téléchargement terminé et vérifié, LightCraft l’installe, {after}.",
|
||||
"{:.1} MB": "{:.1} Mo",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "Affichage › Vue de détail ({keys}).",
|
||||
"File › Export… · File › Print… ({keys}).": "Fichier › Exporter… · Fichier › Imprimer… ({keys}).",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Règle {n} sur {m} : {what}. Déplacer avec les flèches",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Groupe {n} sur {m} : correspondre à {mode}, {count} à l’intérieur. Déplacer avec les flèches"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Groupe {n} sur {m} : correspondre à {mode}, {count} à l’intérieur. Déplacer avec les flèches",
|
||||
", rating {} of 5": ", note : {} sur 5"
|
||||
}
|
||||
@@ -1580,7 +1580,8 @@
|
||||
"Watermark": "Filigrane",
|
||||
"Wednesday": "Mercredi",
|
||||
"What's New": "Nouveautés",
|
||||
"When rated or hovered": "Lors de la notation ou du survol",
|
||||
"Stars on hover": "Étoiles au survol",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Étoiles au survol : les drapeaux et les étiquettes de couleur sont toujours visibles ; les étoiles et la marque de retouche apparaissent quand une photo est survolée ou sélectionnée.",
|
||||
"White Balance": "Balance des blancs",
|
||||
"White Balance Selector": "Sélecteur de balance des blancs",
|
||||
"White Balance Selector (W)": "Sélecteur de balance des blancs (W)",
|
||||
@@ -3643,5 +3644,10 @@
|
||||
"Get Started": "Commencer",
|
||||
"Drag to move, or use the arrow keys": "Faites glisser pour déplacer, ou utilisez les flèches",
|
||||
"A group can't go inside itself": "Un groupe ne peut pas se placer dans lui-même",
|
||||
"Groups can't nest any deeper": "Les groupes ne peuvent pas être imbriqués plus profondément"
|
||||
"Groups can't nest any deeper": "Les groupes ne peuvent pas être imbriqués plus profondément",
|
||||
"Stack — click to expand (S)": "Pile — cliquer pour déplier (S)",
|
||||
"Stack — click to collapse (S)": "Pile — cliquer pour replier (S)",
|
||||
"Virtual copy": "Copie virtuelle",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Clic droit → Localiser le fichier manquant… pour le retrouver.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Clic droit → Recharger depuis le disque pour réessayer."
|
||||
}
|
||||
@@ -206,7 +206,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "{n} foto serupa{:.0} · Tampilan → Hapus filter untuk melihat semua",
|
||||
"Moved; {} photo(s) relinked": "Dipindahkan; {} foto ditautkan ulang",
|
||||
"{} label (click more labels to show any of them)": "Label {} (klik label lain untuk ikut menampilkan foto berlabel tersebut)",
|
||||
", {} star{}": ", {} bintang{:.0}",
|
||||
", {} label": ", label {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Diunduh dari {host}. Setelah selesai diunduh dan lolos pemeriksaan, LightCraft akan menginstalnya, {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -328,5 +327,6 @@
|
||||
"{n} folder{} could not be read": "Folder yang tidak bisa dibaca: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "File yang dilewati (bukan jenis foto yang didukung): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Aturan {n} dari {m}: {what}. Pindahkan dengan tombol panah",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grup {n} dari {m}: cocokkan {mode}, isi: {count}. Pindahkan dengan tombol panah"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grup {n} dari {m}: cocokkan {mode}, isi: {count}. Pindahkan dengan tombol panah",
|
||||
", rating {} of 5": ", rating: {} dari 5"
|
||||
}
|
||||
@@ -2186,7 +2186,6 @@
|
||||
"We": "Rb",
|
||||
"Wednesday": "Rabu",
|
||||
"What's New": "Yang baru",
|
||||
"When rated or hovered": "Saat diberi rating atau saat kursor di atasnya",
|
||||
"White Balance": "Keseimbangan putih",
|
||||
"White Balance Selector": "Pemilih keseimbangan putih",
|
||||
"White Balance Selector (W)": "Pemilih keseimbangan putih (W)",
|
||||
@@ -2431,5 +2430,12 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Berhenti pada batas pemindaian: mungkin masih ada foto",
|
||||
"Drag to move, or use the arrow keys": "Seret untuk memindahkan, atau gunakan tombol panah",
|
||||
"A group can't go inside itself": "Grup tidak dapat dimasukkan ke dalam dirinya sendiri",
|
||||
"Groups can't nest any deeper": "Grup tidak dapat disarangkan lebih dalam"
|
||||
"Groups can't nest any deeper": "Grup tidak dapat disarangkan lebih dalam",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Klik kanan → Temukan file hilang… untuk menemukannya lagi.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Klik kanan → Muat ulang dari disk untuk mencoba lagi.",
|
||||
"Stack — click to collapse (S)": "Tumpukan — klik untuk menciutkan (S)",
|
||||
"Stack — click to expand (S)": "Tumpukan — klik untuk meluaskan (S)",
|
||||
"Stars on hover": "Bintang saat kursor di atas",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Bintang saat kursor di atas: bendera dan label warna selalu tampil; bintang dan tanda telah diedit muncul saat kursor berada di atas foto atau foto dipilih.",
|
||||
"Virtual copy": "Salinan virtual"
|
||||
}
|
||||
@@ -199,7 +199,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "Foto simili: {n}{:.0} · Visualizza → Cancella filtri per vederle tutte",
|
||||
"Moved; {} photo(s) relinked": "Spostata; foto ricollegate: {}",
|
||||
"{} label (click more labels to show any of them)": "Etichetta {} (fai clic su altre etichette per mostrarne una qualsiasi)",
|
||||
", {} star{}": ", stelle: {}{:.0}",
|
||||
", {} label": ", etichetta {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Scaricato da {host}. Quando è arrivato ed è stato verificato, LightCraft lo installa e {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -328,5 +327,6 @@
|
||||
"{n} folder{} could not be read": "Cartelle non leggibili: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "File saltati (non è un tipo di foto supportato): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Regola {n} di {m}: {what}. Sposta con le frecce",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Gruppo {n} di {m}: corrispondenza {mode}, {count} all’interno. Sposta con le frecce"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Gruppo {n} di {m}: corrispondenza {mode}, {count} all’interno. Sposta con le frecce",
|
||||
", rating {} of 5": ", valutazione: {} su 5"
|
||||
}
|
||||
@@ -1611,7 +1611,8 @@
|
||||
"Watermark": "Filigrana",
|
||||
"Wednesday": "Mercoledì",
|
||||
"What's New": "Novità",
|
||||
"When rated or hovered": "Quando ha una valutazione o è sotto il puntatore",
|
||||
"Stars on hover": "Stelle al passaggio",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Stelle al passaggio: i contrassegni e le etichette colore sono sempre visibili; le stelle e il segno di modifica compaiono quando la foto è sotto il puntatore o selezionata.",
|
||||
"White Balance": "Bilanciamento del bianco",
|
||||
"White Balance Selector": "Selettore del bilanciamento del bianco",
|
||||
"White Balance Selector (W)": "Selettore del bilanciamento del bianco (W)",
|
||||
@@ -2624,5 +2625,10 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Fermati al limite di scansione: potrebbero esserci altre foto",
|
||||
"Drag to move, or use the arrow keys": "Trascina per spostare, oppure usa le frecce",
|
||||
"A group can't go inside itself": "Un gruppo non può stare dentro se stesso",
|
||||
"Groups can't nest any deeper": "I gruppi non si possono annidare più in profondità"
|
||||
"Groups can't nest any deeper": "I gruppi non si possono annidare più in profondità",
|
||||
"Stack — click to expand (S)": "Pila — clic per espandere (S)",
|
||||
"Stack — click to collapse (S)": "Pila — clic per comprimere (S)",
|
||||
"Virtual copy": "Copia virtuale",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Clic destro → Trova file mancante… per ritrovarlo.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Clic destro → Ricarica dal disco per riprovare."
|
||||
}
|
||||
@@ -209,7 +209,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "似た写真{n}枚{:.0}・すべて表示するには「表示 → フィルターを解除」",
|
||||
"Moved; {} photo(s) relinked": "移動しました。{}枚の写真の参照先を更新しました",
|
||||
"{} label (click more labels to show any of them)": "{}ラベル(ほかのラベルもクリックすると、いずれかに一致する写真を表示)",
|
||||
", {} star{}": "、星{}つ{:.0}",
|
||||
", {} label": "、{}ラベル",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "{host} からダウンロードします。届いて確認が済むと、LightCraft がインストールし、{after}。",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "表示 › 詳細表示 ({keys})。",
|
||||
"File › Export… · File › Print… ({keys}).": "ファイル › 書き出す… · ファイル › 印刷… ({keys})。",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "条件 {n}/{m}:{what}。矢印キーで移動",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "グループ {n}/{m}:一致条件 {mode}、中に {count} 件。矢印キーで移動"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "グループ {n}/{m}:一致条件 {mode}、中に {count} 件。矢印キーで移動",
|
||||
", rating {} of 5": "、評価: 5段階中{}"
|
||||
}
|
||||
@@ -1507,7 +1507,8 @@
|
||||
"Watched folder": "監視フォルダ",
|
||||
"Watermark": "透かし",
|
||||
"What's New": "新着情報",
|
||||
"When rated or hovered": "評価時またはカーソルを合わせたとき",
|
||||
"Stars on hover": "星はカーソルを合わせたとき",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "星はカーソルを合わせたとき:フラグとカラーラベルは常に表示され、星と編集済みマークは写真にカーソルを合わせたか選択したときに表示されます。",
|
||||
"White Balance": "ホワイトバランス",
|
||||
"White Balance Selector": "ホワイトバランス選択",
|
||||
"White Balance Selector (W)": "ホワイトバランス選択(W)",
|
||||
@@ -2458,5 +2459,10 @@
|
||||
"Get Started": "始める",
|
||||
"Drag to move, or use the arrow keys": "ドラッグして移動、または矢印キーを使います",
|
||||
"A group can't go inside itself": "グループを自分自身の中に入れることはできません",
|
||||
"Groups can't nest any deeper": "グループはこれ以上深く入れ子にできません"
|
||||
"Groups can't nest any deeper": "グループはこれ以上深く入れ子にできません",
|
||||
"Stack — click to expand (S)": "スタック — クリックして展開 (S)",
|
||||
"Stack — click to collapse (S)": "スタック — クリックして折りたたむ (S)",
|
||||
"Virtual copy": "仮想コピー",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "右クリック → 見つからないファイルを指定… で、ファイルをもう一度指定できます。",
|
||||
"Right-click ▸ Reload from Disk to try again.": "右クリック → ディスクから再読み込み で、もう一度試せます。"
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
"+{} more": "+ კიდევ {}",
|
||||
", {failed} file{} not readable": ", ვერ იკითხება ფაილი: {failed}{:.0}",
|
||||
", {} label": ", იარლიყი: {}",
|
||||
", {} star{}": ", ვარსკვლავი: {}{:.0}",
|
||||
"1 task is still running: {names}. Quitting stops it.": "ჯერ კიდევ მიმდინარეობს 1 ამოცანა: {names}. გასვლა მას შეწყვეტს.",
|
||||
"; {kept} already had a location": "; მდებარეობა უკვე ჰქონდა: {kept}",
|
||||
"; {n} gained synonyms": "; სინონიმები დაემატა: {n}",
|
||||
@@ -331,5 +330,6 @@
|
||||
"{n} folder{} could not be read": "საქაღალდეები, რომლებიც ვერ წაიკითხა: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "გამოტოვებული ფაილები (მხარდაუჭერელი ფოტოს ტიპია): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "წესი {n}/{m}: {what}. გადაადგილება ისრებით",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "ჯგუფი {n}/{m}: დამთხვევა {mode}, შიგნით {count}. გადაადგილება ისრებით"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "ჯგუფი {n}/{m}: დამთხვევა {mode}, შიგნით {count}. გადაადგილება ისრებით",
|
||||
", rating {} of 5": ", შეფასება: {} 5-დან"
|
||||
}
|
||||
@@ -2283,7 +2283,8 @@
|
||||
"What's New": "რა არის ახალი",
|
||||
"When GPU rendering is on but no graphics processor can be found, LightCraft now says so once at start-up instead": "როცა GPU რენდერი ჩართულია, მაგრამ გრაფიკული პროცესორი ვერ მოიძებნა, LightCraft ახლა ამას გაშვებისას ერთხელ გეუბნებათ, ნაცვლად იმისა,",
|
||||
"When a folder holds several file types, the Import Photos review has a toggle per type (`ARW · 120`, `JPG · 120`):": "როცა საქაღალდეში რამდენიმე ტიპის ფაილია, ფოტოების იმპორტის მიმოხილვას თითო ტიპზე გადამრთველი აქვს (`ARW · 120`, `JPG · 120`):",
|
||||
"When rated or hovered": "შეფასებისას ან კურსორის მიტანისას",
|
||||
"Stars on hover": "ვარსკვლავები კურსორის მიტანისას",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "ვარსკვლავები კურსორის მიტანისას: დროშები და ფერადი ჭდეები ყოველთვის ჩანს; ვარსკვლავები და რედაქტირების ნიშანი ჩნდება, როცა ფოტო კურსორის ქვეშაა ან მონიშნულია.",
|
||||
"White Balance": "თეთრის ბალანსი",
|
||||
"White Balance Selector": "თეთრის ბალანსის ამრჩევი",
|
||||
"White Balance Selector (W)": "თეთრის ბალანსის ამრჩევი (W)",
|
||||
@@ -3726,5 +3727,10 @@
|
||||
"Stopped at the scan limit: there may be more photos": "სკანირების ლიმიტზე გაჩერდა: შესაძლოა სხვა ფოტოებიც არის",
|
||||
"Drag to move, or use the arrow keys": "გადასატანად გადაიტანეთ ან გამოიყენეთ ისრები",
|
||||
"A group can't go inside itself": "ჯგუფს საკუთარ თავში ვერ ჩადებთ",
|
||||
"Groups can't nest any deeper": "ჯგუფების უფრო ღრმად ჩადგმა შეუძლებელია"
|
||||
"Groups can't nest any deeper": "ჯგუფების უფრო ღრმად ჩადგმა შეუძლებელია",
|
||||
"Stack — click to expand (S)": "დასტა — დააწკაპუნეთ გასაშლელად (S)",
|
||||
"Stack — click to collapse (S)": "დასტა — დააწკაპუნეთ ჩასაკეცად (S)",
|
||||
"Virtual copy": "ვირტუალური ასლი",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "მარჯვენა დაწკაპუნება → დაკარგული ფაილის მოძებნა… ფაილის ხელახლა საპოვნელად.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "მარჯვენა დაწკაპუნება → დისკიდან ხელახლა ჩატვირთვა, ხელახლა საცდელად."
|
||||
}
|
||||
@@ -190,7 +190,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "Podobne zdjęcia: {n}{:.0} · Widok → Wyczyść filtry, aby zobaczyć wszystkie",
|
||||
"Moved; {} photo(s) relinked": "Przeniesiono; ponownie powiązane zdjęcia: {}",
|
||||
"{} label (click more labels to show any of them)": "{} etykieta (kliknij kolejne etykiety, aby wyświetlić dowolną z nich)",
|
||||
", {} star{}": ", gwiazdki: {}{:.0}",
|
||||
", {} label": ", {} etykieta",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Pobieranie z {host}. Po pobraniu i weryfikacji LightCraft zainstaluje plik, {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -328,5 +327,6 @@
|
||||
"{n} folder{} could not be read": "Nie udało się odczytać folderów: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "Pominięte pliki (nieobsługiwany typ zdjęcia): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Reguła {n} z {m}: {what}. Przenoś strzałkami",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupa {n} z {m}: dopasuj {mode}, w środku {count}. Przenoś strzałkami"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupa {n} z {m}: dopasuj {mode}, w środku {count}. Przenoś strzałkami",
|
||||
", rating {} of 5": ", ocena: {} na 5"
|
||||
}
|
||||
@@ -1545,7 +1545,8 @@
|
||||
"Watermark": "Znak wodny",
|
||||
"Wednesday": "Środa",
|
||||
"What's New": "Co nowego",
|
||||
"When rated or hovered": "Po ocenieniu lub wskazaniu kursorem",
|
||||
"Stars on hover": "Gwiazdki po wskazaniu",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Gwiazdki po wskazaniu: flagi i kolorowe etykiety są widoczne zawsze; gwiazdki i znak edycji pojawiają się, gdy zdjęcie jest wskazane kursorem lub zaznaczone.",
|
||||
"White Balance": "Balans bieli",
|
||||
"White Balance Selector": "Próbnik balansu bieli",
|
||||
"White Balance Selector (W)": "Próbnik balansu bieli (W)",
|
||||
@@ -2383,5 +2384,10 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Zatrzymano na limicie skanowania: możliwe, że jest więcej zdjęć",
|
||||
"Drag to move, or use the arrow keys": "Przeciągnij, aby przenieść, lub użyj strzałek",
|
||||
"A group can't go inside itself": "Grupa nie może znaleźć się wewnątrz samej siebie",
|
||||
"Groups can't nest any deeper": "Grup nie można zagnieżdżać głębiej"
|
||||
"Groups can't nest any deeper": "Grup nie można zagnieżdżać głębiej",
|
||||
"Stack — click to expand (S)": "Stos — kliknij, aby rozwinąć (S)",
|
||||
"Stack — click to collapse (S)": "Stos — kliknij, aby zwinąć (S)",
|
||||
"Virtual copy": "Kopia wirtualna",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Kliknij prawym przyciskiem → Znajdź brakujący plik…, aby go odnaleźć ponownie.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Kliknij prawym przyciskiem → Wczytaj ponownie z dysku, aby spróbować jeszcze raz."
|
||||
}
|
||||
@@ -209,7 +209,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "{n} foto{0} semelhante{0} · Exibir → Limpar filtros para ver todas",
|
||||
"Moved; {} photo(s) relinked": "Movida; {} foto(s) vinculada(s) novamente",
|
||||
"{} label (click more labels to show any of them)": "Rótulo {} (clique em mais rótulos para mostrar qualquer um deles)",
|
||||
", {} star{}": ", {} estrela{}",
|
||||
", {} label": ", rótulo {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Faz o download de {host}. Depois que chegar e for verificado, o LightCraft o instala e {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "Exibir › Exibição de detalhe ({keys}).",
|
||||
"File › Export… · File › Print… ({keys}).": "Arquivo › Exportar… · Arquivo › Imprimir… ({keys}).",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Regra {n} de {m}: {what}. Mova com as setas",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupo {n} de {m}: igualar {mode}, {count} dentro. Mova com as setas"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupo {n} de {m}: igualar {mode}, {count} dentro. Mova com as setas",
|
||||
", rating {} of 5": ", avaliação: {} de 5"
|
||||
}
|
||||
@@ -1604,7 +1604,8 @@
|
||||
"Watermark": "Marca d'água",
|
||||
"Wednesday": "Quarta-feira",
|
||||
"What's New": "Novidades",
|
||||
"When rated or hovered": "Ao avaliar ou passar o mouse",
|
||||
"Stars on hover": "Estrelas ao passar o mouse",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Estrelas ao passar o mouse: sinalizadores e etiquetas de cor sempre aparecem; as estrelas e a marca de edição aparecem enquanto a foto está sob o mouse ou selecionada.",
|
||||
"White Balance": "Balanço de branco",
|
||||
"White Balance Selector": "Seletor de balanço de branco",
|
||||
"White Balance Selector (W)": "Seletor de balanço de branco (W)",
|
||||
@@ -2304,5 +2305,10 @@
|
||||
"Get Started": "Começar",
|
||||
"Drag to move, or use the arrow keys": "Arraste para mover ou use as setas",
|
||||
"A group can't go inside itself": "Um grupo não pode ficar dentro de si mesmo",
|
||||
"Groups can't nest any deeper": "Os grupos não podem ser aninhados mais fundo"
|
||||
"Groups can't nest any deeper": "Os grupos não podem ser aninhados mais fundo",
|
||||
"Stack — click to expand (S)": "Pilha — clique para expandir (S)",
|
||||
"Stack — click to collapse (S)": "Pilha — clique para recolher (S)",
|
||||
"Virtual copy": "Cópia virtual",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Clique com o botão direito → Localizar arquivo ausente… para encontrá-lo de novo.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Clique com o botão direito → Recarregar do disco para tentar de novo."
|
||||
}
|
||||
@@ -14,7 +14,6 @@
|
||||
"+{} more": "+{} ещё",
|
||||
", {failed} file{} not readable": ", не читается файлов: {failed}{:.0}",
|
||||
", {} label": ", метка: {}",
|
||||
", {} star{}": ", звёзд: {}{:.0}",
|
||||
"; {kept} already had a location": "; уже имели местоположение: {kept}",
|
||||
"; {outside} outside its time range": "; вне временного диапазона трека: {outside}",
|
||||
"@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}": "@{}: PR: {}, коммитов: {}, строк: +{} / −{} (Δ {}), бинарных файлов: +{} / −{}, {} – {}",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "Вид › Режим детализации ({keys}).",
|
||||
"File › Export… · File › Print… ({keys}).": "Файл › Экспорт… · Файл › Печать… ({keys}).",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Условие {n} из {m}: {what}. Перемещение стрелками",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Группа {n} из {m}: совпадение {mode}, внутри {count}. Перемещение стрелками"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Группа {n} из {m}: совпадение {mode}, внутри {count}. Перемещение стрелками",
|
||||
", rating {} of 5": ", оценка: {} из 5"
|
||||
}
|
||||
@@ -1560,7 +1560,8 @@
|
||||
"Watermark": "Водяной знак",
|
||||
"Wednesday": "Среда",
|
||||
"What's New": "Что нового",
|
||||
"When rated or hovered": "При оценке или наведении",
|
||||
"Stars on hover": "Звёзды при наведении",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Звёзды при наведении: флаги и цветные метки видны всегда; звёзды и значок правки появляются, пока фото под курсором или выбрано.",
|
||||
"White Balance": "Баланс белого",
|
||||
"White Balance Selector": "Пипетка баланса белого",
|
||||
"White Balance Selector (W)": "Пипетка баланса белого (W)",
|
||||
@@ -2666,5 +2667,10 @@
|
||||
"Get Started": "Начать",
|
||||
"Drag to move, or use the arrow keys": "Перетащите, чтобы переместить, или используйте стрелки",
|
||||
"A group can't go inside itself": "Группу нельзя поместить внутрь самой себя",
|
||||
"Groups can't nest any deeper": "Группы нельзя вкладывать глубже"
|
||||
"Groups can't nest any deeper": "Группы нельзя вкладывать глубже",
|
||||
"Stack — click to expand (S)": "Стопка — щёлкните, чтобы развернуть (S)",
|
||||
"Stack — click to collapse (S)": "Стопка — щёлкните, чтобы свернуть (S)",
|
||||
"Virtual copy": "Виртуальная копия",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Щёлкните правой кнопкой → Указать отсутствующий файл…, чтобы найти его снова.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Щёлкните правой кнопкой → Перезагрузить с диска, чтобы повторить попытку."
|
||||
}
|
||||
@@ -22,7 +22,6 @@
|
||||
"+{} more": "+{} till",
|
||||
", {failed} file{} not readable": ", {failed} fil{} kunde inte läsas",
|
||||
", {} label": ", {} etikett",
|
||||
", {} star{}": ", {} stjärna{}",
|
||||
"1 task is still running: {names}. Quitting stops it.": "1 uppgift körs fortfarande: {names}. Om du avslutar stoppas den.",
|
||||
"; {kept} already had a location": "; {kept} hade redan en plats",
|
||||
"; {n} gained synonyms": "; {n} fick synonymer",
|
||||
@@ -328,5 +327,6 @@
|
||||
"{n} folder{} could not be read": "Mappar som inte gick att läsa: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "Hoppade över filer (fotoformat som inte stöds): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Regel {n} av {m}: {what}. Flytta med piltangenterna",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupp {n} av {m}: matcha {mode}, antal i gruppen: {count}. Flytta med piltangenterna"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Grupp {n} av {m}: matcha {mode}, antal i gruppen: {count}. Flytta med piltangenterna",
|
||||
", rating {} of 5": ", betyg: {} av 5"
|
||||
}
|
||||
@@ -2380,7 +2380,6 @@
|
||||
"were missing, without touching anything already set.": "saknades, utan att röra något som redan var angivet.",
|
||||
"What's New": "Nyheter",
|
||||
"When pins show on the photo (Shift+H cycles)": "När nålar visas på fotot (Shift+H växlar)",
|
||||
"When rated or hovered": "När det har betyg eller pekaren är över",
|
||||
"when the browser may evict the library. Hosting: the sample cache headers no longer mark the (unhashed) files": "när webbläsaren kan rensa bort biblioteket. Webbhotell: exemplets cache-huvuden markerar inte längre de (ohashade) filerna",
|
||||
"whether originals are there is checked on a worker thread (grid thumbnails, the Info panel, the photo menu, Missing": "om originalen finns kontrolleras i en arbetstråd (rutnätsminiatyrer, panelen Info, fotomenyn, Saknas",
|
||||
"White Balance": "Vitbalans",
|
||||
@@ -2521,5 +2520,12 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Stoppade vid skanningsgränsen: det kan finnas fler foton",
|
||||
"Drag to move, or use the arrow keys": "Dra för att flytta, eller använd piltangenterna",
|
||||
"A group can't go inside itself": "En grupp kan inte läggas inuti sig själv",
|
||||
"Groups can't nest any deeper": "Grupper kan inte nästlas djupare"
|
||||
"Groups can't nest any deeper": "Grupper kan inte nästlas djupare",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Högerklicka → Leta upp saknad fil… för att hitta den igen.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Högerklicka → Läs in igen från disk för att försöka igen.",
|
||||
"Stack — click to collapse (S)": "Stapel — klicka för att komprimera (S)",
|
||||
"Stack — click to expand (S)": "Stapel — klicka för att expandera (S)",
|
||||
"Stars on hover": "Stjärnor vid pekaren",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Stjärnor vid pekaren: flaggor och färgetiketter visas alltid; stjärnorna och märket för redigerad visas när pekaren är över ett foto eller när det är markerat.",
|
||||
"Virtual copy": "Virtuell kopia"
|
||||
}
|
||||
@@ -205,7 +205,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "Подібних фото: {n}{:.0} · Вигляд → Скинути фільтри, щоб побачити всі",
|
||||
"Moved; {} photo(s) relinked": "Переміщено; повторно пов’язано фото: {}",
|
||||
"{} label (click more labels to show any of them)": "Мітка «{}» (клацніть інші мітки, щоб показати фото з будь-якою з них)",
|
||||
", {} star{}": ", зірок: {}{:.0}",
|
||||
", {} label": ", мітка: {}",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Завантажується з {host}. Після отримання й перевірки LightCraft установлює модель, {after}.",
|
||||
"{:.1} MB": "{:.1} МБ",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "Вигляд › Детальне подання ({keys}).",
|
||||
"File › Export… · File › Print… ({keys}).": "Файл › Експортувати… · Файл › Друк… ({keys}).",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Правило {n} з {m}: {what}. Переміщення стрілками",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Група {n} з {m}: збіг {mode}, усередині {count}. Переміщення стрілками"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Група {n} з {m}: збіг {mode}, усередині {count}. Переміщення стрілками",
|
||||
", rating {} of 5": ", оцінка: {} з 5"
|
||||
}
|
||||
@@ -1537,7 +1537,8 @@
|
||||
"Watched folder": "Відстежувана тека",
|
||||
"Watermark": "Водяний знак",
|
||||
"What's New": "Що нового",
|
||||
"When rated or hovered": "Після оцінювання або наведення",
|
||||
"Stars on hover": "Зірки при наведенні",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Зірки при наведенні: прапорці й кольорові мітки видно завжди; зірки та позначка редагування з’являються, поки фото під курсором або вибране.",
|
||||
"White Balance": "Баланс білого",
|
||||
"White Balance Selector": "Вибір балансу білого",
|
||||
"White Balance Selector (W)": "Вибір балансу білого (W)",
|
||||
@@ -2456,5 +2457,10 @@
|
||||
"Get Started": "Почати",
|
||||
"Drag to move, or use the arrow keys": "Перетягніть, щоб перемістити, або скористайтеся стрілками",
|
||||
"A group can't go inside itself": "Групу не можна помістити саму в себе",
|
||||
"Groups can't nest any deeper": "Групи не можна вкладати глибше"
|
||||
"Groups can't nest any deeper": "Групи не можна вкладати глибше",
|
||||
"Stack — click to expand (S)": "Стос — клацніть, щоб розгорнути (S)",
|
||||
"Stack — click to collapse (S)": "Стос — клацніть, щоб згорнути (S)",
|
||||
"Virtual copy": "Віртуальна копія",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Клацніть правою кнопкою → Знайти відсутній файл…, щоб знайти його знову.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Клацніть правою кнопкою → Перезавантажити з диска, щоб спробувати ще раз."
|
||||
}
|
||||
@@ -22,7 +22,6 @@
|
||||
"+{} more": "+{} nữa",
|
||||
", {failed} file{} not readable": ", {failed} tệp{:.0} không đọc được",
|
||||
", {} label": ", nhãn {}",
|
||||
", {} star{}": ", {} sao{:.0}",
|
||||
"1 task is still running: {names}. Quitting stops it.": "Còn 1 tác vụ đang chạy: {names}. Thoát sẽ dừng tác vụ.",
|
||||
"; {kept} already had a location": "; {kept} đã có vị trí",
|
||||
"; {n} gained synonyms": "; {n} có thêm từ đồng nghĩa",
|
||||
@@ -325,5 +324,6 @@
|
||||
"{n} folder{} could not be read": "Thư mục không đọc được: {n}{:.0}",
|
||||
"{n} file{} skipped (not a supported photo type)": "Đã bỏ qua tệp (không phải loại ảnh được hỗ trợ): {n}{:.0}",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "Quy tắc {n}/{m}: {what}. Di chuyển bằng phím mũi tên",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Nhóm {n}/{m}: khớp {mode}, bên trong: {count}. Di chuyển bằng phím mũi tên"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "Nhóm {n}/{m}: khớp {mode}, bên trong: {count}. Di chuyển bằng phím mũi tên",
|
||||
", rating {} of 5": ", xếp hạng: {} trên 5"
|
||||
}
|
||||
@@ -2003,7 +2003,6 @@
|
||||
"We": "T4",
|
||||
"Wednesday": "Thứ Tư",
|
||||
"What's New": "Có gì mới",
|
||||
"When rated or hovered": "Khi đã xếp hạng hoặc rê chuột",
|
||||
"White Balance": "Cân bằng trắng",
|
||||
"White Balance Selector": "Bộ chọn cân bằng trắng",
|
||||
"White Balance Selector (W)": "Bộ chọn cân bằng trắng (W)",
|
||||
@@ -2745,5 +2744,12 @@
|
||||
"Stopped at the scan limit: there may be more photos": "Đã dừng ở giới hạn quét: có thể còn ảnh khác",
|
||||
"Drag to move, or use the arrow keys": "Kéo để di chuyển, hoặc dùng phím mũi tên",
|
||||
"A group can't go inside itself": "Nhóm không thể nằm trong chính nó",
|
||||
"Groups can't nest any deeper": "Không thể lồng nhóm sâu hơn"
|
||||
"Groups can't nest any deeper": "Không thể lồng nhóm sâu hơn",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "Nhấp chuột phải → Định vị tệp bị thiếu… để tìm lại.",
|
||||
"Right-click ▸ Reload from Disk to try again.": "Nhấp chuột phải → Tải lại từ đĩa để thử lại.",
|
||||
"Stack — click to collapse (S)": "Chồng — nhấp để thu gọn (S)",
|
||||
"Stack — click to expand (S)": "Chồng — nhấp để mở rộng (S)",
|
||||
"Stars on hover": "Sao khi rê chuột",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "Sao khi rê chuột: cờ và nhãn màu luôn hiển thị; sao và dấu đã chỉnh sửa xuất hiện khi ảnh được rê chuột qua hoặc được chọn.",
|
||||
"Virtual copy": "Bản sao ảo"
|
||||
}
|
||||
@@ -209,7 +209,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "{n} 张相似照片{0:.0} · 选择“视图 → 清除过滤器”可查看全部",
|
||||
"Moved; {} photo(s) relinked": "已移动;已重新链接 {0} 张照片",
|
||||
"{} label (click more labels to show any of them)": "{0}标签(单击更多标签可显示符合其中任一标签的照片)",
|
||||
", {} star{}": ",{0} 星{1:.0}",
|
||||
", {} label": ",{0}标签",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "从 {host} 下载。下载完成并通过校验后,LightCraft 会进行安装,{after}。",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "视图 › 详细视图 ({keys})。",
|
||||
"File › Export… · File › Print… ({keys}).": "文件 › 导出… · 文件 › 打印… ({keys})。",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "规则 {n}/{m}:{what}。用方向键移动",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "组 {n}/{m}:匹配{mode},内含 {count} 项。用方向键移动"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "组 {n}/{m}:匹配{mode},内含 {count} 项。用方向键移动",
|
||||
", rating {} of 5": ",评分:{}/5"
|
||||
}
|
||||
@@ -1580,7 +1580,8 @@
|
||||
"Watermark": "水印",
|
||||
"Wednesday": "星期三",
|
||||
"What's New": "新功能",
|
||||
"When rated or hovered": "评级或悬停时",
|
||||
"Stars on hover": "悬停时显示星级",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "悬停时显示星级:旗标和颜色标签始终显示;星级和已编辑标记在照片被悬停或选中时显示。",
|
||||
"White Balance": "白平衡",
|
||||
"White Balance Selector": "白平衡选择器",
|
||||
"White Balance Selector (W)": "白平衡选择器 (W)",
|
||||
@@ -2459,5 +2460,10 @@
|
||||
"Get Started": "开始使用",
|
||||
"Drag to move, or use the arrow keys": "拖动以移动,或使用方向键",
|
||||
"A group can't go inside itself": "组不能放入它自己里面",
|
||||
"Groups can't nest any deeper": "组不能再嵌套得更深"
|
||||
"Groups can't nest any deeper": "组不能再嵌套得更深",
|
||||
"Stack — click to expand (S)": "堆叠 — 单击展开 (S)",
|
||||
"Stack — click to collapse (S)": "堆叠 — 单击折叠 (S)",
|
||||
"Virtual copy": "虚拟副本",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "右键单击 → 定位缺失的文件…,即可重新找到它。",
|
||||
"Right-click ▸ Reload from Disk to try again.": "右键单击 → 从磁盘重新读取,即可重试。"
|
||||
}
|
||||
@@ -209,7 +209,6 @@
|
||||
"{n} similar photo{} · View ▸ Clear Filters to see all": "{n} 張相似照片{:.0} · 選擇「檢視 → 清除篩選條件」可查看全部",
|
||||
"Moved; {} photo(s) relinked": "已移動;已重新連結 {} 張照片",
|
||||
"{} label (click more labels to show any of them)": "{}標籤(點擊更多標籤可顯示符合其中任一標籤的照片)",
|
||||
", {} star{}": ",{} 顆星{:.0}",
|
||||
", {} label": ",{}標籤",
|
||||
"Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.": "Downloads from {host}. Once it has arrived and checked out, LightCraft installs it, {after}.",
|
||||
"{:.1} MB": "{:.1} MB",
|
||||
@@ -329,5 +328,6 @@
|
||||
"View › Detail View ({keys}).": "檢視 › 詳細檢視 ({keys})。",
|
||||
"File › Export… · File › Print… ({keys}).": "檔案 › 匯出… · 檔案 › 列印… ({keys})。",
|
||||
"Rule {n} of {m}: {what}. Move with the arrow keys": "規則 {n}/{m}:{what}。用方向鍵移動",
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "群組 {n}/{m}:符合{mode},內含 {count} 項。用方向鍵移動"
|
||||
"Group {n} of {m}: match {mode}, {count} inside. Move with the arrow keys": "群組 {n}/{m}:符合{mode},內含 {count} 項。用方向鍵移動",
|
||||
", rating {} of 5": ",評分:{}/5"
|
||||
}
|
||||
@@ -1586,7 +1586,8 @@
|
||||
"Watermark": "浮水印",
|
||||
"Wednesday": "星期三",
|
||||
"What's New": "新增功能",
|
||||
"When rated or hovered": "評分或游標停留時",
|
||||
"Stars on hover": "游標停留時顯示星級",
|
||||
"Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.": "游標停留時顯示星級:旗標和顏色標籤一律顯示;星級和已編輯標記在照片被游標停留或選取時顯示。",
|
||||
"White Balance": "白平衡",
|
||||
"White Balance Selector": "白平衡選取器",
|
||||
"White Balance Selector (W)": "白平衡選取器(W)",
|
||||
@@ -2460,5 +2461,10 @@
|
||||
"Get Started": "開始使用",
|
||||
"Drag to move, or use the arrow keys": "拖曳以移動,或使用方向鍵",
|
||||
"A group can't go inside itself": "群組不能放進它自己裡面",
|
||||
"Groups can't nest any deeper": "群組不能再巢狀得更深"
|
||||
"Groups can't nest any deeper": "群組不能再巢狀得更深",
|
||||
"Stack — click to expand (S)": "堆疊 — 按一下以展開 (S)",
|
||||
"Stack — click to collapse (S)": "堆疊 — 按一下以收合 (S)",
|
||||
"Virtual copy": "虛擬副本",
|
||||
"Right-click ▸ Locate Missing File… to find it again.": "按右鍵 → 尋找遺失的檔案…,即可重新找到它。",
|
||||
"Right-click ▸ Reload from Disk to try again.": "按右鍵 → 從磁碟重新載入,即可重試。"
|
||||
}
|
||||
@@ -86,10 +86,11 @@ pub(super) fn interface_tab(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Toke
|
||||
choices(
|
||||
ui,
|
||||
"settingsGridBadges",
|
||||
&[(GridBadges::Auto, "When rated or hovered"), (GridBadges::Always, "Always"), (GridBadges::Never, "Never")],
|
||||
&[(GridBadges::Auto, "Stars on hover"), (GridBadges::Always, "Always"), (GridBadges::Never, "Never")],
|
||||
&mut app.ui.settings.grid_badges,
|
||||
);
|
||||
});
|
||||
hint(ui, t, "Stars on hover: flags and colour labels always show; the stars and the edited mark appear while a photo is hovered or selected.");
|
||||
check(ui, "settings.showFilenames", &mut app.ui.show_filenames, "Square Grid: show file names and formats");
|
||||
heading(ui, t, crate::i18n::tr("Keywords"));
|
||||
row(ui, t, crate::i18n::tr("Keywords of the selection"), |ui| {
|
||||
|
||||
@@ -108,6 +108,10 @@ pub enum Icon {
|
||||
Sun,
|
||||
/// Appearance Mode ▸ Dark: a crescent moon.
|
||||
Moon,
|
||||
/// A render failed: a triangle with an exclamation mark.
|
||||
Warning,
|
||||
/// A virtual copy: a page with a folded corner.
|
||||
VirtualCopy,
|
||||
}
|
||||
|
||||
struct Pen<'a> {
|
||||
@@ -356,6 +360,16 @@ fn paint_with(p: &Painter, rect: Rect, icon: Icon, color: Color32, turn: Option<
|
||||
pen.line(&[(10.0, 9.0), (10.0, 14.0)]);
|
||||
pen.dot(10.0, 6.3, 0.9);
|
||||
}
|
||||
Warning => {
|
||||
pen.closed(&[(10.0, 3.0), (17.5, 16.5), (2.5, 16.5)]);
|
||||
pen.line(&[(10.0, 8.0), (10.0, 11.8)]);
|
||||
pen.dot(10.0, 14.1, 0.9);
|
||||
}
|
||||
VirtualCopy => {
|
||||
// a page whose top right corner is folded down
|
||||
pen.line(&[(11.0, 3.0), (5.0, 3.0), (5.0, 17.0), (15.0, 17.0), (15.0, 7.0)]);
|
||||
pen.line(&[(11.0, 3.0), (15.0, 7.0), (11.0, 7.0), (11.0, 3.0)]);
|
||||
}
|
||||
GridPhoto => {
|
||||
pen.rect_fill(3.0, 4.0, 10.0, 9.5, 0.5);
|
||||
pen.rect_fill(11.0, 4.0, 17.0, 9.5, 0.5);
|
||||
|
||||
@@ -52,6 +52,7 @@ pub mod state;
|
||||
pub mod sync;
|
||||
pub mod tasks;
|
||||
pub mod theme;
|
||||
mod thumb;
|
||||
pub mod widgets;
|
||||
pub mod window_place;
|
||||
|
||||
|
||||
@@ -120,47 +120,34 @@ pub(crate) fn filmstrip(app: &mut LightcraftApp, ui: &mut egui::Ui, r: Rect) {
|
||||
}
|
||||
let img_area = Rect::from_min_max(cr.min + vec2(10.0, 22.0), cr.max - vec2(10.0, 8.0));
|
||||
crate::panels::grid::request_thumb(app, *id, (256.0 * ppp.min(2.0) / 2.0) as usize * 2, 8);
|
||||
let thumb = app.renderer.thumb(*id);
|
||||
if thumb.is_none() {
|
||||
p.rect_filled(img_area, 0.0, t.skeleton);
|
||||
if failed {
|
||||
p.text(img_area.center(), Align2::CENTER_CENTER, "!", t.semibold(14.0), t.text);
|
||||
}
|
||||
}
|
||||
if let Some(tex) = thumb {
|
||||
let [tw, th] = tex.size;
|
||||
let s = (img_area.width() / tw as f32).min(img_area.height() / th as f32);
|
||||
let fr = Rect::from_center_size(img_area.center(), vec2(tw as f32 * s, th as f32 * s));
|
||||
p.image(tex.id(), fr, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
|
||||
crate::panels::grid::selection_ring(p, &t, fr, state);
|
||||
if app.ui.settings.film_badges
|
||||
&& let Some(ph) = app.session.catalog.photo(*id)
|
||||
{
|
||||
film_badges(p, &t, fr, ph);
|
||||
}
|
||||
if let Some(st) = app.session.catalog.stack_of(*id) {
|
||||
let collapsed = st.collapsed;
|
||||
let text =
|
||||
if collapsed { st.photos.len().to_string() } else { format!("{}/{}", st.position(*id).unwrap_or(0) + 1, st.photos.len()) };
|
||||
let g = p.layout_no_wrap(text, t.semibold(9.5), Color32::WHITE);
|
||||
let br = Rect::from_min_size(fr.min + vec2(3.0, 3.0), vec2(g.size().x + 22.0, 15.0));
|
||||
// like the grid's badge: a click expands / collapses the stack
|
||||
let badge = ui.interact(br, egui::Id::unique(("film-stack-badge", id.0)), Sense::click()).on_hover_text(if collapsed {
|
||||
"Stack — click to expand"
|
||||
} else {
|
||||
"Stack — click to collapse"
|
||||
});
|
||||
crate::widgets::announce(&badge, crate::i18n::tr(if collapsed { "Expand Stack" } else { "Collapse Stack" }));
|
||||
register(ui, format!("filmstack:{}", id.0), br);
|
||||
let p = ui.painter();
|
||||
let fill = if badge.hovered() { Color32::from_black_alpha(230) } else { Color32::from_black_alpha(170) };
|
||||
p.rect_filled(br, 7.5, fill);
|
||||
crate::icons::paint(p, Rect::from_min_size(br.min + vec2(4.0, 2.0), vec2(11.0, 11.0)), crate::icons::Icon::Stack, Color32::WHITE);
|
||||
p.galley(pos2(br.min.x + 17.0, br.center().y - g.size().y / 2.0), g, Color32::WHITE);
|
||||
if badge.clicked() {
|
||||
crate::panels::grid::toggle_stack(app, ui.ctx(), *id);
|
||||
}
|
||||
}
|
||||
let mut badge = None;
|
||||
if let Some(photo) = app.session.catalog.photo(*id).cloned() {
|
||||
let (photo_rect, failure) = if let Some(tex) = app.renderer.thumb(*id) {
|
||||
let [tw, th] = tex.size;
|
||||
let s = (img_area.width() / tw as f32).min(img_area.height() / th as f32);
|
||||
let fr = Rect::from_center_size(img_area.center(), vec2(tw as f32 * s, th as f32 * s));
|
||||
p.image(tex.id(), fr, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
|
||||
crate::panels::grid::selection_ring(p, &t, fr, state);
|
||||
(fr, None)
|
||||
} else {
|
||||
let ph = crate::thumb::placeholder_rect(img_area, crate::panels::grid::photo_aspect(Some(&*photo)));
|
||||
crate::thumb::paint_placeholder(p, ph, &t);
|
||||
crate::panels::grid::selection_ring(p, &t, ph, state);
|
||||
(ph, app.renderer.failure(crate::render::Slot::Thumb(*id)).map(str::to_owned))
|
||||
};
|
||||
let stack = app.session.catalog.stack_of(*id).map(|st| (st.id, st.position(*id).unwrap_or(0)));
|
||||
let overlay = crate::thumb::Thumb {
|
||||
surface: crate::thumb::Surface::Film,
|
||||
photo: &photo,
|
||||
rect: photo_rect,
|
||||
stack,
|
||||
marks: app.ui.settings.film_badges,
|
||||
extras: app.ui.settings.film_badges,
|
||||
hot: false,
|
||||
failure,
|
||||
surround: true,
|
||||
};
|
||||
badge = crate::thumb::overlay(app, ui, &overlay);
|
||||
}
|
||||
if resp.clicked() {
|
||||
let m = ui.input(|i| i.modifiers);
|
||||
@@ -197,6 +184,9 @@ pub(crate) fn filmstrip(app: &mut LightcraftApp, ui: &mut egui::Ui, r: Rect) {
|
||||
}
|
||||
// the same photo actions as the grid and loupe (Restore / Delete Permanently in Recently Deleted)
|
||||
crate::widgets::context_menu(&resp, |ui| crate::panels::grid::context_menu(app, ui, *id));
|
||||
if let Some(badge) = badge {
|
||||
crate::widgets::context_menu(&badge, |ui| crate::panels::grid::context_menu(app, ui, *id));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -211,26 +201,3 @@ pub(crate) fn film_spoken(file_name: &str, failed: bool) -> String {
|
||||
(false, true) => format!("{file_name}, {}", crate::i18n::tr("This photo can't be opened")),
|
||||
}
|
||||
}
|
||||
|
||||
/// Rating, flag and edited badges along a filmstrip thumbnail's bottom edge (Settings → Interface).
|
||||
fn film_badges(p: &egui::Painter, t: &Tokens, fr: Rect, ph: &lightcraft_catalog::Photo) {
|
||||
use crate::icons::{Icon, paint};
|
||||
use lightcraft_catalog::Flag;
|
||||
let edited = ph.is_edited();
|
||||
if ph.rating == 0 && ph.flag == Flag::None && !edited {
|
||||
return;
|
||||
}
|
||||
let bar = Rect::from_min_max(pos2(fr.left(), fr.bottom() - 15.0), fr.right_bottom());
|
||||
p.rect_filled(bar, 0.0, Color32::from_black_alpha(130));
|
||||
let y = bar.center().y;
|
||||
let mut x = bar.left() + 3.0;
|
||||
x += crate::rating::paint_rating(p, pos2(x, y), ph.rating, crate::rating::RatingSize::Small, t.star) + 2.0;
|
||||
match ph.flag {
|
||||
Flag::Pick => paint(p, Rect::from_min_size(pos2(x, y - 5.0), vec2(10.0, 10.0)), Icon::FlagPickFilled, t.pick),
|
||||
Flag::Reject => paint(p, Rect::from_min_size(pos2(x, y - 5.0), vec2(10.0, 10.0)), Icon::FlagReject, t.reject),
|
||||
Flag::None => {}
|
||||
}
|
||||
if edited {
|
||||
paint(p, Rect::from_min_size(pos2(bar.right() - 13.0, y - 5.0), vec2(10.0, 10.0)), Icon::Sliders, t.text_label);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
|
||||
use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2};
|
||||
use lightcraft_catalog::{Catalog, ColorLabel, DateRun, Flag, GroupBy, PhotoId, SortKey, StackId};
|
||||
use lightcraft_catalog::{Catalog, ColorLabel, DateRun, GroupBy, PhotoId, SortKey, StackId};
|
||||
use serde_json::json;
|
||||
|
||||
use crate::LightcraftApp;
|
||||
@@ -271,9 +271,13 @@ pub(crate) fn import_way_in(keymap: &crate::shortcuts::Keymap, mac: bool) -> (&'
|
||||
(way, crate::shortcuts::shortcut_of(keymap, "file.addPhotos").map(|sc| crate::menubar::shortcut_text(sc, mac)))
|
||||
}
|
||||
|
||||
/// Width / height of a photo's cell: its cropped, oriented shape.
|
||||
/// [`photo_aspect`] of photo `id` of the catalog.
|
||||
pub(crate) fn shape_of(cat: &Catalog, id: PhotoId) -> f32 {
|
||||
let p = cat.photo(id);
|
||||
photo_aspect(cat.photo(id).map(|p| &**p))
|
||||
}
|
||||
|
||||
/// Width / height of a photo's cell: its cropped, oriented shape.
|
||||
pub(crate) fn photo_aspect(p: Option<&lightcraft_catalog::Photo>) -> f32 {
|
||||
let (w, h) = p.map(|p| (p.width.max(1) as f32, p.height.max(1) as f32)).unwrap_or((3.0, 2.0));
|
||||
let swap = p.is_some_and(|p| p.develop.orientation.swaps_axes());
|
||||
let crop = p.map(|p| p.develop.crop.geometry.rect).unwrap_or(lightcraft_geom::Rect::UNIT);
|
||||
@@ -411,10 +415,7 @@ fn show_inner(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
visible_ids.insert(id);
|
||||
let r = rect.translate(origin.to_vec2());
|
||||
let onscreen = rect.intersects(viewport);
|
||||
cell(app, ui, id, r, square, onscreen, ppp);
|
||||
if let Some((sid, pos)) = stacks.get(&id) {
|
||||
stack_badge(app, ui, id, *sid, *pos, r, square);
|
||||
}
|
||||
cell(app, ui, id, r, CellView { square, onscreen, ppp, stack: stacks.get(&id).copied() });
|
||||
}
|
||||
}
|
||||
// date headers (top to bottom); the current group's header sticks to the top while its
|
||||
@@ -774,7 +775,8 @@ pub(crate) fn skips_the_real_render(embedded_is_final: bool, from_embedded: bool
|
||||
/// Rendered thumbnails replacing embedded previews: after everything on screen.
|
||||
pub const BACKGROUND_THUMB_PRIORITY: u32 = 3;
|
||||
|
||||
fn cell(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, r: Rect, square: bool, onscreen: bool, ppp: f32) {
|
||||
fn cell(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, r: Rect, view: CellView) {
|
||||
let CellView { square, onscreen, ppp, stack } = view;
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let Some(photo) = app.session.catalog.photo(id).cloned() else { return };
|
||||
let resp = ui.interact(r, egui::Id::unique(("cell", id.0)), Sense::click_and_drag());
|
||||
@@ -791,26 +793,37 @@ fn cell(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, r: Rect, square
|
||||
} else {
|
||||
r
|
||||
};
|
||||
let photo_rect = paint_cell_thumbnail(app, p, &t, id, img_rect, ThumbFlags { square, state, onscreen, ppp });
|
||||
let flags = ThumbFlags { state, onscreen, ppp, aspect: photo_aspect(Some(&*photo)) };
|
||||
let (photo_rect, failure) = paint_cell_thumbnail(app, p, &t, id, img_rect, flags);
|
||||
// labels and badges
|
||||
paint_cell_caption(app, p, &t, &photo, r, square);
|
||||
paint_cell_badges(app, p, &t, &photo, photo_rect, BadgeFlags { square, selected, hovered: resp.hovered() });
|
||||
if let Some(name) = &photo.copy_name {
|
||||
paint_copy_tag(p, &t, name, img_rect, square);
|
||||
}
|
||||
if let Some(why) = &photo.preview_only {
|
||||
paint_preview_pill(ui, p, &t, id, why, photo_rect);
|
||||
}
|
||||
if photo.flag == Flag::Reject {
|
||||
p.rect_filled(img_rect, 0.0, Color32::from_black_alpha(110));
|
||||
}
|
||||
cell_interaction(app, ui, &resp, id, &photo);
|
||||
// Stars on hover: the decision marks (flag, colour label) always show; the stars and the edited
|
||||
// mark only while the photo is hovered or selected, so a mostly rated library stays clean.
|
||||
let engaged = resp.hovered() || selected;
|
||||
let (show_marks, show_extras) = match app.ui.settings.grid_badges {
|
||||
crate::state::GridBadges::Auto => (true, engaged),
|
||||
crate::state::GridBadges::Always => (true, true),
|
||||
crate::state::GridBadges::Never => (false, false),
|
||||
};
|
||||
let overlay = crate::thumb::Thumb {
|
||||
surface: crate::thumb::Surface::Grid,
|
||||
photo: &photo,
|
||||
rect: photo_rect,
|
||||
stack,
|
||||
marks: show_marks,
|
||||
extras: show_extras,
|
||||
hot: engaged,
|
||||
failure,
|
||||
surround: square,
|
||||
};
|
||||
let badge = crate::thumb::overlay(app, ui, &overlay);
|
||||
cell_interaction(app, ui, &resp, id, &photo, badge);
|
||||
}
|
||||
|
||||
pub(crate) fn cell_description(app: &LightcraftApp, photo: &lightcraft_catalog::Photo) -> String {
|
||||
let mut spoken = photo.file_name.clone();
|
||||
if photo.rating > 0 {
|
||||
spoken.push_str(&crate::i18n::tr_format!(", {} star{}", photo.rating, if photo.rating == 1 { "" } else { "s" }));
|
||||
spoken.push_str(&crate::thumb::spoken_rating(photo.rating));
|
||||
}
|
||||
match photo.flag {
|
||||
lightcraft_catalog::Flag::Pick => spoken.push_str(crate::i18n::tr(", picked")),
|
||||
@@ -823,28 +836,32 @@ pub(crate) fn cell_description(app: &LightcraftApp, photo: &lightcraft_catalog::
|
||||
spoken
|
||||
}
|
||||
|
||||
fn paint_cell_thumbnail(app: &mut LightcraftApp, p: &egui::Painter, t: &Tokens, id: PhotoId, img_rect: Rect, flags: ThumbFlags) -> Rect {
|
||||
let ThumbFlags { square, state, onscreen, ppp } = flags;
|
||||
fn paint_cell_thumbnail(
|
||||
app: &mut LightcraftApp,
|
||||
p: &egui::Painter,
|
||||
t: &Tokens,
|
||||
id: PhotoId,
|
||||
img_rect: Rect,
|
||||
flags: ThumbFlags,
|
||||
) -> (Rect, Option<String>) {
|
||||
let ThumbFlags { state, onscreen, ppp, aspect } = flags;
|
||||
let size = thumb_px(img_rect.width().max(img_rect.height()), ppp);
|
||||
request_thumb(app, id, size, if onscreen { 10 } else { 5 });
|
||||
if let Some(tex) = app.renderer.thumb(id) {
|
||||
let (photo_rect, failure) = if let Some(tex) = app.renderer.thumb(id) {
|
||||
let [tw, th] = tex.size;
|
||||
// Preserve the decoded preview's ratio when it differs from the catalog dimensions.
|
||||
let fit = super::detail::fit_texture_rect(img_rect, [tw, th]);
|
||||
p.image(tex.id(), fit, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
|
||||
selection_ring(p, t, fit, state);
|
||||
fit
|
||||
(fit, None)
|
||||
} else {
|
||||
let ph = img_rect.shrink(if square { 20.0 } else { 0.0 });
|
||||
p.rect_filled(ph, 0.0, t.skeleton);
|
||||
let ph = crate::thumb::placeholder_rect(img_rect, aspect);
|
||||
crate::thumb::paint_placeholder(p, ph, t);
|
||||
// not drawn yet (or unreadable): the selection is still visible
|
||||
selection_ring(p, t, ph, state);
|
||||
if app.renderer.failure(Slot::Thumb(id)).is_some() {
|
||||
// unreadable / missing file
|
||||
p.text(ph.center(), Align2::CENTER_CENTER, "!", t.semibold(18.0), t.text);
|
||||
}
|
||||
ph
|
||||
}
|
||||
(ph, app.renderer.failure(Slot::Thumb(id)).map(str::to_owned))
|
||||
};
|
||||
(photo_rect, failure)
|
||||
}
|
||||
|
||||
fn paint_cell_caption(app: &LightcraftApp, p: &egui::Painter, t: &Tokens, photo: &lightcraft_catalog::Photo, r: Rect, square: bool) {
|
||||
@@ -877,83 +894,14 @@ fn paint_cell_caption(app: &LightcraftApp, p: &egui::Painter, t: &Tokens, photo:
|
||||
}
|
||||
}
|
||||
|
||||
/// The 24-pixel band the badges sit in, on the photo itself: a portrait's fitted rect is
|
||||
/// narrower than the cell's image area and a landscape's is shorter, so a band sized from
|
||||
/// the image area sticks out past the photo and crosses its selection frame (#3601). A photo
|
||||
/// shorter than the band keeps its own top edge.
|
||||
fn photo_badge_bar(photo_rect: Rect) -> Rect {
|
||||
Rect::from_min_max(pos2(photo_rect.left(), (photo_rect.bottom() - 24.0).max(photo_rect.top())), photo_rect.right_bottom())
|
||||
}
|
||||
|
||||
fn paint_cell_badges(app: &LightcraftApp, p: &egui::Painter, t: &Tokens, photo: &lightcraft_catalog::Photo, photo_rect: Rect, flags: BadgeFlags) {
|
||||
let BadgeFlags { square, selected, hovered } = flags;
|
||||
let show_badges = match app.ui.settings.grid_badges {
|
||||
crate::state::GridBadges::Auto => hovered || selected || photo.rating > 0 || photo.flag != Flag::None || photo.label.is_some(),
|
||||
crate::state::GridBadges::Always => true,
|
||||
crate::state::GridBadges::Never => false,
|
||||
};
|
||||
let badge_bar = photo_badge_bar(photo_rect);
|
||||
if !square && photo.label.is_some() {
|
||||
// Justified photos fill the whole cell, so the label shows as a translucent tinted footer
|
||||
// over the photo's bottom edge (opaque, it would hide 24 px of every labelled photo).
|
||||
p.rect_filled(badge_bar, 0.0, crate::theme::label_background(t.cell, photo.label, selected).gamma_multiply(0.7));
|
||||
}
|
||||
if show_badges {
|
||||
let bar = badge_bar;
|
||||
if (hovered || selected) && (square || photo.label.is_none()) {
|
||||
p.rect_filled(bar, 0.0, Color32::from_black_alpha(120));
|
||||
}
|
||||
let mut x = bar.left() + 6.0;
|
||||
x += crate::rating::paint_rating(p, pos2(x, bar.center().y), photo.rating, crate::rating::RatingSize::Medium, t.star) + 4.0;
|
||||
match photo.flag {
|
||||
Flag::Pick => paint(p, Rect::from_min_size(pos2(x, bar.center().y - 7.0), vec2(14.0, 14.0)), Icon::FlagPickFilled, t.pick),
|
||||
Flag::Reject => paint(p, Rect::from_min_size(pos2(x, bar.center().y - 7.0), vec2(14.0, 14.0)), Icon::FlagReject, t.reject),
|
||||
Flag::None => {}
|
||||
}
|
||||
let mut right = bar.right();
|
||||
if photo.is_edited() {
|
||||
paint(p, Rect::from_min_size(pos2(right - 20.0, bar.center().y - 7.0), vec2(14.0, 14.0)), Icon::Sliders, t.text_label);
|
||||
right -= 20.0;
|
||||
}
|
||||
if let Some(l) = photo.label {
|
||||
p.circle(pos2(right - 12.0, bar.center().y), 5.0, label_color(l), Stroke::new(1.0, Color32::from_black_alpha(120)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn paint_copy_tag(p: &egui::Painter, t: &Tokens, name: &str, img_rect: Rect, square: bool) {
|
||||
// virtual copy: a folded-corner tag at the top right
|
||||
let g = p.layout_no_wrap(name.to_string(), t.semibold(10.5), Color32::WHITE);
|
||||
let tr = if square { img_rect.right_top() + vec2(-6.0, 6.0) } else { img_rect.right_top() + vec2(-5.0, 5.0) };
|
||||
let br = Rect::from_min_max(pos2(tr.x - g.size().x - 26.0, tr.y), pos2(tr.x, tr.y + 20.0));
|
||||
p.rect_filled(br, 10.0, Color32::from_black_alpha(165));
|
||||
let c = pos2(br.left() + 13.0, br.center().y);
|
||||
let s = 5.0;
|
||||
p.add(egui::Shape::convex_polygon(
|
||||
vec![c + vec2(-s, -s), c + vec2(s * 0.3, -s), c + vec2(s, -s * 0.3), c + vec2(s, s), c + vec2(-s, s)],
|
||||
Color32::TRANSPARENT,
|
||||
Stroke::new(1.2, Color32::WHITE),
|
||||
));
|
||||
p.line_segment([c + vec2(s * 0.3, -s), c + vec2(s * 0.3, -s * 0.3)], Stroke::new(1.2, Color32::WHITE));
|
||||
p.line_segment([c + vec2(s * 0.3, -s * 0.3), c + vec2(s, -s * 0.3)], Stroke::new(1.2, Color32::WHITE));
|
||||
p.galley(pos2(br.left() + 22.0, br.center().y - g.size().y / 2.0), g, Color32::WHITE);
|
||||
}
|
||||
|
||||
fn paint_preview_pill(ui: &egui::Ui, p: &egui::Painter, t: &Tokens, id: PhotoId, why: &str, photo_rect: Rect) {
|
||||
// a raw shown from its embedded JPEG: a small amber "Preview" pill at the photo's bottom
|
||||
// left, above the badge bar (always shown: it changes what editing does)
|
||||
let g = p.layout_no_wrap(crate::i18n::tr("Preview").into(), t.semibold(9.5), Color32::WHITE);
|
||||
let at = pos2(photo_rect.left() + 6.0, photo_rect.bottom() - 30.0 - 16.0);
|
||||
let br = Rect::from_min_size(at, vec2(g.size().x + 24.0, 16.0));
|
||||
p.rect_filled(br, 8.0, Color32::from_black_alpha(170));
|
||||
paint(p, Rect::from_center_size(pos2(br.left() + 9.0, br.center().y), vec2(12.0, 12.0)), Icon::Info, t.caution);
|
||||
p.galley(pos2(br.left() + 17.0, br.center().y - g.size().y / 2.0), g, Color32::WHITE);
|
||||
register(ui, format!("badge:previewOnly:{}", id.0), br);
|
||||
ui.interact(br, egui::Id::unique(("preview-only-badge", id.0)), Sense::hover())
|
||||
.on_hover_text(crate::i18n::tr_format!("Preview only — {}", crate::widgets::preview_only_explanation(why)));
|
||||
}
|
||||
|
||||
fn cell_interaction(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &egui::Response, id: PhotoId, photo: &lightcraft_catalog::Photo) {
|
||||
fn cell_interaction(
|
||||
app: &mut LightcraftApp,
|
||||
ui: &mut egui::Ui,
|
||||
resp: &egui::Response,
|
||||
id: PhotoId,
|
||||
photo: &lightcraft_catalog::Photo,
|
||||
badge: Option<egui::Response>,
|
||||
) {
|
||||
if let Some(k) = app.ui.keyword_painter.clone() {
|
||||
// painting: a click toggles the keyword on this photo
|
||||
if resp.hovered() {
|
||||
@@ -986,19 +934,25 @@ fn cell_interaction(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &egui::Res
|
||||
begin_photo_drag(app, id);
|
||||
}
|
||||
crate::widgets::context_menu(resp, |ui| context_menu(app, ui, id));
|
||||
// (the stack badge covers part of the cell: it opens the same menu)
|
||||
if let Some(badge) = badge {
|
||||
crate::widgets::context_menu(&badge, |ui| context_menu(app, ui, id));
|
||||
}
|
||||
}
|
||||
|
||||
struct ThumbFlags {
|
||||
square: bool,
|
||||
state: lightcraft_engine::SelectionState,
|
||||
onscreen: bool,
|
||||
ppp: f32,
|
||||
aspect: f32,
|
||||
}
|
||||
|
||||
struct BadgeFlags {
|
||||
/// How `cell` is drawn: the layout, whether it is on screen, the pixel scale, and the photo's stack position.
|
||||
struct CellView {
|
||||
square: bool,
|
||||
selected: bool,
|
||||
hovered: bool,
|
||||
onscreen: bool,
|
||||
ppp: f32,
|
||||
stack: Option<(lightcraft_catalog::StackId, usize)>,
|
||||
}
|
||||
|
||||
/// The header of a library view (All Photos, an album, a library folder…): the source's title and
|
||||
@@ -1260,38 +1214,6 @@ pub fn label_param(l: Option<ColorLabel>) -> String {
|
||||
l.map_or_else(|| "none".to_string(), |l| format!("{l:?}").to_lowercase())
|
||||
}
|
||||
|
||||
/// Stack badge at the cell's top-left: the photo count on a collapsed stack's top, `i/n` on the
|
||||
/// members of an expanded stack. Clicking or double-clicking it expands/collapses the stack.
|
||||
pub fn stack_badge(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, sid: lightcraft_catalog::StackId, pos: usize, r: Rect, square: bool) {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let Some(st) = app.session.catalog.stack(sid) else { return };
|
||||
let n = st.photos.len();
|
||||
let collapsed = st.collapsed;
|
||||
let text = if collapsed { n.to_string() } else { format!("{}/{n}", pos + 1) };
|
||||
let p = ui.painter();
|
||||
let g = p.layout_no_wrap(text, t.semibold(11.0), Color32::WHITE);
|
||||
let origin = if square { r.min + vec2(10.0, 26.0) } else { r.min + vec2(5.0, 5.0) };
|
||||
let br = Rect::from_min_size(origin, vec2(g.size().x + 30.0, 20.0));
|
||||
let resp = ui.interact(br, egui::Id::unique(("stack-badge", id.0)), Sense::click()).on_hover_text(if collapsed {
|
||||
"Stack — click to expand (S)"
|
||||
} else {
|
||||
"Stack — click to collapse (S)"
|
||||
});
|
||||
crate::widgets::announce(&resp, crate::i18n::tr(if collapsed { "Expand Stack" } else { "Collapse Stack" }));
|
||||
register(ui, format!("stack:{}", id.0), br);
|
||||
let fill = if resp.hovered() { Color32::from_black_alpha(220) } else { Color32::from_black_alpha(165) };
|
||||
p.rect_filled(br, 10.0, fill);
|
||||
if pos == 0 && !collapsed {
|
||||
p.rect_stroke(br, 10.0, Stroke::new(1.0, t.accent), StrokeKind::Inside);
|
||||
}
|
||||
paint(p, Rect::from_min_size(br.min + vec2(6.0, 3.0), vec2(14.0, 14.0)), Icon::Stack, Color32::WHITE);
|
||||
p.galley(pos2(br.min.x + 24.0, br.center().y - g.size().y / 2.0), g, Color32::WHITE);
|
||||
// a double-click (Lightroom's way) toggles once: its second click would undo the first
|
||||
if resp.clicked() && !resp.double_clicked() {
|
||||
toggle_stack(app, ui.ctx(), id);
|
||||
}
|
||||
}
|
||||
|
||||
/// A click on a stack badge (grid or filmstrip): expand / collapse that photo's stack, selected or
|
||||
/// not. The selection stays as it is (Compare keeps its pair).
|
||||
pub fn toggle_stack(app: &mut LightcraftApp, ctx: &egui::Context, id: PhotoId) {
|
||||
@@ -1679,27 +1601,4 @@ mod tests {
|
||||
assert_eq!(resolve_group(GroupBy::None, 220.0), GroupBy::None);
|
||||
assert_eq!(resolve_group(GroupBy::Year, 400.0), GroupBy::Year);
|
||||
}
|
||||
|
||||
/// The badge band sits on the photo itself — a portrait's fitted rect is narrower than the
|
||||
/// cell's image area, a landscape's is shorter — so it never sticks out past the photo or
|
||||
/// crosses its selection frame (#3601).
|
||||
#[test]
|
||||
fn the_badge_band_stays_on_the_photo() {
|
||||
let cell = Rect::from_min_size(pos2(10.0, 24.0), vec2(180.0, 180.0));
|
||||
// A photo that fills the image area: the band is the usual 24 px footer
|
||||
let full = photo_badge_bar(cell);
|
||||
assert!((full.height() - 24.0).abs() < 0.01, "{full:?}");
|
||||
assert!((full.bottom() - cell.bottom()).abs() < 0.01);
|
||||
assert!((full.left() - cell.left()).abs() < 0.01 && (full.right() - cell.right()).abs() < 0.01);
|
||||
// A portrait photo fitted inside it: the band is no wider than the photo
|
||||
let portrait = Rect::from_min_size(pos2(cell.left() + 55.0, cell.top()), vec2(70.0, 180.0));
|
||||
let bar = photo_badge_bar(portrait);
|
||||
assert!(bar.left() >= portrait.left() && bar.right() <= portrait.right(), "{bar:?}");
|
||||
assert!((bar.height() - 24.0).abs() < 0.01);
|
||||
// A landscape photo shorter than the band: its own top edge, never a negative rect
|
||||
let wide = Rect::from_min_size(pos2(cell.left(), cell.top() + 80.0), vec2(180.0, 20.0));
|
||||
let bar = photo_badge_bar(wide);
|
||||
assert!((bar.top() - wide.top()).abs() < 0.01, "{bar:?}");
|
||||
assert!(bar.bottom() <= wide.bottom() + 0.01);
|
||||
}
|
||||
}
|
||||
@@ -165,12 +165,12 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
let tree = app.caches.folder_tree(&app.session.catalog);
|
||||
section(app, ui, s, tree.len(), |app, ui| {
|
||||
reveal_chosen(app, ui, &tree);
|
||||
folder_rows(app, ui, &tree, 0.0);
|
||||
folder_rows(app, ui, &tree, 0.0, None);
|
||||
})
|
||||
}
|
||||
SidebarSection::Keywords => {
|
||||
let tree = app.caches.keyword_tree(&app.session.catalog);
|
||||
section(app, ui, s, tree.len(), |app, ui| keyword_rows(app, ui, &tree, 0.0))
|
||||
section(app, ui, s, tree.len(), |app, ui| keyword_rows(app, ui, &tree, 0.0, None))
|
||||
}
|
||||
};
|
||||
placed.push(at);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::folders::{folder_menu, is_within};
|
||||
use super::rows::{INDENT_STEP, Row, indent_x, set_tree_open, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, Row, Said, indent_x, set_tree_open, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Album, AlbumId, Align2, Icon, LibrarySource, LightcraftApp, Rect, Sense, Tokens, json, pos2, register, vec2};
|
||||
|
||||
/// Albums: the tree of albums and the folders they are sorted into. `reveal`: an album just made,
|
||||
@@ -13,14 +13,23 @@ pub(super) fn albums_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, reveal: Op
|
||||
open_to.push(p);
|
||||
cur = cat.album(p).and_then(|a| a.parent);
|
||||
}
|
||||
albums_tree(app, ui, &kids, None, 0.0, &open_to);
|
||||
albums_tree(app, ui, &kids, None, 0.0, &open_to, None);
|
||||
}
|
||||
|
||||
/// The albums inside each folder (`None`: the top level), in the order they are listed.
|
||||
type AlbumKids = std::collections::HashMap<Option<AlbumId>, Vec<Album>>;
|
||||
|
||||
/// `open_to`: folders forced open this frame (the way down to an album that was just made).
|
||||
fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, parent: Option<AlbumId>, indent: f32, open_to: &[AlbumId]) {
|
||||
/// `above`: what holds for these rows from the folders above them ([`tree_inside`]).
|
||||
fn albums_tree(
|
||||
app: &mut LightcraftApp,
|
||||
ui: &mut egui::Ui,
|
||||
all: &AlbumKids,
|
||||
parent: Option<AlbumId>,
|
||||
indent: f32,
|
||||
open_to: &[AlbumId],
|
||||
above: Option<Said>,
|
||||
) {
|
||||
// 64 folders deep at most (16 points a level): a catalog that loops must not overflow the stack
|
||||
if indent > 64.0 * INDENT_STEP {
|
||||
return;
|
||||
@@ -29,7 +38,7 @@ fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, pare
|
||||
for a in kids {
|
||||
if a.folder {
|
||||
let open_id = egui::Id::unique(("folder-open", a.id.0));
|
||||
let mut open = tree_open(ui, open_id, true);
|
||||
let mut open = tree_open(ui, open_id, true, above);
|
||||
if open_to.contains(&a.id) && !open {
|
||||
open = true;
|
||||
set_tree_open(ui, open_id, true);
|
||||
@@ -47,7 +56,7 @@ fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, pare
|
||||
let draw_open = open;
|
||||
let mut toggled = false;
|
||||
if has_children {
|
||||
let tri = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("albumToggle:{}", a.id.0), &a.name);
|
||||
let tri = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("albumToggle:{}", a.id.0), &a.name, Inside::OpensAndFolds);
|
||||
toggled = tri.clicked();
|
||||
// the triangle sits on the row and takes its clicks: the menu opens from it too
|
||||
folder_menu(app, &tri, a);
|
||||
@@ -58,7 +67,7 @@ fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, pare
|
||||
}
|
||||
folder_menu(app, &resp, a);
|
||||
if draw_open {
|
||||
albums_tree(app, ui, all, Some(a.id), indent + INDENT_STEP, open_to);
|
||||
albums_tree(app, ui, all, Some(a.id), indent + INDENT_STEP, open_to, tree_inside(ui, open_id, above));
|
||||
}
|
||||
} else {
|
||||
let sel = app.session.source == LibrarySource::Album(a.id);
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
use super::rows::{INDENT_STEP, Row, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, Row, Said, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Icon, LibrarySource, LightcraftApp, json};
|
||||
|
||||
/// By Date: year → month → day; a click filters by that prefix, the triangle opens a level.
|
||||
pub(super) fn date_rows(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
let groups = app.caches.date_groups(&app.session.catalog);
|
||||
for g in groups.iter() {
|
||||
if date_row(app, ui, &g.year, &crate::i18n::date_group_label(&g.year, true), g.count, 0.0) {
|
||||
if date_row(app, ui, &g.year, &crate::i18n::date_group_label(&g.year, true), g.count, 0.0, None) {
|
||||
let in_the_year = tree_inside(ui, date_open_id(&g.year), None);
|
||||
for (m, n) in &g.months {
|
||||
let label = crate::i18n::date_group_label(m, true);
|
||||
if date_row(app, ui, m, &label, *n, INDENT_STEP) {
|
||||
if date_row(app, ui, m, &label, *n, INDENT_STEP, in_the_year) {
|
||||
for (d, n) in g.days.iter().filter(|(d, _)| d.starts_with(m.as_str())) {
|
||||
let label = crate::i18n::date_group_label(d, true);
|
||||
date_row(app, ui, d, &label, *n, 2.0 * INDENT_STEP);
|
||||
date_row(app, ui, d, &label, *n, 2.0 * INDENT_STEP, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,15 +20,23 @@ pub(super) fn date_rows(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The id of the open state of the By Date row `key`.
|
||||
fn date_open_id(key: &str) -> egui::Id {
|
||||
egui::Id::unique(("date-open", key.to_string()))
|
||||
}
|
||||
|
||||
/// One By Date row (`key`: `YYYY`, `YYYY-MM` or `YYYY-MM-DD`); returns whether it is open.
|
||||
fn date_row(app: &mut LightcraftApp, ui: &mut egui::Ui, key: &str, label: &str, count: usize, indent: f32) -> bool {
|
||||
let open_id = egui::Id::unique(("date-open", key.to_string()));
|
||||
let mut open = tree_open(ui, open_id, false);
|
||||
/// `above`: what holds for it from the rows above it ([`tree_inside`]).
|
||||
fn date_row(app: &mut LightcraftApp, ui: &mut egui::Ui, key: &str, label: &str, count: usize, indent: f32, above: Option<Said>) -> bool {
|
||||
let open_id = date_open_id(key);
|
||||
let mut open = tree_open(ui, open_id, false, above);
|
||||
let sel = app.session.filter.date.as_deref() == Some(key);
|
||||
let resp = Row::new(&format!("date:{key}"), Icon::Clock, label).count(Some(count)).selected(sel).indent(indent).show(app, ui);
|
||||
if key.len() < 10 {
|
||||
// (the name carries the year, so two Marches in different years differ in a screen reader's list of triangles)
|
||||
tree_toggle(ui, &resp, indent, open_id, &mut open, format!("dateToggle:{key}"), &crate::i18n::date_group_label(key, false));
|
||||
// (the name carries the year, so two Marches in different years differ in a screen reader's list of triangles;
|
||||
// a year's months open and fold with it, a month's days have nothing to open)
|
||||
let inside = if key.len() < 7 { Inside::OpensAndFolds } else { Inside::Alone };
|
||||
tree_toggle(ui, &resp, indent, open_id, &mut open, format!("dateToggle:{key}"), &crate::i18n::date_group_label(key, false), inside);
|
||||
}
|
||||
if resp.clicked() {
|
||||
let v = if sel { serde_json::Value::Null } else { json!(key) };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::albums::pointer_over_row;
|
||||
use super::local::{is_builtin_place, same_folder, subfolders};
|
||||
use super::rows::{INDENT_STEP, LIBFOLDER_REVEALED, Row, out_of_sight, set_tree_open, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, LIBFOLDER_REVEALED, Row, Said, out_of_sight, set_tree_open, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Album, FolderNode, Icon, LibrarySource, LightcraftApp, Tokens, json, register, vec2};
|
||||
|
||||
/// A folder on disk with a disclosure triangle: click browses it, the triangle lists its
|
||||
@@ -21,11 +21,12 @@ pub(super) fn folder_tree(
|
||||
current: Option<&str>,
|
||||
reveal: bool,
|
||||
transient: bool,
|
||||
above: Option<Said>,
|
||||
) {
|
||||
let open_id = egui::Id::unique(("folder-open", place.to_string(), path.to_string()));
|
||||
let sel = current.is_some_and(|c| same_folder(c, path));
|
||||
let on_the_way = !sel && current.is_some_and(|c| lightcraft_catalog::query::folder_within(c, path));
|
||||
let mut open = tree_open(ui, open_id, false);
|
||||
let mut open = tree_open(ui, open_id, false, above);
|
||||
if reveal && on_the_way {
|
||||
// opened once per browsed folder: collapsing it again afterwards sticks
|
||||
let revealed_id = egui::Id::unique(("folder-revealed", place.to_string(), path.to_string()));
|
||||
@@ -40,7 +41,7 @@ pub(super) fn folder_tree(
|
||||
// at the tree's own indent, as in Albums and Folders: the triangle sits in the gutter and the
|
||||
// icon lines up with the rows above
|
||||
let resp = Row::new(&format!("local:{path}"), Icon::Folder, name).selected(sel).indent(indent).show(app, ui).on_hover_text(path);
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("folderToggle:{path}"), name);
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("folderToggle:{path}"), name, Inside::Folds);
|
||||
if !tr.clicked()
|
||||
&& resp.clicked()
|
||||
&& let Err(e) = app.run("library.browse", json!({"path": path}))
|
||||
@@ -96,8 +97,9 @@ pub(super) fn folder_tree(
|
||||
});
|
||||
}
|
||||
if open && indent < INDENT_STEP * 8.0 {
|
||||
let inside = tree_inside(ui, open_id, above);
|
||||
for (n, p) in subfolders(ui, path).iter() {
|
||||
folder_tree(app, ui, place, n, p, indent + INDENT_STEP, current, reveal, false);
|
||||
folder_tree(app, ui, place, n, p, indent + INDENT_STEP, current, reveal, false, inside);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,7 +289,7 @@ pub(super) fn reveal_chosen(app: &LightcraftApp, ui: &egui::Ui, tree: &[FolderNo
|
||||
for n in nodes {
|
||||
if lightcraft_catalog::query::folder_within(chosen, &n.path) && !same_folder(chosen, &n.path) {
|
||||
let key = lightcraft_catalog::query::folder_key(&n.path);
|
||||
ui.data_mut(|d| d.insert_temp(egui::Id::unique(("libfolder-open", key)), true));
|
||||
set_tree_open(ui, egui::Id::unique(("libfolder-open", key)), true);
|
||||
open_above(ui, &n.children, chosen);
|
||||
}
|
||||
}
|
||||
@@ -305,14 +307,16 @@ pub(crate) fn folder_row_of<'a>(tree: &'a [FolderNode], dir: &str) -> Option<&'a
|
||||
.find_map(|n| if same_folder(&n.path, dir) { Some(n) } else { folder_row_of(&n.children, dir) })
|
||||
}
|
||||
|
||||
pub(super) fn folder_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[FolderNode], indent: f32) {
|
||||
/// The rows of the Folders tree. `above`: what holds for these rows from the rows above them
|
||||
/// ([`tree_inside`]).
|
||||
pub(super) fn folder_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[FolderNode], indent: f32, above: Option<Said>) {
|
||||
for n in nodes {
|
||||
let key = lightcraft_catalog::query::folder_key(&n.path);
|
||||
let open_id = egui::Id::unique(("libfolder-open", key.clone()));
|
||||
// a disk starts open, and so does a folder that holds nothing itself and leads to one
|
||||
// folder (`Users` → `me`): the first row where the library branches is what you look for
|
||||
let leads_on = n.own == 0 && n.children.len() == 1;
|
||||
let mut open = tree_open(ui, open_id, n.volume || leads_on);
|
||||
let mut open = tree_open(ui, open_id, n.volume || leads_on, above);
|
||||
// a row whose path would cover other disks' photos too only opens and closes
|
||||
let name = if n.selectable { n.name.clone() } else { crate::i18n::tr("This Computer").to_string() };
|
||||
let id = format!("libfolder:{}", n.path);
|
||||
@@ -320,7 +324,7 @@ pub(super) fn folder_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[F
|
||||
folder_row(app, ui, n, &id, &name, indent, open_id, &mut open);
|
||||
}
|
||||
if open && !n.children.is_empty() {
|
||||
folder_rows(app, ui, &n.children, indent + INDENT_STEP);
|
||||
folder_rows(app, ui, &n.children, indent + INDENT_STEP, tree_inside(ui, open_id, above));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +345,7 @@ fn folder_row(app: &mut LightcraftApp, ui: &mut egui::Ui, n: &FolderNode, id: &s
|
||||
folder_drop_target(app, ui, &resp, n, open_id, open);
|
||||
let mut toggled = false;
|
||||
if !n.children.is_empty() {
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, open, format!("libraryFolderToggle:{}", n.path), name);
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, open, format!("libraryFolderToggle:{}", n.path), name, Inside::OpensAndFolds);
|
||||
toggled = tr.clicked();
|
||||
// the triangle sits on the row and takes its clicks: the menu opens from it too
|
||||
row_menu(app, &tr, n);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
use super::dates::browse_all_photos;
|
||||
use super::rows::{INDENT_STEP, Row, out_of_sight, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, Row, Said, out_of_sight, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Icon, KeywordNode, LightcraftApp, json};
|
||||
|
||||
/// "Keywords": the library's keyword tree with photo counts (`a|b|c` keywords nest). A click
|
||||
/// filters the grid by the keyword (children included), the triangle opens a level, and the
|
||||
/// context menu renames, merges or deletes the keyword across the library.
|
||||
pub(super) fn keyword_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[KeywordNode], indent: f32) {
|
||||
pub(super) fn keyword_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[KeywordNode], indent: f32, above: Option<Said>) {
|
||||
for n in nodes {
|
||||
// leaves (most keywords) have no open state to look up
|
||||
let open_id = (!n.children.is_empty()).then(|| egui::Id::unique(("kw-open", n.path.to_lowercase())));
|
||||
let mut open = open_id.is_some_and(|k| tree_open(ui, k, false));
|
||||
let mut open = open_id.is_some_and(|k| tree_open(ui, k, false, above));
|
||||
let id = format!("keyword:{}", n.path);
|
||||
if !out_of_sight(app, ui, &id, &n.name, Some(n.count), indent, false) {
|
||||
keyword_row(app, ui, n, &id, indent, open_id, &mut open);
|
||||
}
|
||||
if open {
|
||||
keyword_rows(app, ui, &n.children, indent + INDENT_STEP);
|
||||
if let Some(k) = open_id.filter(|_| open) {
|
||||
keyword_rows(app, ui, &n.children, indent + INDENT_STEP, tree_inside(ui, k, above));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,9 @@ fn keyword_row(app: &mut LightcraftApp, ui: &mut egui::Ui, n: &KeywordNode, id:
|
||||
let sel = app.session.filter.keyword.as_deref().is_some_and(|k| k.eq_ignore_ascii_case(&n.path));
|
||||
let resp = Row::new(id, Icon::Tag, &n.name).count(Some(n.count)).selected(sel).indent(indent).show(app, ui);
|
||||
if let Some(k) = open_id {
|
||||
tree_toggle(ui, &resp, indent, k, open, format!("keywordToggle:{}", n.path), &n.name);
|
||||
// (no keyword inside it has keywords of its own: there is nothing inside it to say of)
|
||||
let inside = if n.children.iter().any(|c| !c.children.is_empty()) { Inside::OpensAndFolds } else { Inside::Alone };
|
||||
tree_toggle(ui, &resp, indent, k, open, format!("keywordToggle:{}", n.path), &n.name, inside);
|
||||
}
|
||||
let resp = resp.on_hover_text(if n.children.is_empty() { n.path.clone() } else { format!("{} (includes the keywords below it)", n.path) });
|
||||
if resp.clicked() {
|
||||
|
||||
@@ -92,7 +92,7 @@ pub(super) fn local_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, now: &Local
|
||||
for (i, (name, path)) in local.places.iter().enumerate() {
|
||||
let transient = local.browse_root.as_deref() == Some(path.as_str());
|
||||
let reveal = local.owner == Some(i);
|
||||
folder_tree(app, ui, path, name, path, 0.0, current, reveal, transient);
|
||||
folder_tree(app, ui, path, name, path, 0.0, current, reveal, transient, None);
|
||||
}
|
||||
if app.services.pick_folder.is_some() && Row::new("local:browse", Icon::Plus, crate::i18n::tr("Browse Folder…")).show(app, ui).clicked() {
|
||||
let picked = app.services.pick_folder.as_mut().and_then(|f| f());
|
||||
@@ -372,7 +372,7 @@ mod tests {
|
||||
egui::ScrollArea::vertical().show(ui, |ui| {
|
||||
for index in 0..500 {
|
||||
let path = format!("/lightcraft-test/folder-{index:04}");
|
||||
super::folder_tree(&mut app, ui, &path, &format!("Folder {index}"), &path, 0.0, None, false, false);
|
||||
super::folder_tree(&mut app, ui, &path, &format!("Folder {index}"), &path, 0.0, None, false, false, None);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -560,7 +560,7 @@ mod tests {
|
||||
let raw = HeadlessView::raw_input(egui::vec2(300.0, 200.0), 1.0, frame as f64 / 60.0, vec![]);
|
||||
view.run(raw, |ui| {
|
||||
super::Row::new("all", super::Icon::Photos, "All Photos").show(&mut app, ui);
|
||||
super::folder_tree(&mut app, ui, path, "Pictures", path, 0.0, None, false, false);
|
||||
super::folder_tree(&mut app, ui, path, "Pictures", path, 0.0, None, false, false, None);
|
||||
});
|
||||
widgets = crate::widgets::take_registry(&view.ctx);
|
||||
}
|
||||
|
||||
@@ -288,19 +288,77 @@ pub(crate) fn disclosure_name(open: bool, name: &str) -> String {
|
||||
if open { crate::i18n::tr_format!("Collapse {name}", name = name) } else { crate::i18n::tr_format!("Expand {name}", name = name) }
|
||||
}
|
||||
|
||||
/// Whether the tree row `key` is open: what the user last chose this session, else `default`.
|
||||
pub(super) fn tree_open(ui: &egui::Ui, key: egui::Id, default: bool) -> bool {
|
||||
ui.data(|d| d.get_temp(key)).unwrap_or(default)
|
||||
/// What was last said of a tree row (or of all the rows inside one), and when: `at` counts what
|
||||
/// the user said this session, so what was said last holds.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub(crate) struct Said {
|
||||
open: bool,
|
||||
at: u64,
|
||||
}
|
||||
|
||||
/// The later of two sayings.
|
||||
fn newest(a: Option<Said>, b: Option<Said>) -> Option<Said> {
|
||||
match (a, b) {
|
||||
(Some(a), Some(b)) => Some(if b.at > a.at { b } else { a }),
|
||||
(a, b) => a.or(b),
|
||||
}
|
||||
}
|
||||
|
||||
/// Where what is said of the rows inside the tree row `key` is kept.
|
||||
fn inside_key(key: egui::Id) -> egui::Id {
|
||||
key.with("inside")
|
||||
}
|
||||
|
||||
/// Say `open` of the tree row `key` (and of the rows inside it, when `with_inside`) from now on.
|
||||
fn say(ui: &egui::Ui, key: egui::Id, open: bool, with_inside: bool) {
|
||||
ui.data_mut(|d| {
|
||||
let now = d.get_temp_mut_or_default::<u64>(egui::Id::unique("tree-said"));
|
||||
*now += 1;
|
||||
let said = Said { open, at: *now };
|
||||
d.insert_temp(key, said);
|
||||
if with_inside {
|
||||
d.insert_temp(inside_key(key), said);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Whether the tree row `key` is open: the last thing said of it this session, or of a row above
|
||||
/// it (`above`, see [`tree_inside`]), whichever is later, else `default`. A row that is not drawn
|
||||
/// yet is as it is said when it is.
|
||||
pub(super) fn tree_open(ui: &egui::Ui, key: egui::Id, default: bool, above: Option<Said>) -> bool {
|
||||
newest(ui.data(|d| d.get_temp(key)), above).map_or(default, |s| s.open)
|
||||
}
|
||||
|
||||
/// What holds for the rows inside the tree row `key`: what was last said of all of them, or of
|
||||
/// all the rows above `key` (`above`), whichever is later.
|
||||
pub(super) fn tree_inside(ui: &egui::Ui, key: egui::Id, above: Option<Said>) -> Option<Said> {
|
||||
newest(ui.data(|d| d.get_temp(inside_key(key))), above)
|
||||
}
|
||||
|
||||
/// Open or close the tree row `key` from now on.
|
||||
pub(super) fn set_tree_open(ui: &egui::Ui, key: egui::Id, open: bool) {
|
||||
ui.data_mut(|d| d.insert_temp(key, open));
|
||||
say(ui, key, open, false);
|
||||
}
|
||||
|
||||
/// What a click on a triangle with Option (Alt) held does to the rows inside its row.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub(super) enum Inside {
|
||||
/// Nothing: they have no rows inside them, so there is nothing to say of them (a month's
|
||||
/// days, keywords that hold none).
|
||||
Alone,
|
||||
/// They open and fold with it.
|
||||
OpensAndFolds,
|
||||
/// They fold with it; opened, it opens alone (Local: opening every folder inside would read
|
||||
/// them all from the disk, down to the last).
|
||||
Folds,
|
||||
}
|
||||
|
||||
/// The chevron of a tree row that has rows inside it (Albums' folders, Local, By Date, Folders,
|
||||
/// Keywords): a click flips `open` and remembers it under `key`. Returns the chevron's response
|
||||
/// (it sits on the row and takes its clicks, so a row's context menu is attached to it too).
|
||||
/// Keywords): a click flips `open` and remembers it under `key`. With Option (Alt) held, it opens
|
||||
/// or folds all the rows inside the row too, however many (`inside`): that is said once, of all
|
||||
/// of them, and each row checks it when it is drawn. Returns the chevron's response (it sits on
|
||||
/// the row and takes its clicks, so a row's context menu is attached to it too).
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(super) fn tree_toggle(
|
||||
ui: &mut egui::Ui,
|
||||
row: &egui::Response,
|
||||
@@ -309,11 +367,18 @@ pub(super) fn tree_toggle(
|
||||
open: &mut bool,
|
||||
widget: String,
|
||||
name: &str,
|
||||
inside: Inside,
|
||||
) -> egui::Response {
|
||||
let tri = disclosure_chevron(ui, row, indent, *open, key.with("triangle"), widget);
|
||||
if tri.clicked() {
|
||||
*open = !*open;
|
||||
set_tree_open(ui, key, *open);
|
||||
let option = ui.input(|i| i.modifiers.alt);
|
||||
let all = option && (inside == Inside::OpensAndFolds || (inside == Inside::Folds && !*open));
|
||||
say(ui, key, *open, all);
|
||||
if option && inside == Inside::Alone {
|
||||
// (what was said of the rows inside it when it had some with rows of their own)
|
||||
ui.data_mut(|d| d.remove::<Said>(inside_key(key)));
|
||||
}
|
||||
}
|
||||
// (the name of the row it opens: a screen reader lists the triangles one after another)
|
||||
let label = disclosure_name(*open, name);
|
||||
|
||||
@@ -30,7 +30,7 @@ pub enum LaunchLibrary {
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum GridBadges {
|
||||
/// On hover, on the selection, and on rated or flagged photos.
|
||||
/// Flags and colour labels always; stars and the edited mark on hover and on the selection.
|
||||
#[default]
|
||||
Auto,
|
||||
Always,
|
||||
|
||||
@@ -51,6 +51,7 @@ mod focus_point;
|
||||
mod folder_drop;
|
||||
mod grading;
|
||||
mod grid;
|
||||
mod grid_badges;
|
||||
mod grid_drag;
|
||||
mod guided_guides;
|
||||
mod histogram_drag;
|
||||
@@ -109,6 +110,7 @@ mod sync;
|
||||
mod tallies;
|
||||
mod temp_slider;
|
||||
mod text_prompt;
|
||||
mod thumb;
|
||||
mod titlebar;
|
||||
mod tool_overlay;
|
||||
mod unsaved;
|
||||
|
||||
@@ -46,7 +46,7 @@ fn filmstrip_stack_badge_expands_and_collapses_the_stack() {
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(h.settle(SETTLE), "the filmstrip settles before clicking its stack badge");
|
||||
assert!(!h.app.session.visible_cloned().contains(&member), "collapsed: only the top shows");
|
||||
let badge = format!("filmstack:{}", top.0);
|
||||
let badge = format!("film:stack:{}", top.0);
|
||||
let r = h.request("ui.clickWidget", json!({"id": badge}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(h.settle(SETTLE), "the expanded stack settles");
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
//! Grid badges under Settings ▸ Interface ▸ Grid: Auto keeps a mostly rated library clean (the
|
||||
//! stars and the edited mark show on hover and selection), while the decision marks (flag, colour
|
||||
//! label) stay visible; Always shows everything, Never nothing.
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use lightcraft_catalog::{ColorLabel, Flag, Op, Photo, PhotoId, Source};
|
||||
use lightcraft_engine::Session;
|
||||
use serde_json::json;
|
||||
|
||||
use crate::headless::Headless;
|
||||
use crate::state::{GridBadges, ViewMode};
|
||||
use crate::{LightcraftApp, Services};
|
||||
|
||||
const T: Duration = Duration::from_secs(30);
|
||||
const SETTLE: Duration = Duration::from_secs(60);
|
||||
|
||||
const RATED: PhotoId = PhotoId(1);
|
||||
const PICKED: PhotoId = PhotoId(2);
|
||||
const REJECTED: PhotoId = PhotoId(3);
|
||||
const EDITED: PhotoId = PhotoId(4);
|
||||
const PLAIN: PhotoId = PhotoId(5);
|
||||
const UNRATED_PICK: PhotoId = PhotoId(6);
|
||||
|
||||
fn library() -> Session {
|
||||
let mut s = Session::new();
|
||||
for i in 1..=6u64 {
|
||||
let name = format!("IMG_{i:03}.jpg");
|
||||
let mut p = Photo::new(
|
||||
PhotoId(i),
|
||||
Source::File { path: format!("/lightcraft-badges-test/{name}") },
|
||||
&name,
|
||||
"JPEG",
|
||||
6000,
|
||||
4000,
|
||||
"2026-01-01T00:00:00",
|
||||
);
|
||||
match PhotoId(i) {
|
||||
RATED => p.rating = 4,
|
||||
PICKED => {
|
||||
p.rating = 5;
|
||||
p.flag = Flag::Pick;
|
||||
p.label = Some(ColorLabel::Red);
|
||||
}
|
||||
REJECTED => {
|
||||
p.flag = Flag::Reject;
|
||||
p.label = Some(ColorLabel::Blue);
|
||||
}
|
||||
EDITED => Arc::make_mut(&mut p.develop).light.exposure = 1.0,
|
||||
UNRATED_PICK => p.flag = Flag::Pick,
|
||||
_ => {}
|
||||
}
|
||||
s.catalog.apply(Op::AddPhoto { photo: Box::new(p) }).unwrap();
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
/// The grid with `badges`, the plain photo selected and the pointer away from every tile.
|
||||
fn grid(badges: GridBadges) -> Headless {
|
||||
let app = LightcraftApp::new(library(), Services { png: None, ..Default::default() });
|
||||
let mut h = Headless::new(app, [1200.0, 800.0], 1.0);
|
||||
h.app.ui.view = ViewMode::PhotoGrid;
|
||||
h.app.ui.settings.grid_badges = badges;
|
||||
let r = h.request("engine.execute", json!({"command": "library.select", "params": {"ids": [PLAIN.0]}}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
move_to(&mut h, egui::pos2(1.0, 1.0));
|
||||
h
|
||||
}
|
||||
|
||||
fn move_to(h: &mut Headless, at: egui::Pos2) {
|
||||
h.request("ui.move", json!({"x": at.x, "y": at.y}), T);
|
||||
h.settle(SETTLE);
|
||||
h.step();
|
||||
}
|
||||
|
||||
fn hover(h: &mut Headless, id: PhotoId) {
|
||||
let r = h.request("ui.hoverWidget", json!({"id": format!("thumb:{}", id.0)}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
h.step();
|
||||
}
|
||||
|
||||
/// Which marks are drawn on the photo's tile, in a fixed order.
|
||||
fn marks(h: &Headless, id: PhotoId) -> Vec<&'static str> {
|
||||
["stars", "flag", "label", "edited"].into_iter().filter(|m| h.app.widgets.iter().any(|(w, _)| *w == format!("badge:{m}:{}", id.0))).collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn auto_hides_the_stars_of_a_photo_that_is_neither_hovered_nor_selected() {
|
||||
let h = grid(GridBadges::Auto);
|
||||
assert_eq!(marks(&h, RATED), Vec::<&str>::new());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn auto_shows_the_stars_while_the_photo_is_hovered_or_selected() {
|
||||
let mut h = grid(GridBadges::Auto);
|
||||
hover(&mut h, RATED);
|
||||
assert_eq!(marks(&h, RATED), ["stars"], "hovered");
|
||||
move_to(&mut h, egui::pos2(1.0, 1.0));
|
||||
assert_eq!(marks(&h, RATED), Vec::<&str>::new(), "the pointer left");
|
||||
let r = h.request("engine.execute", json!({"command": "library.select", "params": {"ids": [RATED.0]}}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
assert_eq!(marks(&h, RATED), ["stars"], "selected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn auto_always_shows_the_flag_and_the_colour_label() {
|
||||
let mut h = grid(GridBadges::Auto);
|
||||
assert_eq!(marks(&h, PICKED), ["flag", "label"], "the stars of a picked photo stay hidden");
|
||||
assert_eq!(marks(&h, REJECTED), ["flag", "label"]);
|
||||
hover(&mut h, PICKED);
|
||||
assert_eq!(marks(&h, PICKED), ["stars", "flag", "label"], "hover adds the stars to the marks");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn always_shows_everything_and_never_shows_nothing() {
|
||||
let h = grid(GridBadges::Always);
|
||||
assert_eq!(marks(&h, RATED), ["stars"]);
|
||||
assert_eq!(marks(&h, PICKED), ["stars", "flag", "label"]);
|
||||
assert_eq!(marks(&h, EDITED), ["edited"]);
|
||||
// (the setting is about ratings and flags: the justified grid has no surround to tint with a
|
||||
// colour label, so the label's dot stays, #2164)
|
||||
let h = grid(GridBadges::Never);
|
||||
for id in [RATED, EDITED] {
|
||||
assert_eq!(marks(&h, id), Vec::<&str>::new(), "photo {}", id.0);
|
||||
}
|
||||
for id in [PICKED, REJECTED] {
|
||||
assert_eq!(marks(&h, id), ["label"], "photo {}", id.0);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn auto_shows_the_edited_mark_with_the_stars() {
|
||||
let mut h = grid(GridBadges::Auto);
|
||||
assert_eq!(marks(&h, EDITED), Vec::<&str>::new());
|
||||
hover(&mut h, EDITED);
|
||||
assert_eq!(marks(&h, EDITED), ["edited"]);
|
||||
}
|
||||
|
||||
fn rect(h: &Headless, id: String) -> egui::Rect {
|
||||
h.app.widgets.iter().find(|(w, _)| *w == id).map(|(_, r)| *r).unwrap_or_else(|| panic!("no widget {id}"))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn auto_puts_the_flag_at_the_left_when_the_stars_are_hidden() {
|
||||
let mut h = grid(GridBadges::Auto);
|
||||
let cell = rect(&h, format!("thumb:{}", PICKED.0));
|
||||
let flag = rect(&h, format!("badge:flag:{}", PICKED.0));
|
||||
assert!(flag.left() - cell.left() < 12.0, "no gap for stars that aren't drawn: flag {flag:?} in {cell:?}");
|
||||
hover(&mut h, PICKED);
|
||||
let flag = rect(&h, format!("badge:flag:{}", PICKED.0));
|
||||
let stars = rect(&h, format!("badge:stars:{}", PICKED.0));
|
||||
assert!(flag.left() >= stars.right(), "the flag follows the stars: {flag:?} after {stars:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_unrated_photos_flag_does_not_move_on_hover() {
|
||||
let mut h = grid(GridBadges::Auto);
|
||||
let before = rect(&h, format!("badge:flag:{}", UNRATED_PICK.0));
|
||||
hover(&mut h, UNRATED_PICK);
|
||||
assert_eq!(rect(&h, format!("badge:flag:{}", UNRATED_PICK.0)), before);
|
||||
}
|
||||
@@ -45,8 +45,19 @@ fn label_tints_grid_and_filmstrip_chrome_without_changing_photo_pixels() {
|
||||
let mut h = app(view);
|
||||
let widget = if view == ViewMode::Detail { "film:1" } else { "thumb:1" };
|
||||
let cell = rect(&h, widget);
|
||||
// (the photo grid's label is the dot in the marks row: no band is laid over its pixels; the
|
||||
// square grid and the filmstrip also tint their surround)
|
||||
let sample = if view == ViewMode::PhotoGrid {
|
||||
egui::pos2(cell.right() - 40.0, cell.bottom() - 8.0)
|
||||
h.app.run("photo.label", json!({"label": "red"})).unwrap();
|
||||
h.step();
|
||||
let red = crate::theme::label_color(lightcraft_catalog::ColorLabel::Red);
|
||||
let dot = h.view.painted_shapes().into_iter().find_map(|s| match s {
|
||||
egui::epaint::Shape::Circle(c) if c.fill == red && cell.contains(c.center) => Some(c.center),
|
||||
_ => None,
|
||||
});
|
||||
h.app.run("photo.label", json!({"label": "none"})).unwrap();
|
||||
h.step();
|
||||
dot.expect("the label dot")
|
||||
} else {
|
||||
egui::pos2(cell.left() + 4.0, cell.center().y)
|
||||
};
|
||||
@@ -59,7 +70,7 @@ fn label_tints_grid_and_filmstrip_chrome_without_changing_photo_pixels() {
|
||||
h.step();
|
||||
let image = h.paint();
|
||||
let c = pixel(&image, sample);
|
||||
assert_ne!(c, pixel(&neutral, sample), "{view:?} {label} must tint the thumbnail surround/footer");
|
||||
assert_ne!(c, pixel(&neutral, sample), "{view:?} {label} must tint the thumbnail surround/label dot");
|
||||
assert!(!colours.contains(&c), "each label has a distinct tint: {view:?} {label}");
|
||||
colours.push(c);
|
||||
assert_eq!(pixel(&image, cell.center()), centre, "{view:?} {label} must not tint image pixels");
|
||||
|
||||
@@ -17,11 +17,14 @@ const T: Duration = Duration::from_secs(60);
|
||||
const PHOTOS: u64 = 40;
|
||||
|
||||
/// Photos `IMG_0000` … on a share; the first ten are gone. The existence check waits for `open`
|
||||
/// (a share that answers slowly), at most `guard`, and counts its calls, and those made on the UI thread.
|
||||
/// (a share that answers slowly), at most `guard`, and counts its calls, those made on the UI thread,
|
||||
/// and those of the missing check's own walk: a failed thumbnail's badge asks about its file too
|
||||
/// (`Availability`'s worker thread), which is a question of the moment, not a walk of the share.
|
||||
struct Share {
|
||||
open: Arc<AtomicBool>,
|
||||
on_ui: Arc<AtomicUsize>,
|
||||
calls: Arc<AtomicUsize>,
|
||||
walks: Arc<AtomicUsize>,
|
||||
}
|
||||
|
||||
fn app_on_a_slow_share(guard: Duration) -> (Headless, Share) {
|
||||
@@ -31,14 +34,23 @@ fn app_on_a_slow_share(guard: Duration) -> (Headless, Share) {
|
||||
let p = Photo::new(PhotoId(i + 1), Source::File { path }, &format!("IMG_{i:04}.jpg"), "JPEG", 60, 40, "2026-01-01T00:00:00");
|
||||
app.session.catalog.apply(Op::AddPhoto { photo: Box::new(p) }).unwrap();
|
||||
}
|
||||
let share = Share { open: Arc::new(AtomicBool::new(false)), on_ui: Arc::new(AtomicUsize::new(0)), calls: Arc::new(AtomicUsize::new(0)) };
|
||||
let (ui, open, on_ui, calls) = (std::thread::current().id(), share.open.clone(), share.on_ui.clone(), share.calls.clone());
|
||||
let share = Share {
|
||||
open: Arc::new(AtomicBool::new(false)),
|
||||
on_ui: Arc::new(AtomicUsize::new(0)),
|
||||
calls: Arc::new(AtomicUsize::new(0)),
|
||||
walks: Arc::new(AtomicUsize::new(0)),
|
||||
};
|
||||
let (ui, open, on_ui, calls, walks) =
|
||||
(std::thread::current().id(), share.open.clone(), share.on_ui.clone(), share.calls.clone(), share.walks.clone());
|
||||
let deadline = Instant::now() + guard;
|
||||
app.session.media.availability.set_probe(Arc::new(move |f| {
|
||||
calls.fetch_add(1, Ordering::SeqCst);
|
||||
if std::thread::current().id() == ui {
|
||||
let thread = std::thread::current();
|
||||
if thread.id() == ui {
|
||||
on_ui.fetch_add(1, Ordering::SeqCst);
|
||||
} else if thread.name() != Some("lc-availability") {
|
||||
walks.fetch_add(1, Ordering::SeqCst);
|
||||
}
|
||||
calls.fetch_add(1, Ordering::SeqCst);
|
||||
// (a hang guard: the check goes on after it, so a regression fails the test instead of hanging it)
|
||||
while !open.load(Ordering::SeqCst) && Instant::now() < deadline {
|
||||
std::thread::sleep(Duration::from_millis(1));
|
||||
@@ -143,17 +155,17 @@ fn an_answer_nobody_waited_for_is_given_to_the_next_request() {
|
||||
drop(gave_up);
|
||||
share.open.store(true, Ordering::SeqCst);
|
||||
assert!(h.step_until(T, |h| h.app.tasks.is_empty()), "the check ends without a caller");
|
||||
assert_eq!(share.calls.load(Ordering::SeqCst), PHOTOS as usize);
|
||||
assert_eq!(share.walks.load(Ordering::SeqCst), PHOTOS as usize);
|
||||
|
||||
let again = ask(&mut h);
|
||||
let reply = answer(&mut h, &again);
|
||||
assert_eq!(reply["ok"], true, "{reply}");
|
||||
assert_eq!(reply["result"].as_array().map(Vec::len), Some(10), "{reply}");
|
||||
assert_eq!(share.calls.load(Ordering::SeqCst), PHOTOS as usize, "no second walk of the share");
|
||||
assert_eq!(share.walks.load(Ordering::SeqCst), PHOTOS as usize, "no second walk of the share");
|
||||
// given once: the next request checks again
|
||||
let third = ask(&mut h);
|
||||
assert_eq!(answer(&mut h, &third)["ok"], true);
|
||||
assert_eq!(share.calls.load(Ordering::SeqCst), 2 * PHOTOS as usize);
|
||||
assert_eq!(share.walks.load(Ordering::SeqCst), 2 * PHOTOS as usize);
|
||||
}
|
||||
|
||||
/// A check that panics is a failure told to the caller, not a request left waiting for its timeout.
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
//! Headless tests of the thumbnail overlay the grid (justified and square) and the filmstrip share:
|
||||
//! the virtual-copy tag, the stack badge, the placeholder and the failure mark, and the one way a
|
||||
//! colour label shows.
|
||||
|
||||
use std::{cell::Cell, rc::Rc, time::Duration};
|
||||
|
||||
use egui::epaint::Shape;
|
||||
use egui::{Color32, Rect};
|
||||
use lightcraft_catalog::{ColorLabel, PhotoId};
|
||||
use serde_json::json;
|
||||
|
||||
use crate::headless::{Headless, RenderGate};
|
||||
use crate::i18n::Locale;
|
||||
use crate::render::Slot;
|
||||
use crate::state::ViewMode;
|
||||
use crate::{LightcraftApp, Services};
|
||||
|
||||
const T: Duration = Duration::from_secs(20);
|
||||
const SETTLE: Duration = Duration::from_secs(120);
|
||||
|
||||
fn demo() -> Headless {
|
||||
let mut app = LightcraftApp::new(lightcraft_engine::Session::with_demo(), Services { png: None, ..Default::default() });
|
||||
app.ui.view = ViewMode::PhotoGrid;
|
||||
Headless::new(app, [1400.0, 900.0], 1.0)
|
||||
}
|
||||
|
||||
fn run(h: &mut Headless, command: &str, params: serde_json::Value) {
|
||||
let r = h.request("engine.execute", json!({"command": command, "params": params}), T);
|
||||
assert_eq!(r["ok"], true, "{command}: {r}");
|
||||
}
|
||||
|
||||
fn widget(h: &Headless, id: &str) -> Option<Rect> {
|
||||
h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| *r)
|
||||
}
|
||||
|
||||
fn first_photos(h: &mut Headless, n: usize) -> Vec<PhotoId> {
|
||||
h.app.session.visible_cloned().into_iter().take(n).collect()
|
||||
}
|
||||
|
||||
/// Hover `id` and wait for a tooltip text that satisfies `says`.
|
||||
fn hover_says(h: &mut Headless, id: &str, says: impl Fn(&str) -> bool) -> bool {
|
||||
let r = h.request("ui.hoverWidget", json!({"id": id}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.step_until(Duration::from_secs(5), |h| h.painted_text().iter().any(|t| says(t)))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_virtual_copy_is_tagged_in_the_filmstrip_as_it_is_in_the_grid() {
|
||||
let mut h = demo();
|
||||
// (a landscape photo: a copy in a stack on a narrow portrait one has no room for its tag beside the
|
||||
// stack badge in the filmstrip, which then leaves it out by design)
|
||||
let master = first_photos(&mut h, 12)
|
||||
.into_iter()
|
||||
.find(|id| h.app.session.catalog.photo(*id).is_some_and(|p| p.width > p.height))
|
||||
.expect("a landscape photo");
|
||||
run(&mut h, "photo.virtualCopy", json!({"ids": [master.0]}));
|
||||
let copy = h.app.session.catalog.photos().find(|p| p.copy_name.is_some()).map(|p| p.id).expect("a virtual copy");
|
||||
h.settle(SETTLE);
|
||||
assert!(widget(&h, &format!("copy:{}", copy.0)).is_some(), "the grid tags the copy");
|
||||
assert!(widget(&h, &format!("copy:{}", master.0)).is_none(), "the master is not tagged");
|
||||
let r = h.request("ui.set", json!({"view": "detail"}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
assert!(widget(&h, &format!("film:copy:{}", copy.0)).is_some(), "the filmstrip tags the copy too");
|
||||
assert!(widget(&h, &format!("film:copy:{}", master.0)).is_none(), "and not the master");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_filmstrip_stack_badge_toggles_its_stack_like_the_grid_s() {
|
||||
let mut h = demo();
|
||||
let ids = first_photos(&mut h, 2);
|
||||
run(&mut h, "stack.group", json!({"ids": [ids[0].0, ids[1].0], "collapsed": false}));
|
||||
h.request("ui.set", json!({"view": "detail"}), T);
|
||||
h.settle(SETTLE);
|
||||
let collapsed = |h: &Headless| h.app.session.catalog.stack_of(ids[0]).map(|s| s.collapsed);
|
||||
assert_eq!(collapsed(&h), Some(false));
|
||||
let r = h.request("ui.clickWidget", json!({"id": format!("film:stack:{}", ids[0].0)}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
assert_eq!(collapsed(&h), Some(true), "a click on the filmstrip's badge collapses the stack");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_stack_badge_tooltip_is_translated_in_the_grid_and_the_filmstrip() {
|
||||
let mut h = demo();
|
||||
let ids = first_photos(&mut h, 2);
|
||||
run(&mut h, "stack.group", json!({"ids": [ids[0].0, ids[1].0], "collapsed": false}));
|
||||
h.settle(SETTLE);
|
||||
let r = h.request("ui.set", json!({"language": "de"}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
let german = Locale::De.tr("Stack — click to collapse (S)");
|
||||
let said = |t: &str| t == german;
|
||||
assert!(hover_says(&mut h, &format!("stack:{}", ids[0].0), said), "{:?}", h.painted_text());
|
||||
h.request("ui.move", json!({"x": 1, "y": 1}), T);
|
||||
h.request("ui.set", json!({"view": "detail"}), T);
|
||||
h.settle(SETTLE);
|
||||
assert!(hover_says(&mut h, &format!("film:stack:{}", ids[0].0), said), "{:?}", h.painted_text());
|
||||
crate::i18n::set_language(Locale::En);
|
||||
}
|
||||
|
||||
fn placeholder_in(h: &Headless, cell: Rect) -> bool {
|
||||
let skeleton = crate::theme::Tokens::get(&h.view.ctx).skeleton;
|
||||
h.view.painted_shapes().iter().any(|s| matches!(s, Shape::Rect(r) if r.fill == skeleton && cell.expand(1.0).contains_rect(r.rect)))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_thumbnail_that_is_not_drawn_yet_has_the_same_placeholder_in_the_filmstrip_and_the_grid() {
|
||||
let mut h = demo();
|
||||
// renders wait: no thumbnail exists
|
||||
h.app.renderer.set_offload(Box::new(RenderGate::new(Rc::new(Cell::new(false)))));
|
||||
let id = first_photos(&mut h, 1)[0];
|
||||
for _ in 0..10 {
|
||||
h.step();
|
||||
}
|
||||
let grid = widget(&h, &format!("thumb:{}", id.0)).expect("grid cell");
|
||||
assert!(placeholder_in(&h, grid), "the grid's placeholder");
|
||||
h.request("ui.set", json!({"view": "detail"}), T);
|
||||
for _ in 0..10 {
|
||||
h.step();
|
||||
}
|
||||
let film = widget(&h, &format!("film:{}", id.0)).expect("filmstrip cell");
|
||||
assert!(placeholder_in(&h, film), "the filmstrip draws the grid's placeholder too");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_failed_thumbnail_shows_a_mark_that_explains_itself_in_the_grid_and_the_filmstrip() {
|
||||
let mut h = demo();
|
||||
h.app.renderer.set_offload(Box::new(RenderGate::failing(Rc::new(Cell::new(true)), |s| matches!(s, Slot::Thumb(_)))));
|
||||
let id = first_photos(&mut h, 1)[0];
|
||||
let (grid_mark, film_mark) = (format!("badge:failed:{}", id.0), format!("film:failed:{}", id.0));
|
||||
assert!(h.step_until(SETTLE, |h| widget(h, &grid_mark).is_some()), "the grid's mark is a widget");
|
||||
assert!(!h.painted_text().iter().any(|t| t == "!"), "drawn as an icon, not a glyph");
|
||||
let says = |t: &str| t.contains("This photo can't be opened") && t.contains("no decoder for this raw") && t.contains("Reload from Disk");
|
||||
assert!(hover_says(&mut h, &grid_mark, says), "{:?}", h.painted_text());
|
||||
h.request("ui.move", json!({"x": 1, "y": 1}), T);
|
||||
h.request("ui.set", json!({"view": "detail"}), T);
|
||||
assert!(h.step_until(SETTLE, |h| widget(h, &film_mark).is_some()), "the filmstrip draws the mark");
|
||||
assert!(hover_says(&mut h, &film_mark, says), "{:?}", h.painted_text());
|
||||
}
|
||||
|
||||
fn label_dot_in(h: &Headless, cell: Rect) -> bool {
|
||||
let red = crate::theme::label_color(ColorLabel::Red);
|
||||
h.view.painted_shapes().iter().any(|s| matches!(s, Shape::Circle(c) if c.fill == red && cell.contains(c.center)))
|
||||
}
|
||||
|
||||
/// A band along a cell's lower edge the width of the cell: the footer a label once tinted over
|
||||
/// the justified grid's photo.
|
||||
fn footer_band_in(h: &Headless, cell: Rect) -> bool {
|
||||
h.view.painted_shapes().iter().any(|s| {
|
||||
matches!(s, Shape::Rect(r) if (r.rect.width() - cell.width()).abs() < 0.5 && (r.rect.height() - 24.0).abs() < 0.5 && (r.rect.bottom() - cell.bottom()).abs() < 0.5 && r.fill.a() > 0 && r.fill != Color32::from_black_alpha(120))
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_label_is_the_dot_in_the_marks_row_on_every_surface_and_no_footer_covers_the_photo() {
|
||||
let mut h = demo();
|
||||
let id = first_photos(&mut h, 1)[0];
|
||||
run(&mut h, "photo.label", json!({"ids": [id.0], "label": "red"}));
|
||||
// not selected, not hovered: the footer would show on its own
|
||||
let other = first_photos(&mut h, 2)[1];
|
||||
run(&mut h, "library.select", json!({"ids": [other.0]}));
|
||||
h.step();
|
||||
for (view, cell) in [(ViewMode::PhotoGrid, "thumb"), (ViewMode::SquareGrid, "thumb"), (ViewMode::Detail, "film")] {
|
||||
h.app.ui.view = view;
|
||||
h.settle(SETTLE);
|
||||
let r = widget(&h, &format!("{cell}:{}", id.0)).unwrap_or_else(|| panic!("{view:?}: the photo's cell"));
|
||||
assert!(label_dot_in(&h, r), "{view:?}: the label dot");
|
||||
assert!(!footer_band_in(&h, r), "{view:?}: no tinted footer over the photo");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn with_ratings_and_flags_off_the_justified_grid_still_shows_the_label() {
|
||||
let mut h = demo();
|
||||
let ids = first_photos(&mut h, 2);
|
||||
run(&mut h, "photo.label", json!({"ids": [ids[0].0], "label": "red"}));
|
||||
run(&mut h, "library.select", json!({"ids": [ids[1].0]}));
|
||||
h.app.ui.settings.grid_badges = crate::state::GridBadges::Never;
|
||||
h.settle(SETTLE);
|
||||
let cell = widget(&h, &format!("thumb:{}", ids[0].0)).expect("the photo's cell");
|
||||
assert!(label_dot_in(&h, cell), "the label is not a rating or a flag: it stays, the grid has no surround to tint");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn right_clicking_the_filmstrips_stack_badge_opens_the_photo_menu() {
|
||||
let mut h = demo();
|
||||
let ids = first_photos(&mut h, 2);
|
||||
run(&mut h, "stack.group", json!({"ids": [ids[0].0, ids[1].0], "collapsed": false}));
|
||||
h.request("ui.set", json!({"view": "detail"}), T);
|
||||
h.settle(SETTLE);
|
||||
assert!(!egui::Popup::is_any_open(&h.view.ctx));
|
||||
let r = h.request("ui.clickWidget", json!({"id": format!("film:stack:{}", ids[0].0), "button": "right"}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
assert!(egui::Popup::is_any_open(&h.view.ctx), "the photo's menu, as on the rest of the cell");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn right_clicking_the_grids_stack_badge_opens_the_photo_menu() {
|
||||
let mut h = demo();
|
||||
let ids = first_photos(&mut h, 2);
|
||||
run(&mut h, "stack.group", json!({"ids": [ids[0].0, ids[1].0], "collapsed": false}));
|
||||
h.settle(SETTLE);
|
||||
assert!(!egui::Popup::is_any_open(&h.view.ctx));
|
||||
let r = h.request("ui.clickWidget", json!({"id": format!("stack:{}", ids[0].0), "button": "right"}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(SETTLE);
|
||||
assert!(egui::Popup::is_any_open(&h.view.ctx), "the photo's menu, as on the rest of the cell");
|
||||
}
|
||||
|
||||
/// The overlay's wiring: a photo with no marks drawn has nothing for the pill to dodge, so on a
|
||||
/// short 16:9 cell of the square grid at 90 pt (70 x 39) the pill keeps its word.
|
||||
#[test]
|
||||
fn the_preview_pill_keeps_its_word_on_a_short_photo_with_no_marks() {
|
||||
let mut h = demo();
|
||||
let id = first_photos(&mut h, 1)[0];
|
||||
run(&mut h, "photo.rate", json!({"ids": [id.0], "rating": 0}));
|
||||
run(&mut h, "photo.flag", json!({"ids": [id.0], "flag": "none"}));
|
||||
run(&mut h, "photo.label", json!({"ids": [id.0], "label": "none"}));
|
||||
let other = first_photos(&mut h, 2)[1];
|
||||
run(&mut h, "library.select", json!({"ids": [other.0]}));
|
||||
let p = h.app.session.catalog.photo(id).expect("photo").clone();
|
||||
let op = lightcraft_catalog::Op::SetContent {
|
||||
id,
|
||||
width: 1600,
|
||||
height: 900,
|
||||
file_size: p.file_size,
|
||||
content_hash: p.content_hash.clone(),
|
||||
preview_only: Some("Cr3 files are not decoded yet".into()),
|
||||
preview_checked: "0.5.0".into(),
|
||||
};
|
||||
h.app.session.catalog.apply(op).unwrap();
|
||||
// Let every render already under way finish first. The photo's thumbnail was requested on the
|
||||
// job pool before the gate below, and a pool job keeps its request: while it is pending the
|
||||
// grid asks for nothing new, so it lands whenever the worker is done and draws the picture
|
||||
// (on a loaded runner after any fixed number of frames).
|
||||
assert!(h.settle(SETTLE), "the renders started before the gate finish");
|
||||
// no thumbnail: the photo is its placeholder, 16:9. A thumbnail the demo already rendered
|
||||
// would be drawn at the picture's own shape instead (a portrait one leaves the pill no room).
|
||||
h.app.renderer.set_offload(Box::new(RenderGate::new(Rc::new(Cell::new(false)))));
|
||||
h.app.renderer.textures.remove(&Slot::Thumb(id));
|
||||
h.app.renderer.textures.remove(&Slot::ThumbQuick(id));
|
||||
h.app.ui.view = ViewMode::SquareGrid;
|
||||
h.app.ui.thumb_size = 90.0;
|
||||
for _ in 0..10 {
|
||||
h.step();
|
||||
}
|
||||
assert!(h.app.renderer.thumb(id).is_none(), "the photo is still its placeholder");
|
||||
let pill = widget(&h, &format!("badge:previewOnly:{}", id.0)).expect("the pill is drawn");
|
||||
assert!(pill.width() > 30.0, "its word is there, not the icon alone: {pill:?}");
|
||||
}
|
||||
@@ -0,0 +1,926 @@
|
||||
//! The overlay a thumbnail wears, drawn the same way in the justified grid, the square grid and the
|
||||
//! filmstrip: the stack badge (top left), the virtual-copy tag (top right), the failure mark, the
|
||||
//! preview-only pill and the marks row along the photo's lower edge (rating, flag, edited, colour
|
||||
//! label).
|
||||
//!
|
||||
//! Everything is laid out against the picture itself, not its cell, and painted clipped to it: on
|
||||
//! a narrow tile (a portrait photo at the smallest thumbnail size) the marks degrade instead of
|
||||
//! running over the photo's edge (see [`bar_layout`], [`copy_tag_layout`], [`stack_layout`] and
|
||||
//! [`preview_pill_place`], pure functions of the room on offer).
|
||||
|
||||
use egui::{Align2, Color32, Painter, Rect, Sense, Stroke, pos2, vec2};
|
||||
use lightcraft_catalog::{Flag, Photo, PhotoId, StackId};
|
||||
|
||||
use crate::{
|
||||
LightcraftApp,
|
||||
icons::{Icon, paint},
|
||||
theme::Tokens,
|
||||
widgets::register,
|
||||
};
|
||||
|
||||
/// Where a thumbnail is drawn: its marks keep the proportions of the surface.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub(crate) enum Surface {
|
||||
/// The justified and the square grid.
|
||||
Grid,
|
||||
/// The strip under the loupe.
|
||||
Film,
|
||||
}
|
||||
|
||||
/// The sizes, in points, of a surface's marks.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub(crate) struct Metrics {
|
||||
/// A star's side and the distance between two, and the shared rating drawing of that size (its
|
||||
/// side and step are the same numbers).
|
||||
star: f32,
|
||||
star_pitch: f32,
|
||||
rating: crate::rating::RatingSize,
|
||||
/// The room a digit takes in a compact rating.
|
||||
digit: f32,
|
||||
/// The flag's icon, and the room it takes (a gap to what is left of it included).
|
||||
flag_icon: f32,
|
||||
flag: f32,
|
||||
/// The edited mark's icon and room.
|
||||
edited_icon: f32,
|
||||
edited: f32,
|
||||
/// The label dot's radius and room.
|
||||
dot: f32,
|
||||
label: f32,
|
||||
/// The marks row's height, its padding at each end and the gap between its two groups.
|
||||
bar: f32,
|
||||
pad: f32,
|
||||
gap: f32,
|
||||
/// How far the corner badges sit from the photo's corner, and how high they are.
|
||||
inset: f32,
|
||||
badge: f32,
|
||||
/// What a stack badge adds to its text (icon and padding), and what a copy tag adds to its
|
||||
/// name; a copy tag without its name is `copy_icon` wide.
|
||||
stack_extra: f32,
|
||||
copy_extra: f32,
|
||||
copy_icon: f32,
|
||||
/// What the preview pill adds to its text; without its text it is `pill_icon` wide.
|
||||
pill_extra: f32,
|
||||
pill_icon: f32,
|
||||
font: f32,
|
||||
micro: f32,
|
||||
/// Whether a band darkens the row under any marks (the filmstrip's), not only under the pointer
|
||||
/// and on a chosen photo (the grid's).
|
||||
band: bool,
|
||||
}
|
||||
|
||||
impl Surface {
|
||||
pub(crate) fn metrics(self) -> Metrics {
|
||||
match self {
|
||||
Surface::Grid => Metrics {
|
||||
star: 12.0,
|
||||
star_pitch: 13.0,
|
||||
rating: crate::rating::RatingSize::Medium,
|
||||
digit: 7.0,
|
||||
flag_icon: 14.0,
|
||||
flag: 18.0,
|
||||
edited_icon: 14.0,
|
||||
edited: 20.0,
|
||||
dot: 5.0,
|
||||
label: 14.0,
|
||||
bar: 24.0,
|
||||
pad: 4.0,
|
||||
gap: 6.0,
|
||||
inset: 5.0,
|
||||
badge: 20.0,
|
||||
stack_extra: 30.0,
|
||||
copy_extra: 26.0,
|
||||
copy_icon: 20.0,
|
||||
pill_extra: 24.0,
|
||||
pill_icon: 16.0,
|
||||
font: 11.0,
|
||||
micro: 9.5,
|
||||
band: false,
|
||||
},
|
||||
Surface::Film => Metrics {
|
||||
star: 8.0,
|
||||
star_pitch: 9.0,
|
||||
rating: crate::rating::RatingSize::Small,
|
||||
digit: 5.0,
|
||||
flag_icon: 10.0,
|
||||
flag: 12.0,
|
||||
edited_icon: 10.0,
|
||||
edited: 14.0,
|
||||
dot: 3.5,
|
||||
label: 10.0,
|
||||
bar: 15.0,
|
||||
pad: 3.0,
|
||||
gap: 4.0,
|
||||
inset: 3.0,
|
||||
badge: 15.0,
|
||||
stack_extra: 22.0,
|
||||
copy_extra: 20.0,
|
||||
copy_icon: 16.0,
|
||||
pill_extra: 20.0,
|
||||
pill_icon: 14.0,
|
||||
font: 9.5,
|
||||
micro: 8.5,
|
||||
band: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// The widget ids of a surface: the grid's keep their names, the filmstrip's start with `film:`.
|
||||
fn widget(self, kind: Mark, id: PhotoId) -> String {
|
||||
let (grid, film) = match kind {
|
||||
Mark::Stack => ("stack", "film:stack"),
|
||||
Mark::Copy => ("copy", "film:copy"),
|
||||
Mark::Preview => ("badge:previewOnly", "film:previewOnly"),
|
||||
Mark::Failed => ("badge:failed", "film:failed"),
|
||||
};
|
||||
format!("{}:{}", if self == Surface::Grid { grid } else { film }, id.0)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum Mark {
|
||||
Stack,
|
||||
Copy,
|
||||
Preview,
|
||||
Failed,
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ the marks row
|
||||
|
||||
/// What a photo carries along its lower edge.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub(crate) struct Marks {
|
||||
pub rating: u8,
|
||||
pub flag: bool,
|
||||
pub edited: bool,
|
||||
pub label: bool,
|
||||
}
|
||||
|
||||
impl Marks {
|
||||
pub(crate) fn of(photo: &Photo) -> Self {
|
||||
Marks { rating: photo.rating.min(5), flag: photo.flag != Flag::None, edited: photo.is_edited(), label: photo.label.is_some() }
|
||||
}
|
||||
}
|
||||
|
||||
/// How the rating is drawn.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub(crate) enum Stars {
|
||||
#[default]
|
||||
None,
|
||||
/// One star per point of the rating.
|
||||
Row(u8),
|
||||
/// One star and the number: "★3".
|
||||
Compact(u8),
|
||||
}
|
||||
|
||||
/// Which marks a row draws.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub(crate) struct BarLayout {
|
||||
pub stars: Stars,
|
||||
pub flag: bool,
|
||||
pub edited: bool,
|
||||
pub label: bool,
|
||||
}
|
||||
|
||||
impl BarLayout {
|
||||
pub(crate) fn is_empty(&self) -> bool {
|
||||
*self == BarLayout::default()
|
||||
}
|
||||
|
||||
/// The width the row takes, its padding included; 0 for an empty row.
|
||||
pub(crate) fn width(&self, m: &Metrics) -> f32 {
|
||||
let stars = match self.stars {
|
||||
Stars::None => 0.0,
|
||||
Stars::Row(n) => f32::from(n) * m.star_pitch,
|
||||
Stars::Compact(_) => m.star + 1.0 + m.digit,
|
||||
};
|
||||
let left = stars + if self.flag { m.flag } else { 0.0 };
|
||||
let right = if self.edited { m.edited } else { 0.0 } + if self.label { m.label } else { 0.0 };
|
||||
if left + right == 0.0 {
|
||||
return 0.0;
|
||||
}
|
||||
left + right + if left > 0.0 && right > 0.0 { m.gap } else { 0.0 } + 2.0 * m.pad
|
||||
}
|
||||
|
||||
fn fits(&self, width: f32, m: &Metrics) -> bool {
|
||||
self.width(m) <= width
|
||||
}
|
||||
}
|
||||
|
||||
/// The marks a photo `width` points wide has room for, as the tile narrows: first all of them;
|
||||
/// then without the edited mark; then the stars as one star and the number; then only what fits
|
||||
/// whole, by importance: the flag, the rating, the label. Where the surface has no surround to
|
||||
/// tint (`label_first`) the label is the only sign of the label, so it comes first.
|
||||
pub(crate) fn bar_layout(width: f32, marks: Marks, m: &Metrics, label_first: bool) -> BarLayout {
|
||||
let stars = if marks.rating > 0 { Stars::Row(marks.rating) } else { Stars::None };
|
||||
let full = BarLayout { stars, flag: marks.flag, edited: marks.edited, label: marks.label };
|
||||
if full.fits(width, m) {
|
||||
return full;
|
||||
}
|
||||
let plain = BarLayout { edited: false, ..full };
|
||||
if plain.fits(width, m) {
|
||||
return plain;
|
||||
}
|
||||
// (one star is already as small as a rating gets)
|
||||
let compact = if marks.rating > 1 { Stars::Compact(marks.rating) } else { stars };
|
||||
let squeezed = BarLayout { stars: compact, ..plain };
|
||||
if squeezed.fits(width, m) {
|
||||
return squeezed;
|
||||
}
|
||||
#[derive(Clone, Copy)]
|
||||
enum Item {
|
||||
Flag,
|
||||
Stars,
|
||||
Label,
|
||||
}
|
||||
let order = if label_first { [Item::Label, Item::Flag, Item::Stars] } else { [Item::Flag, Item::Stars, Item::Label] };
|
||||
let mut out = BarLayout::default();
|
||||
for item in order {
|
||||
let next = match item {
|
||||
Item::Flag if marks.flag => BarLayout { flag: true, ..out },
|
||||
Item::Stars if compact != Stars::None => BarLayout { stars: compact, ..out },
|
||||
Item::Label if marks.label => BarLayout { label: true, ..out },
|
||||
_ => continue,
|
||||
};
|
||||
if next.fits(width, m) {
|
||||
out = next;
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ the corner badges
|
||||
|
||||
/// How the virtual-copy tag is drawn.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) enum CopyTag {
|
||||
/// The icon and the copy's name.
|
||||
Full,
|
||||
/// The icon alone.
|
||||
IconOnly,
|
||||
/// No room: the stack badge, or the photo's edge, is in the way.
|
||||
Hidden,
|
||||
}
|
||||
|
||||
/// The least clear space between the stack badge and the copy tag.
|
||||
const COPY_GAP: f32 = 4.0;
|
||||
|
||||
/// The copy tag for a photo `width` wide whose name is `name_w` wide, next to a stack badge
|
||||
/// `stack_w` wide (if it has one): the tag gives up its name before it would run into the badge
|
||||
/// or over the photo's edge, and then gives up its icon.
|
||||
pub(crate) fn copy_tag_layout(width: f32, stack_w: Option<f32>, name_w: f32, m: &Metrics) -> CopyTag {
|
||||
let room = width - 2.0 * m.inset - stack_w.map_or(0.0, |w| w + COPY_GAP);
|
||||
if name_w + m.copy_extra <= room {
|
||||
CopyTag::Full
|
||||
} else if m.copy_icon <= room {
|
||||
CopyTag::IconOnly
|
||||
} else {
|
||||
CopyTag::Hidden
|
||||
}
|
||||
}
|
||||
|
||||
/// Where the preview-only pill goes.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub(crate) struct PillPlace {
|
||||
pub rect: Rect,
|
||||
/// With its word, else the icon alone.
|
||||
pub full: bool,
|
||||
}
|
||||
|
||||
/// Where the preview-only pill goes on `photo`: above the marks row if that is clear, else below
|
||||
/// the stack badge `stack`, else beside it as the icon alone. `hard` are what it must never cover
|
||||
/// (the stack badge, the copy tag), `soft` what it may sit over when nothing else is clear (the
|
||||
/// marks strip, whose marks are drawn at its ends). Order: a spot clear of both, then one clear of
|
||||
/// `hard`, then, as it changes what editing does and so is never hidden, the icon at the first
|
||||
/// spot. The word goes before the icon.
|
||||
pub(crate) fn preview_pill_place(photo: Rect, text_w: f32, stack: Option<Rect>, hard: &[Rect], soft: &[Rect], m: &Metrics) -> PillPlace {
|
||||
let h = m.pill_icon;
|
||||
let x = photo.left() + m.inset;
|
||||
let above = (photo.bottom() - m.bar - 4.0 - h).max(photo.top() + m.inset);
|
||||
let mut tries = vec![(pos2(x, above), true), (pos2(x, above), false)];
|
||||
if let Some(s) = stack {
|
||||
let below = s.bottom() + 3.0;
|
||||
tries.extend([(pos2(x, below), true), (pos2(x, below), false), (pos2(s.right() + 3.0, s.top()), false)]);
|
||||
}
|
||||
let overlap = |a: Rect, b: Rect| a.min.x < b.max.x && b.min.x < a.max.x && a.min.y < b.max.y && b.min.y < a.max.y;
|
||||
let spots: Vec<PillPlace> = tries
|
||||
.into_iter()
|
||||
.map(|(at, full)| PillPlace { rect: Rect::from_min_size(at, vec2(if full { text_w + m.pill_extra } else { h }, h)), full })
|
||||
.filter(|p| {
|
||||
let r = p.rect;
|
||||
r.left() >= photo.left() && r.right() <= photo.right() - m.inset && r.top() >= photo.top() && r.bottom() <= photo.bottom()
|
||||
})
|
||||
.collect();
|
||||
let clear = |p: &&PillPlace, of: &[&[Rect]]| !of.iter().any(|set| set.iter().any(|o| overlap(p.rect, *o)));
|
||||
spots
|
||||
.iter()
|
||||
.find(|p| clear(p, &[hard, soft]))
|
||||
.or_else(|| spots.iter().find(|p| clear(p, &[hard])))
|
||||
.copied()
|
||||
.unwrap_or(PillPlace { rect: Rect::from_min_size(pos2(x, above), vec2(h, h)), full: false })
|
||||
}
|
||||
|
||||
/// The strip the marks row covers: `None` when it draws nothing (no marks that fit, and no band
|
||||
/// under the pointer or on a chosen photo), so that nothing else keeps clear of it.
|
||||
pub(crate) fn marks_extent(rect: Rect, marks: Marks, hot: bool, only_label: bool, label_first: bool, m: &Metrics) -> Option<Rect> {
|
||||
let layout = bar_layout(rect.width(), marks, m, label_first);
|
||||
(!layout.is_empty() || (!only_label && hot)).then(|| marks_bar(rect, m))
|
||||
}
|
||||
|
||||
/// How the stack badge is drawn.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) enum StackShape {
|
||||
/// Icon and `i/n` (or the count on a collapsed stack's top).
|
||||
Full,
|
||||
/// `i/n` without the icon.
|
||||
NoIcon,
|
||||
/// The count alone.
|
||||
CountOnly,
|
||||
}
|
||||
|
||||
/// The stack badge for `room` points (the photo's width less its two insets), whose text is
|
||||
/// `full_w` wide and its count alone `count_w`: the shape and the width. The count alone is the
|
||||
/// last shape; when even it is wider than the room the badge is drawn clipped to the photo.
|
||||
pub(crate) fn stack_layout(room: f32, full_w: f32, count_w: f32, m: &Metrics) -> (StackShape, f32) {
|
||||
let pad = 2.0 * m.pad + 2.0;
|
||||
let full = full_w + m.stack_extra;
|
||||
let bare = full_w + pad;
|
||||
if full <= room {
|
||||
(StackShape::Full, full)
|
||||
} else if bare <= room {
|
||||
(StackShape::NoIcon, bare)
|
||||
} else {
|
||||
(StackShape::CountOnly, count_w + pad)
|
||||
}
|
||||
}
|
||||
|
||||
/// The marks row's strip along the photo's lower edge.
|
||||
fn marks_bar(rect: Rect, m: &Metrics) -> Rect {
|
||||
Rect::from_min_max(pos2(rect.left(), (rect.bottom() - m.bar).max(rect.top())), rect.right_bottom())
|
||||
}
|
||||
|
||||
/// The overlay's painter: nothing is painted outside the photo.
|
||||
fn clipped(ui: &egui::Ui, th: &Thumb) -> Painter {
|
||||
let p = ui.painter();
|
||||
p.with_clip_rect(th.rect.intersect(p.clip_rect()))
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ texts
|
||||
|
||||
/// What a screen reader says of a rating: the number follows its label, so that it reads right in
|
||||
/// every language whatever its plural forms (no "star"/"stars" suffix to pick).
|
||||
pub(crate) fn spoken_rating(rating: u8) -> String {
|
||||
crate::i18n::tr_format!(", rating {} of 5", rating)
|
||||
}
|
||||
|
||||
/// What the failure mark says on hover: why the photo has no thumbnail, in plain words, where to
|
||||
/// go from there, and the error itself. (The loupe's pill uses the same two headlines.)
|
||||
pub(crate) fn failure_text(offline: bool, error: &str) -> String {
|
||||
let (head, hint) = if offline {
|
||||
(crate::i18n::tr("Original offline · no smart preview"), crate::i18n::tr("Right-click ▸ Locate Missing File… to find it again."))
|
||||
} else {
|
||||
(crate::i18n::tr("This photo can't be opened"), crate::i18n::tr("Right-click ▸ Reload from Disk to try again."))
|
||||
};
|
||||
format!("{head}\n{hint}\n{error}")
|
||||
}
|
||||
|
||||
fn stack_tip(collapsed: bool) -> &'static str {
|
||||
crate::i18n::tr(if collapsed { "Stack — click to expand (S)" } else { "Stack — click to collapse (S)" })
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ placeholder
|
||||
|
||||
/// Where a photo of `aspect` (width / height) sits in `area`, when its thumbnail is not drawn yet.
|
||||
pub(crate) fn placeholder_rect(area: Rect, aspect: f32) -> Rect {
|
||||
let aspect = if aspect.is_finite() && aspect > 0.0 { aspect } else { 1.5 };
|
||||
let (w, h) = if area.width() / aspect <= area.height() { (area.width(), area.width() / aspect) } else { (area.height() * aspect, area.height()) };
|
||||
Rect::from_center_size(area.center(), vec2(w, h))
|
||||
}
|
||||
|
||||
/// The picture's stand-in: the theme's skeleton color (firmer than the cell on the light themes).
|
||||
pub(crate) fn paint_placeholder(p: &Painter, rect: Rect, t: &Tokens) {
|
||||
p.rect_filled(rect, 0.0, t.skeleton);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ the overlay
|
||||
|
||||
/// One thumbnail to put the overlay on.
|
||||
pub(crate) struct Thumb<'a> {
|
||||
pub surface: Surface,
|
||||
pub photo: &'a Photo,
|
||||
/// The picture (or the placeholder standing for it) on screen.
|
||||
pub rect: Rect,
|
||||
/// The photo's stack and its place in it.
|
||||
pub stack: Option<(StackId, usize)>,
|
||||
/// Whether the marks row is drawn (Settings → Interface).
|
||||
pub marks: bool,
|
||||
/// Whether the stars and the edited mark are in it (the grid's Stars on hover shows only the
|
||||
/// flag and the colour label until the photo is hovered or chosen).
|
||||
pub extras: bool,
|
||||
/// The pointer is over the cell, or it is chosen: the row's band shows even without marks.
|
||||
pub hot: bool,
|
||||
/// Why the thumbnail could not be drawn, when it could not.
|
||||
pub failure: Option<String>,
|
||||
/// Whether the surface tints the cell around the photo with its colour label (the square grid
|
||||
/// and the filmstrip do; the justified grid has no surround).
|
||||
pub surround: bool,
|
||||
}
|
||||
|
||||
/// Draws the overlay; returns the stack badge's response, which covers part of the cell, so that
|
||||
/// its caller can give it the cell's context menu.
|
||||
pub(crate) fn overlay(app: &mut LightcraftApp, ui: &mut egui::Ui, th: &Thumb) -> Option<egui::Response> {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let m = th.surface.metrics();
|
||||
let photo = th.photo;
|
||||
let p = clipped(ui, th);
|
||||
let rect = th.rect;
|
||||
// (a rejected photo is dimmed under its marks, not over them)
|
||||
if photo.flag == Flag::Reject {
|
||||
p.rect_filled(rect, 0.0, Color32::from_black_alpha(110));
|
||||
}
|
||||
if let Some(error) = &th.failure {
|
||||
failure_mark(app, ui, th, &t, error);
|
||||
}
|
||||
let bar = if th.marks {
|
||||
marks_row(ui.ctx(), &p, &t, &m, th, false)
|
||||
} else if !th.surround && photo.label.is_some() {
|
||||
// the setting is about ratings and flags: where no tinted surround says the label, its dot stays
|
||||
marks_row(ui.ctx(), &p, &t, &m, th, true)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let stack = th.stack.and_then(|(sid, pos)| stack_badge(app, ui, th, &t, sid, pos));
|
||||
let stack_rect = stack.as_ref().map(|(r, _)| *r);
|
||||
let mut hard: Vec<Rect> = stack_rect.into_iter().collect();
|
||||
if let Some(name) = &photo.copy_name {
|
||||
hard.extend(copy_tag(ui, th, &t, name, stack_rect.map(|r| r.width())));
|
||||
}
|
||||
if let Some(why) = &photo.preview_only {
|
||||
preview_pill(ui, th, &t, why, stack_rect, &hard, bar.as_slice());
|
||||
}
|
||||
stack.map(|(_, r)| r)
|
||||
}
|
||||
|
||||
fn failure_mark(app: &LightcraftApp, ui: &mut egui::Ui, th: &Thumb, t: &Tokens, error: &str) {
|
||||
let id = th.photo.id;
|
||||
let side = (th.rect.width().min(th.rect.height()) * 0.4).clamp(12.0, 22.0);
|
||||
let icon = Rect::from_center_size(th.rect.center(), vec2(side, side));
|
||||
// (the text colour: it stands 3:1 on every theme's placeholder, which the amber does not on the light ones)
|
||||
paint(&clipped(ui, th), icon, Icon::Warning, t.text);
|
||||
let target = icon.expand(4.0).intersect(th.rect);
|
||||
register(ui, th.surface.widget(Mark::Failed, id), target);
|
||||
let offline = matches!(&th.photo.source, lightcraft_catalog::Source::File { path } if app.session.media.availability.is_offline(path));
|
||||
let text = failure_text(offline, error);
|
||||
let resp = ui.interact(target, egui::Id::unique((th.surface, "thumb-failed", id.0)), Sense::hover()).on_hover_text(&text);
|
||||
resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Label, true, text.replace('\n', ": ")));
|
||||
}
|
||||
|
||||
/// Draws the marks row; returns the strip it covers, if it drew anything.
|
||||
fn marks_row(ctx: &egui::Context, p: &Painter, t: &Tokens, m: &Metrics, th: &Thumb, only_label: bool) -> Option<Rect> {
|
||||
let (photo, rect) = (th.photo, th.rect);
|
||||
// (each mark drawn is registered as `badge:{name}:{id}`, in the filmstrip `film:badge:…`)
|
||||
let mark = |name: &str, at: Rect| {
|
||||
let prefix = if th.surface == Surface::Grid { "badge" } else { "film:badge" };
|
||||
// painted only, nothing here takes a click: geometry, not a widget
|
||||
crate::widgets::register_geometry(ctx, format!("{prefix}:{name}:{}", photo.id.0), at);
|
||||
};
|
||||
let marks = if only_label {
|
||||
Marks { label: true, ..Marks::default() }
|
||||
} else if th.extras {
|
||||
Marks::of(photo)
|
||||
} else {
|
||||
Marks { rating: 0, edited: false, ..Marks::of(photo) }
|
||||
};
|
||||
let layout = bar_layout(rect.width(), marks, m, !th.surround);
|
||||
let bar = marks_extent(rect, marks, th.hot, only_label, !th.surround, m)?;
|
||||
if !only_label && (th.hot || m.band) {
|
||||
p.rect_filled(bar, 0.0, Color32::from_black_alpha(120));
|
||||
}
|
||||
let y = bar.center().y;
|
||||
let mut x = bar.left() + m.pad;
|
||||
match layout.stars {
|
||||
Stars::None => {}
|
||||
Stars::Row(n) => {
|
||||
let width = crate::rating::paint_rating(p, pos2(x, y), n, m.rating, t.star);
|
||||
mark("stars", Rect::from_min_size(pos2(x, y - m.star / 2.0), vec2(width, m.star)));
|
||||
x += width;
|
||||
}
|
||||
Stars::Compact(n) => {
|
||||
paint(p, Rect::from_min_size(pos2(x, y - m.star / 2.0), vec2(m.star, m.star)), Icon::StarFilled, t.star);
|
||||
p.text(pos2(x + m.star + 1.0, y), Align2::LEFT_CENTER, n.to_string(), t.semibold(m.font), t.star);
|
||||
mark("stars", Rect::from_min_size(pos2(x, y - m.star / 2.0), vec2(m.star + 1.0 + m.digit, m.star)));
|
||||
x += m.star + 1.0 + m.digit;
|
||||
}
|
||||
}
|
||||
if layout.flag {
|
||||
let at = Rect::from_min_size(pos2(x + m.flag - m.flag_icon, y - m.flag_icon / 2.0), vec2(m.flag_icon, m.flag_icon));
|
||||
match photo.flag {
|
||||
Flag::Pick => paint(p, at, Icon::FlagPickFilled, t.pick),
|
||||
Flag::Reject => paint(p, at, Icon::FlagReject, t.reject),
|
||||
Flag::None => {}
|
||||
}
|
||||
mark("flag", at);
|
||||
}
|
||||
let mut right = bar.right() - m.pad;
|
||||
if layout.label
|
||||
&& let Some(l) = photo.label
|
||||
{
|
||||
p.circle(pos2(right - m.label / 2.0, y), m.dot, crate::theme::label_color(l), Stroke::new(1.0, Color32::from_black_alpha(120)));
|
||||
mark("label", Rect::from_center_size(pos2(right - m.label / 2.0, y), vec2(m.label, m.label)));
|
||||
right -= m.label;
|
||||
}
|
||||
if layout.edited {
|
||||
let at = Rect::from_center_size(pos2(right - m.edited / 2.0, y), vec2(m.edited_icon, m.edited_icon));
|
||||
paint(p, at, Icon::Sliders, t.text_label);
|
||||
mark("edited", at);
|
||||
}
|
||||
Some(bar)
|
||||
}
|
||||
|
||||
/// The stack badge at the photo's top left: the number of photos on a collapsed stack's top,
|
||||
/// `i/n` on the members of an expanded one; a click collapses or expands the stack. It gives up
|
||||
/// its icon, then the `i/` of `i/n`, on a narrow photo, and is never painted outside the photo.
|
||||
/// Returns the badge's rectangle (as laid out, before clipping) and its response.
|
||||
fn stack_badge(app: &mut LightcraftApp, ui: &mut egui::Ui, th: &Thumb, t: &Tokens, sid: StackId, pos: usize) -> Option<(Rect, egui::Response)> {
|
||||
let m = th.surface.metrics();
|
||||
let st = app.session.catalog.stack(sid)?;
|
||||
let (n, collapsed) = (st.photos.len(), st.collapsed);
|
||||
let id = th.photo.id;
|
||||
let p = clipped(ui, th);
|
||||
let count = p.layout_no_wrap(n.to_string(), t.semibold(m.font), Color32::WHITE);
|
||||
let full = if collapsed { count.clone() } else { p.layout_no_wrap(format!("{}/{n}", pos + 1), t.semibold(m.font), Color32::WHITE) };
|
||||
let (shape, w) = stack_layout(th.rect.width() - 2.0 * m.inset, full.size().x, count.size().x, &m);
|
||||
let br = Rect::from_min_size(th.rect.min + vec2(m.inset, m.inset), vec2(w, m.badge));
|
||||
let hit = br.intersect(th.rect);
|
||||
let resp = ui.interact(hit, egui::Id::unique((th.surface, "stack-badge", id.0)), Sense::click()).on_hover_text(stack_tip(collapsed));
|
||||
// a button to assistive technology, named as its tooltip (the click is handled by the caller)
|
||||
resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, stack_tip(collapsed)));
|
||||
register(ui, th.surface.widget(Mark::Stack, id), hit);
|
||||
let fill = if resp.hovered() { Color32::from_black_alpha(220) } else { Color32::from_black_alpha(165) };
|
||||
p.rect_filled(br, m.badge / 2.0, fill);
|
||||
if pos == 0 && !collapsed {
|
||||
p.rect_stroke(br, m.badge / 2.0, Stroke::new(1.0, t.accent), egui::StrokeKind::Inside);
|
||||
}
|
||||
let text = if shape == StackShape::CountOnly { count } else { full };
|
||||
match shape {
|
||||
StackShape::Full => {
|
||||
let icon = m.badge - 6.0;
|
||||
paint(&p, Rect::from_min_size(br.min + vec2(m.badge * 0.3, 3.0), vec2(icon, icon)), Icon::Stack, Color32::WHITE);
|
||||
p.galley(pos2(br.min.x + m.stack_extra - 6.0, br.center().y - text.size().y / 2.0), text, Color32::WHITE);
|
||||
}
|
||||
StackShape::NoIcon | StackShape::CountOnly => {
|
||||
p.galley(br.center() - text.size() / 2.0, text, Color32::WHITE);
|
||||
}
|
||||
}
|
||||
// a double-click (Lightroom's way) toggles once: its second click would undo the first
|
||||
if resp.clicked() && !resp.double_clicked() {
|
||||
crate::panels::grid::toggle_stack(app, ui.ctx(), id);
|
||||
}
|
||||
Some((br, resp))
|
||||
}
|
||||
|
||||
/// The virtual-copy tag at the photo's top right, so that a copy and its master tell apart.
|
||||
/// Returns where it is, when it is drawn.
|
||||
fn copy_tag(ui: &mut egui::Ui, th: &Thumb, t: &Tokens, name: &str, stack_w: Option<f32>) -> Option<Rect> {
|
||||
let m = th.surface.metrics();
|
||||
let p = clipped(ui, th);
|
||||
let g = p.layout_no_wrap(name.to_string(), t.semibold(m.micro + 1.0), Color32::WHITE);
|
||||
let mode = copy_tag_layout(th.rect.width(), stack_w, g.size().x, &m);
|
||||
let w = match mode {
|
||||
CopyTag::Full => g.size().x + m.copy_extra,
|
||||
CopyTag::IconOnly => m.copy_icon,
|
||||
CopyTag::Hidden => return None,
|
||||
};
|
||||
let br = Rect::from_min_size(pos2(th.rect.right() - m.inset - w, th.rect.top() + m.inset), vec2(w, m.badge));
|
||||
p.rect_filled(br, m.badge / 2.0, Color32::from_black_alpha(165));
|
||||
let icon = m.badge * 0.55;
|
||||
let at = if mode == CopyTag::Full { pos2(br.left() + m.badge * 0.65, br.center().y) } else { br.center() };
|
||||
paint(&p, Rect::from_center_size(at, vec2(icon, icon)), Icon::VirtualCopy, Color32::WHITE);
|
||||
if mode == CopyTag::Full {
|
||||
p.galley(pos2(br.left() + m.copy_extra - 4.0, br.center().y - g.size().y / 2.0), g, Color32::WHITE);
|
||||
}
|
||||
let id = th.photo.id;
|
||||
register(ui, th.surface.widget(Mark::Copy, id), br);
|
||||
let tip = format!("{}: {name}", crate::i18n::tr("Virtual copy"));
|
||||
ui.interact(br, egui::Id::unique((th.surface, "copy-tag", id.0)), Sense::hover())
|
||||
.on_hover_text(&tip)
|
||||
.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Label, true, &tip));
|
||||
Some(br)
|
||||
}
|
||||
|
||||
/// A raw shown from its embedded JPEG: a small amber "Preview" pill above the marks row, always
|
||||
/// shown (it changes what editing does) wherever it fits clear of the other marks.
|
||||
fn preview_pill(ui: &mut egui::Ui, th: &Thumb, t: &Tokens, why: &str, stack: Option<Rect>, hard: &[Rect], soft: &[Rect]) {
|
||||
let m = th.surface.metrics();
|
||||
let p = clipped(ui, th);
|
||||
let g = p.layout_no_wrap(crate::i18n::tr("Preview").into(), t.semibold(m.micro), Color32::WHITE);
|
||||
let place = preview_pill_place(th.rect, g.size().x, stack, hard, soft, &m);
|
||||
let (br, full, h) = (place.rect, place.full, place.rect.height());
|
||||
p.rect_filled(br, h / 2.0, Color32::from_black_alpha(170));
|
||||
let icon = h - 4.0;
|
||||
let centre = if full { pos2(br.left() + h * 0.55, br.center().y) } else { br.center() };
|
||||
paint(&p, Rect::from_center_size(centre, vec2(icon, icon)), Icon::Info, t.caution);
|
||||
if full {
|
||||
p.galley(pos2(br.left() + h * 0.55 + icon / 2.0 + 2.0, br.center().y - g.size().y / 2.0), g, Color32::WHITE);
|
||||
}
|
||||
let id = th.photo.id;
|
||||
register(ui, th.surface.widget(Mark::Preview, id), br);
|
||||
ui.interact(br, egui::Id::unique((th.surface, "preview-only-badge", id.0)), Sense::hover())
|
||||
.on_hover_text(crate::i18n::tr_format!("Preview only — {}", crate::widgets::preview_only_explanation(why)));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// The marks band sits on the photo itself — a portrait's fitted rect is narrower than the
|
||||
/// cell's image area, a landscape's is shorter — so it never sticks out past the photo or
|
||||
/// crosses its selection frame (#3601).
|
||||
#[test]
|
||||
fn the_marks_band_stays_on_the_photo() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let cell = Rect::from_min_size(pos2(10.0, 24.0), vec2(180.0, 180.0));
|
||||
// A photo that fills the image area: the band is the usual footer
|
||||
let full = marks_bar(cell, &m);
|
||||
assert!((full.height() - m.bar).abs() < 0.01, "{full:?}");
|
||||
assert!((full.bottom() - cell.bottom()).abs() < 0.01);
|
||||
assert!((full.left() - cell.left()).abs() < 0.01 && (full.right() - cell.right()).abs() < 0.01);
|
||||
// A portrait photo fitted inside it: the band is no wider than the photo
|
||||
let portrait = Rect::from_min_size(pos2(cell.left() + 55.0, cell.top()), vec2(70.0, 180.0));
|
||||
let bar = marks_bar(portrait, &m);
|
||||
assert!(bar.left() >= portrait.left() && bar.right() <= portrait.right(), "{bar:?}");
|
||||
assert!((bar.height() - m.bar).abs() < 0.01);
|
||||
// A landscape photo shorter than the band: its own top edge, never a negative rect
|
||||
let wide = Rect::from_min_size(pos2(cell.left(), cell.top() + 80.0), vec2(180.0, 20.0));
|
||||
let bar = marks_bar(wide, &m);
|
||||
assert!((bar.top() - wide.top()).abs() < 0.01, "{bar:?}");
|
||||
assert!(bar.bottom() <= wide.bottom() + 0.01);
|
||||
}
|
||||
|
||||
fn all_marks() -> Vec<Marks> {
|
||||
let mut out = Vec::new();
|
||||
for rating in 0..=5 {
|
||||
for bits in 0..8u8 {
|
||||
out.push(Marks { rating, flag: bits & 1 != 0, edited: bits & 2 != 0, label: bits & 4 != 0 });
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_wide_tile_draws_every_mark() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let marks = Marks { rating: 5, flag: true, edited: true, label: true };
|
||||
let l = bar_layout(300.0, marks, &m, false);
|
||||
assert_eq!(l, BarLayout { stars: Stars::Row(5), flag: true, edited: true, label: true });
|
||||
}
|
||||
|
||||
/// As the photo narrows, the edited mark goes first, then the stars shrink to one star and the
|
||||
/// number, and the rest is kept only as far as it fits whole.
|
||||
#[test]
|
||||
fn marks_degrade_in_order_as_the_tile_narrows() {
|
||||
for surface in [Surface::Grid, Surface::Film] {
|
||||
let m = surface.metrics();
|
||||
let marks = Marks { rating: 5, flag: true, edited: true, label: true };
|
||||
let full = bar_layout(1000.0, marks, &m, false);
|
||||
let w_full = full.width(&m);
|
||||
let no_edit = bar_layout(w_full - 0.5, marks, &m, false);
|
||||
assert_eq!(no_edit, BarLayout { edited: false, ..full }, "{surface:?}: the edited mark goes first");
|
||||
let w_plain = no_edit.width(&m);
|
||||
let compact = bar_layout(w_plain - 0.5, marks, &m, false);
|
||||
assert_eq!(compact.stars, Stars::Compact(5), "{surface:?}: then the stars collapse");
|
||||
assert!(compact.flag && compact.label && !compact.edited, "{surface:?}: and nothing else is lost yet: {compact:?}");
|
||||
let w_compact = compact.width(&m);
|
||||
let fewer = bar_layout(w_compact - 0.5, marks, &m, false);
|
||||
assert!(fewer.width(&m) <= w_compact - 0.5, "{surface:?}: what is drawn fits");
|
||||
assert!(fewer.flag, "{surface:?}: the flag outlasts the label: {fewer:?}");
|
||||
assert!(!fewer.label, "{surface:?}: the label is the first to go: {fewer:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Whatever is drawn is drawn whole: the row never needs more than the photo's width.
|
||||
#[test]
|
||||
fn the_marks_row_never_outgrows_the_photo() {
|
||||
for surface in [Surface::Grid, Surface::Film] {
|
||||
let m = surface.metrics();
|
||||
for marks in all_marks() {
|
||||
for w in 0..400 {
|
||||
let first = bar_layout(w as f32, marks, &m, true);
|
||||
assert!(first.width(&m) <= w as f32, "{surface:?} {marks:?} at {w} (label first): {first:?}");
|
||||
let l = bar_layout(w as f32, marks, &m, false);
|
||||
assert!(l.width(&m) <= w as f32, "{surface:?} {marks:?} at {w}: {l:?} needs {}", l.width(&m));
|
||||
if l.edited {
|
||||
assert!(marks.edited && l == bar_layout(1000.0, marks, &m, false), "the edited mark only shows alongside all the others");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A portrait photo at the smallest thumbnail size with five stars and a flag: the case that
|
||||
/// ran over the photo's edge.
|
||||
#[test]
|
||||
fn a_narrow_portrait_with_five_stars_and_a_flag_keeps_what_fits() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let marks = Marks { rating: 5, flag: true, edited: false, label: false };
|
||||
// justified rows 90 pt high: a 2:3 portrait is 60 wide
|
||||
let l = bar_layout(60.0, marks, &m, false);
|
||||
assert_eq!(l, BarLayout { stars: Stars::Compact(5), flag: true, edited: false, label: false });
|
||||
// a square cell 90 pt wide leaves a 70 × 56 area for the photo: 37 wide
|
||||
let narrow = bar_layout(56.0 * 2.0 / 3.0, marks, &m, false);
|
||||
assert!(narrow.width(&m) <= 56.0 * 2.0 / 3.0 && narrow.flag, "{narrow:?}");
|
||||
assert_ne!(narrow.stars, Stars::Row(5), "five whole stars (65 pt) cannot fit 37");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_star_stays_one_star() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let marks = Marks { rating: 1, flag: false, edited: false, label: false };
|
||||
assert_eq!(bar_layout(m.star_pitch + 2.0 * m.pad, marks, &m, false).stars, Stars::Row(1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_copy_tag_gives_up_its_name_then_its_icon_before_it_meets_the_stack_badge() {
|
||||
for surface in [Surface::Grid, Surface::Film] {
|
||||
let m = surface.metrics();
|
||||
let (stack_w, name_w) = (44.0, 50.0);
|
||||
let mut seen = Vec::new();
|
||||
for w in (0..300).step_by(1) {
|
||||
let width = w as f32;
|
||||
let mode = copy_tag_layout(width, Some(stack_w), name_w, &m);
|
||||
let tag_w = match mode {
|
||||
CopyTag::Full => name_w + m.copy_extra,
|
||||
CopyTag::IconOnly => m.copy_icon,
|
||||
CopyTag::Hidden => 0.0,
|
||||
};
|
||||
if mode != CopyTag::Hidden {
|
||||
// stack badge from the left inset, the tag to the right inset: they leave a gap
|
||||
let (stack_right, tag_left) = (m.inset + stack_w, width - m.inset - tag_w);
|
||||
assert!(stack_right < tag_left, "{surface:?} at {width}: {mode:?} meets the badge");
|
||||
assert!(tag_left >= m.inset, "{surface:?} at {width}: {mode:?} leaves the photo");
|
||||
}
|
||||
if seen.last() != Some(&mode) {
|
||||
seen.push(mode);
|
||||
}
|
||||
}
|
||||
assert_eq!(seen, [CopyTag::Hidden, CopyTag::IconOnly, CopyTag::Full], "{surface:?}: as the tile widens");
|
||||
}
|
||||
}
|
||||
|
||||
/// The real case: "Copy 1" (34 pt of text) beside a "2/2" badge (18 pt of text) on a 124 pt
|
||||
/// justified tile fitted with 2 pt to spare on main. The tag keeps its name while it clears the
|
||||
/// badge by 4 pt, and is the icon alone just below that.
|
||||
#[test]
|
||||
fn the_copy_tag_keeps_its_name_when_it_clears_the_badge_by_four_points() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let (name_w, stack_w) = (34.0, 18.0 + m.stack_extra);
|
||||
let edge = 2.0 * m.inset + stack_w + 4.0 + name_w + m.copy_extra;
|
||||
assert_eq!(copy_tag_layout(124.0, Some(stack_w), name_w, &m), CopyTag::Full);
|
||||
assert_eq!(copy_tag_layout(edge, Some(stack_w), name_w, &m), CopyTag::Full);
|
||||
assert_eq!(copy_tag_layout(edge - 0.5, Some(stack_w), name_w, &m), CopyTag::IconOnly);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn without_a_stack_badge_the_copy_tag_keeps_its_name_longer() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let width = 2.0 * m.inset + 50.0 + m.copy_extra + 1.0;
|
||||
assert_eq!(copy_tag_layout(width, None, 50.0, &m), CopyTag::Full);
|
||||
assert_eq!(copy_tag_layout(width, Some(30.0), 50.0, &m), CopyTag::IconOnly);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_preview_pill_shrinks_to_its_icon_on_a_narrow_tile() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let photo = |w: f32| Rect::from_min_size(pos2(0.0, 0.0), vec2(w, 80.0));
|
||||
assert!(preview_pill_place(photo(120.0), 40.0, None, &[], &[], &m).full);
|
||||
let narrow = preview_pill_place(photo(60.0), 40.0, None, &[], &[], &m);
|
||||
assert!(!narrow.full);
|
||||
}
|
||||
|
||||
/// A wide stacked photo in the filmstrip, a 3:2 one in the square grid at 90 pt: the pill's
|
||||
/// usual place meets the stack badge, so it moves below it, beside it, or goes.
|
||||
#[test]
|
||||
fn the_preview_pill_keeps_clear_of_the_stack_badge() {
|
||||
for (surface, w, h, badge_w) in [(Surface::Film, 100.0, 50.0, 30.0), (Surface::Grid, 70.0, 47.0, 40.0)] {
|
||||
let m = surface.metrics();
|
||||
let photo = Rect::from_min_size(pos2(0.0, 0.0), vec2(w, h));
|
||||
let badge = Rect::from_min_size(pos2(m.inset, m.inset), vec2(badge_w, m.badge));
|
||||
let bar = marks_bar(photo, &m);
|
||||
let p = preview_pill_place(photo, 30.0, Some(badge), &[badge], &[bar], &m);
|
||||
let free = |r: Rect| !(r.min.x < badge.max.x && badge.min.x < r.max.x && r.min.y < badge.max.y && badge.min.y < r.max.y);
|
||||
assert!(
|
||||
free(p.rect) && photo.contains_rect(p.rect) && p.rect.bottom() <= bar.top() + 0.01,
|
||||
"{surface:?}: {p:?} meets the badge {badge:?}"
|
||||
);
|
||||
// without the badge it sits where it always did
|
||||
let alone = preview_pill_place(photo, 30.0, None, &[], &[bar], &m);
|
||||
assert_eq!(alone.rect.top(), (h - m.bar - 4.0 - m.pill_icon).max(m.inset), "{surface:?}");
|
||||
}
|
||||
// a photo too small for the pill anywhere clear of the badge: nothing else fits, so the
|
||||
// icon is drawn at its first spot, over the badge, rather than not at all
|
||||
let m = Surface::Film.metrics();
|
||||
let tiny = Rect::from_min_size(pos2(0.0, 0.0), vec2(40.0, 30.0));
|
||||
let badge = Rect::from_min_size(pos2(m.inset, m.inset), vec2(34.0, m.badge));
|
||||
let last = preview_pill_place(tiny, 30.0, Some(badge), &[badge], &[marks_bar(tiny, &m)], &m);
|
||||
assert!(!last.full, "the icon alone");
|
||||
assert_eq!(last.rect.min, pos2(m.inset, (tiny.bottom() - m.bar - 4.0 - m.pill_icon).max(m.inset)), "at its first spot");
|
||||
assert!(last.rect.intersects(badge), "over the badge: the last resort");
|
||||
}
|
||||
|
||||
/// A short photo with a collapsed stack's badge and a marks band (hovered, or rated): the spot
|
||||
/// beside the badge overlaps the band, which is allowed (its marks sit at its ends), the badge
|
||||
/// is not.
|
||||
#[test]
|
||||
fn the_pill_may_sit_over_the_marks_band_but_never_over_the_badge() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let photo = Rect::from_min_size(pos2(0.0, 0.0), vec2(70.0, 39.0));
|
||||
let badge = Rect::from_min_size(pos2(m.inset, m.inset), vec2(34.0, m.badge));
|
||||
let band = marks_bar(photo, &m);
|
||||
let p = preview_pill_place(photo, 30.0, Some(badge), &[badge], &[band], &m);
|
||||
let overlap = |a: Rect, b: Rect| a.min.x < b.max.x && b.min.x < a.max.x && a.min.y < b.max.y && b.min.y < a.max.y;
|
||||
assert!(!overlap(p.rect, badge), "{p:?} is over the badge {badge:?}");
|
||||
assert!(photo.contains_rect(p.rect), "{p:?}");
|
||||
assert!(p.rect.left() >= badge.right(), "beside the badge: {p:?}");
|
||||
}
|
||||
|
||||
/// A square-grid 16:9 photo at 90 pt is 70 x 39: with no marks to draw the row covers nothing,
|
||||
/// and the pill sits where it always did instead of dodging a strip that is not there.
|
||||
#[test]
|
||||
fn a_short_photo_without_marks_leaves_the_pill_its_place() {
|
||||
for (surface, w, h) in [(Surface::Grid, 70.0, 39.0), (Surface::Film, 100.0, 30.0)] {
|
||||
let m = surface.metrics();
|
||||
let photo = Rect::from_min_size(pos2(0.0, 0.0), vec2(w, h));
|
||||
let bar = marks_extent(photo, Marks::default(), false, false, false, &m);
|
||||
assert_eq!(bar, None, "{surface:?}: nothing drawn, nothing to avoid");
|
||||
let obstacles: Vec<Rect> = bar.into_iter().collect();
|
||||
let place = preview_pill_place(photo, 30.0, None, &[], &obstacles, &m);
|
||||
assert!(photo.contains_rect(place.rect) && place.full, "{surface:?}: {place:?}");
|
||||
// under the pointer the band is there, and the row covers its strip
|
||||
assert_eq!(marks_extent(photo, Marks::default(), true, false, false, &m), Some(marks_bar(photo, &m)));
|
||||
}
|
||||
}
|
||||
|
||||
/// "12/120" on a 60 pt photo, "3/12" on a 42 pt filmstrip photo: the badge sheds its icon, then
|
||||
/// the `i/`, and what is left is drawn clipped to the photo rather than onto its neighbour.
|
||||
#[test]
|
||||
fn the_stack_badge_degrades_on_a_narrow_photo() {
|
||||
for surface in [Surface::Grid, Surface::Film] {
|
||||
let m = surface.metrics();
|
||||
let (full_w, count_w) = (34.0, 20.0);
|
||||
let room = |w: f32| w - 2.0 * m.inset;
|
||||
let (s, w) = stack_layout(room(300.0), full_w, count_w, &m);
|
||||
assert_eq!((s, w), (StackShape::Full, full_w + m.stack_extra));
|
||||
let (s, w) = stack_layout(room(full_w + m.stack_extra + 2.0 * m.inset - 1.0), full_w, count_w, &m);
|
||||
assert_eq!(s, StackShape::NoIcon, "{surface:?}: the icon goes first");
|
||||
assert!(w <= full_w + m.stack_extra);
|
||||
let (s, w) = stack_layout(room(w + 2.0 * m.inset - 1.0), full_w, count_w, &m);
|
||||
assert_eq!(s, StackShape::CountOnly, "{surface:?}: then the i/");
|
||||
assert!(w < full_w);
|
||||
// nothing fits: still the count, and the caller clips it
|
||||
assert_eq!(stack_layout(0.0, full_w, count_w, &m).0, StackShape::CountOnly);
|
||||
}
|
||||
}
|
||||
|
||||
/// Where the label has no surround to say it, it outlasts the stars and the flag.
|
||||
#[test]
|
||||
fn on_a_surfaceless_tile_the_label_is_kept_before_the_stars() {
|
||||
let m = Surface::Grid.metrics();
|
||||
let marks = Marks { rating: 5, flag: true, edited: false, label: true };
|
||||
let with_surround = bar_layout(60.0, marks, &m, false);
|
||||
assert!(!with_surround.label, "{with_surround:?}");
|
||||
let without = bar_layout(60.0, marks, &m, true);
|
||||
assert!(without.label && without.width(&m) <= 60.0, "{without:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_placeholder_has_the_photo_s_shape() {
|
||||
let area = Rect::from_min_size(pos2(10.0, 10.0), vec2(70.0, 56.0));
|
||||
let portrait = placeholder_rect(area, 2.0 / 3.0);
|
||||
assert!(
|
||||
(portrait.width() / portrait.height() - 2.0 / 3.0).abs() < 1e-4 && area.contains_rect(portrait) && portrait.center() == area.center()
|
||||
);
|
||||
let wide = placeholder_rect(area, 3.0);
|
||||
assert!((wide.width() - 70.0).abs() < 1e-4 && wide.height() < 56.0);
|
||||
let unknown = placeholder_rect(area, f32::NAN);
|
||||
assert!((unknown.width() / unknown.height() - 1.5).abs() < 1e-4);
|
||||
}
|
||||
|
||||
/// Italian says "valutazione: 1 su 5", "valutazione: 2 su 5"…: no English plural suffix to
|
||||
/// pick, so no number reads wrong.
|
||||
#[test]
|
||||
fn a_spoken_rating_needs_no_plural_suffix() {
|
||||
crate::i18n::set_language(crate::i18n::Locale::It);
|
||||
let said: Vec<String> = (1..=5).map(spoken_rating).collect();
|
||||
crate::i18n::set_language(crate::i18n::Locale::En);
|
||||
assert!(said.iter().all(|s| !s.contains("star")), "{said:?}");
|
||||
assert_eq!(said[1], said[0].replacen('1', "2", 1), "only the number changes: {said:?}");
|
||||
assert_eq!(spoken_rating(1), ", rating 1 of 5");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_missing_original_points_at_locate_and_anything_else_at_reload() {
|
||||
let missing = failure_text(true, "No such file");
|
||||
assert!(missing.contains("Original offline") && missing.contains("Locate Missing File") && missing.ends_with("No such file"), "{missing}");
|
||||
let broken = failure_text(false, "bad header");
|
||||
assert!(broken.contains("can't be opened") && broken.contains("Reload from Disk") && !broken.contains("Locate"), "{broken}");
|
||||
}
|
||||
}
|
||||
@@ -8,5 +8,6 @@ mod grid_names;
|
||||
mod landmarks;
|
||||
mod local_places;
|
||||
mod photo_name;
|
||||
mod sidebar_branch;
|
||||
mod sidebar_names;
|
||||
mod thumb_size_slider;
|
||||
@@ -49,5 +49,5 @@ fn the_photo_in_detail_says_its_rating_and_flag_as_the_grid_does() {
|
||||
h.state_mut().run("photo.flag", serde_json::json!({"flag": "pick"})).expect("flags");
|
||||
h.run_steps(4);
|
||||
let names = photo_names(&h);
|
||||
assert!(names.len() == 1 && names[0].ends_with(", 4 stars, picked"), "{names:?}");
|
||||
assert!(names.len() == 1 && names[0].ends_with(", rating 4 of 5, picked"), "{names:?}");
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
//! Option-click (Alt-click) on a sidebar tree row's triangle opens or folds the row and every row
|
||||
//! inside it, also the rows that are not drawn yet because a row above them is folded.
|
||||
use std::time::Duration;
|
||||
|
||||
use lightcraft_catalog::{Op, Photo, PhotoId, Source};
|
||||
use lightcraft_engine::Session;
|
||||
use lightcraft_ui_egui::headless::Headless;
|
||||
use lightcraft_ui_egui::{LightcraftApp, Services};
|
||||
use serde_json::{Value, json};
|
||||
|
||||
const T: Duration = Duration::from_secs(30);
|
||||
|
||||
fn start(session: Session) -> Headless {
|
||||
let mut h = Headless::new(LightcraftApp::new(session, Services { png: None, ..Default::default() }), [1400.0, 1400.0], 1.0);
|
||||
let r = h.request("ui.set", json!({"view": "photoGrid", "leftPanel": true}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(Duration::from_secs(120));
|
||||
h
|
||||
}
|
||||
|
||||
fn frames(h: &mut Headless) {
|
||||
for _ in 0..3 {
|
||||
h.step();
|
||||
}
|
||||
}
|
||||
|
||||
fn has(h: &Headless, id: &str) -> bool {
|
||||
h.app.widgets.iter().any(|(w, _)| w == id)
|
||||
}
|
||||
|
||||
/// A click on the widget `id`, with Option (Alt) held or not.
|
||||
fn click(h: &mut Headless, id: &str, alt: bool) {
|
||||
let r = h.request("ui.clickWidget", json!({"id": id, "alt": alt}), T);
|
||||
assert_eq!(r["ok"], true, "{id}: {r}");
|
||||
frames(h);
|
||||
}
|
||||
|
||||
fn make(h: &mut Headless, params: Value) -> u64 {
|
||||
let id = h.app.session.execute("album.create", ¶ms).unwrap()["id"].as_u64().unwrap();
|
||||
frames(h);
|
||||
id
|
||||
}
|
||||
|
||||
/// Photos at `paths`, each with its keywords and capture time.
|
||||
fn library(photos: &[(&str, &[&str], &str)]) -> Session {
|
||||
let mut s = Session::new();
|
||||
for (i, (path, keywords, taken)) in photos.iter().enumerate() {
|
||||
let name = path.rsplit('/').next().unwrap();
|
||||
let mut p = Photo::new(PhotoId(i as u64 + 1), Source::File { path: (*path).into() }, name, "JPEG", 60, 40, "2026-03-01T00:00:00");
|
||||
p.captured = Some((*taken).to_string());
|
||||
p.meta.keywords = keywords.iter().map(|k| (*k).to_string()).collect();
|
||||
s.catalog.apply(Op::AddPhoto { photo: Box::new(p) }).unwrap();
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
fn toggle(kind: &str, id: impl std::fmt::Display) -> String {
|
||||
format!("{kind}Toggle:{id}")
|
||||
}
|
||||
|
||||
/// Given folders of albums three deep, when the outer folder's triangle is clicked with Option,
|
||||
/// then it and the folders inside it fold together, and an Option-click opens them all again,
|
||||
/// though the inner folders were not drawn while the outer one was folded.
|
||||
#[test]
|
||||
fn option_click_folds_and_opens_a_branch_of_album_folders() {
|
||||
let mut h = start(Session::new());
|
||||
let trips = make(&mut h, json!({"name": "Trips", "folder": true}));
|
||||
let europe = make(&mut h, json!({"name": "Europe", "folder": true, "parent": trips}));
|
||||
let france = make(&mut h, json!({"name": "France", "folder": true, "parent": europe}));
|
||||
let best = make(&mut h, json!({"name": "Best", "parent": france}));
|
||||
let other = make(&mut h, json!({"name": "Other", "folder": true}));
|
||||
let kept = make(&mut h, json!({"name": "Kept", "parent": other}));
|
||||
let (best_row, kept_row) = (format!("source:album:{best}"), format!("source:album:{kept}"));
|
||||
assert!(has(&h, &best_row), "folders start open");
|
||||
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
assert!(!has(&h, &format!("source:folder:{europe}")) && !has(&h, &best_row), "the branch is folded");
|
||||
assert!(has(&h, &kept_row), "a folder beside it is not");
|
||||
|
||||
// a plain click opens the one row: the folders inside it stay folded
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
assert!(has(&h, &format!("source:folder:{europe}")), "Trips is open");
|
||||
assert!(!has(&h, &format!("source:folder:{france}")) && !has(&h, &best_row), "Europe stays folded");
|
||||
|
||||
// fold it by hand, and Option-click it open: the folders that were never drawn open too
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
assert!(has(&h, &best_row), "Europe and France are open");
|
||||
|
||||
// what is said of a row afterwards holds for that row alone
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
click(&mut h, &toggle("album", europe), false);
|
||||
assert!(has(&h, &format!("source:folder:{france}")) && !has(&h, &best_row), "Europe is open, France stays folded");
|
||||
|
||||
// a folder made inside a branch that was folded this way follows it: folded
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
let africa = make(&mut h, json!({"name": "Africa", "folder": true, "parent": trips}));
|
||||
let kenya = make(&mut h, json!({"name": "Kenya", "parent": africa}));
|
||||
assert!(has(&h, &format!("source:folder:{africa}")) && !has(&h, &format!("source:album:{kenya}")), "Africa is folded, as the branch was left");
|
||||
}
|
||||
|
||||
/// Given the Folders and Keywords trees and By Date, when a top row's triangle is clicked with
|
||||
/// Option, then everything inside it opens, and an Option-click folds it again.
|
||||
#[test]
|
||||
fn option_click_opens_and_folds_folders_keywords_and_dates() {
|
||||
let mut h = start(library(&[
|
||||
("/lc-branch/a/b/c/one.jpg", &["Places|Europe|France"], "2026-01-05T10:00:00"),
|
||||
("/lc-branch/a/b/two.jpg", &["Places|Europe|Spain"], "2026-01-06T10:00:00"),
|
||||
("/lc-branch/a/three.jpg", &["Places|Asia"], "2026-02-07T10:00:00"),
|
||||
]));
|
||||
// Keywords
|
||||
assert!(has(&h, "source:keyword:Places") && !has(&h, "source:keyword:Places|Europe"), "keywords start folded");
|
||||
click(&mut h, &toggle("keyword", "Places"), true);
|
||||
assert!(has(&h, "source:keyword:Places|Europe|France"), "Places opens with the keywords inside it");
|
||||
click(&mut h, &toggle("keyword", "Places"), true);
|
||||
assert!(!has(&h, "source:keyword:Places|Europe"), "and folds");
|
||||
click(&mut h, &toggle("keyword", "Places"), false);
|
||||
assert!(has(&h, "source:keyword:Places|Europe") && !has(&h, "source:keyword:Places|Europe|France"), "a plain click opens one row");
|
||||
// By Date
|
||||
assert!(has(&h, "source:date:2026") && !has(&h, "source:date:2026-01"), "dates start folded");
|
||||
click(&mut h, &toggle("date", "2026"), true);
|
||||
assert!(has(&h, "source:date:2026-01") && has(&h, "source:date:2026-01-05") && has(&h, "source:date:2026-02-07"), "the months and their days");
|
||||
click(&mut h, &toggle("date", "2026"), true);
|
||||
assert!(!has(&h, "source:date:2026-01"));
|
||||
// Folders: This Computer, down to the last folder
|
||||
let top = toggle("libraryFolder", "/");
|
||||
let (below, deepest) = ("source:libfolder:/lc-branch", "source:libfolder:/lc-branch/a/b/c");
|
||||
assert!(has(&h, below) && !has(&h, deepest), "This Computer starts open, the folders in it as they begin");
|
||||
click(&mut h, &top, true);
|
||||
assert!(!has(&h, below), "folded with everything in it");
|
||||
click(&mut h, &top, true);
|
||||
assert!(has(&h, deepest), "opens down to the last folder, which was not drawn");
|
||||
}
|
||||
|
||||
/// Given a folder on disk in Local with folders inside it, when its triangle is clicked with
|
||||
/// Option, then opening opens the one folder (a disk's folders are read as they are opened), and
|
||||
/// folding folds everything inside it.
|
||||
#[test]
|
||||
fn option_click_in_local_folds_everything_and_opens_one_row() {
|
||||
let root = std::env::temp_dir().join(format!("lc-branch-local-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
std::fs::create_dir_all(root.join("a/b")).unwrap();
|
||||
let path = root.to_string_lossy().to_string();
|
||||
let mut h = start(Session::new());
|
||||
h.app.run("local.addRoot", json!({"path": path})).unwrap();
|
||||
frames(&mut h);
|
||||
let sub = |name: &str| std::path::Path::new(&path).join(name).to_string_lossy().to_string();
|
||||
let (a_path, b_path) = (sub("a"), std::path::Path::new(&sub("a")).join("b").to_string_lossy().to_string());
|
||||
let (a, b) = (format!("source:local:{a_path}"), format!("source:local:{b_path}"));
|
||||
let root_toggle = toggle("folder", &path);
|
||||
assert!(has(&h, &root_toggle), "the folder is listed in Local");
|
||||
click(&mut h, &root_toggle, true);
|
||||
assert!(h.step_until(T, |h| has(h, &a)), "Option opens the folder");
|
||||
// (the folders inside it are listed on a worker: wait for them before saying one is missing)
|
||||
h.settle(T);
|
||||
frames(&mut h);
|
||||
assert!(!has(&h, &b), "and no more than that");
|
||||
click(&mut h, &toggle("folder", &a_path), false);
|
||||
assert!(h.step_until(T, |h| has(h, &b)), "a plain click opens the one below");
|
||||
click(&mut h, &root_toggle, true);
|
||||
assert!(!has(&h, &a), "Option folds it");
|
||||
click(&mut h, &root_toggle, false);
|
||||
assert!(has(&h, &a) && !has(&h, &b), "and what was inside it is folded too");
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ filmstrip is visible.
|
||||
| `ui.menu.tree` | — | The menu bar as shown (File … Help): items `{id, params?, label, shortcut?, enabled, checked?}`, separators, submenus — the model behind the native macOS menu bar and the in-window menus |
|
||||
| `ui.inspect` | — | UI state, window, `loupe` (`source`, `pending`, `failed` = why its render failed, else `null`, and `region: {full, window, pending}` when a zoomed view also renders the window on screen at no more than 100 % — `full` is the frame it is cut from, `window` its `[x, y, w, h]` — and `regionBefore` for the Before side of a Before/After view), canvas/image rects, `scroll: {grid, filmstrip}` (scroll offsets in points, `null` until drawn), active photo, selection, perf (`frameMs` = layout, `logicMs` = per-frame logic before it, `updateMs` = both, `maxUpdateMs`, `fps`, render queue …, `gpu` = adapter in use, `gpuReason` = why renders don't use the GPU, `gpuFallback` = latest render redone on the CPU and why, `gpuWindowDevice` / `screenTextures` / `mainOnGpu` = renders run on the window's device / can be drawn from the GPU / the loupe shows one now — see `docs/gpu-pipeline.md`, `loupeSteps` = how the loupe showed each photo it was stepped to, measured on the frames it drew: `{steps: [{photo, anyMs, anySource, fullMs, fullSource, sharpMs, dwellMs}], total, current}` — ms from the step to the first frame with anything of the photo, with a full-size picture (`embedded` camera JPEG, `cached` or `render`), and with LightCraft's own render; `dwellMs` is how long it stayed, the latest 256 steps; `total` counts every step finished since launch, a cursor that keeps rising when old steps leave the list; `thumbsMade` = photos given a grid thumbnail since launch (never lowered when old thumbnails are evicted, unlike `thumbTextures`); `previewCache` = the rendered-preview cache: `memEntries` / `memBytes` in memory, the disk cache's `diskHits`, `diskMisses`, `diskWrites` and `diskBudget` (bytes; all `null` without a library on disk), and `loupeEdge` (px, the loupe's longest edge, the size standard previews are built at)), status, memory (bytes per cache, see `library.memory`; plus stage caches — `budgetBytes`, `trimmed`, `sharedSourceBytes` (the one device copy of a big original) — and textures), `export: {running: {total, done, current} \| null, last}`, `notices` (warnings waiting to be shown, e.g. a damaged settings file, or once per session the drive holding the preview cache running low; OK = `button:noticeOk`, and the low-drive notice's `button:noticeSettings` opens Settings ▸ Performance), `quitPrompt` (why quitting was stopped: tasks that would be cut short are running — `button:quitAnyway` cancels them and quits, `button:quitCancel` keeps working — or unsaved changes: `button:quitRetry` / `button:quitAnyway` / `button:quitCancel`), `import: {done, total, imported, cancelled} \| null` (an import runs on a worker thread), `tasks` (other background work: `Find Missing Photos`, `Auto Import`), `activity` (every long-running task in flight as the activity stack in the top-left corner shows it, same shape as `activity.list`; a row appears once its task is 0.5 s old, ids `activity:row:<id>`, ✕ = `activity:cancel:<id>`, `activity:more` expands past 3 rows), `fileDialogs` (commands waiting on a native file dialog, which runs off the UI thread; they run again with the answer when it closes), `copied` (the text the UI last put on the clipboard, `null` until something is copied) |
|
||||
| `ui.widgets` | `{filter?}` | On-screen widgets `{id, rect: [x, y, w, h]}` (screen points) |
|
||||
| `ui.clickWidget` / `ui.dragWidget` / `ui.hoverWidget` | `{id, count?, button?, fx?, fy?}` (`button: "right"` right-clicks; `count` is capped at 16) / `{id, toX?, toY?, dx?, dy?, steps?}` (steps are capped at 1000) / `{id, fx?, fy?}` | Real egui input on a widget (hover: the pointer rests on it, e.g. for preset/profile previews). `fx`/`fy` are fractions of the registered rect and may lie outside `[0,1]`; the resulting point must still be inside egui's clipped interaction rect, and a non-finite fraction or resolved point is rejected before any input is queued. Geometry comes from the latest completed layout; if the widget moves before the first event or before a press, or its latest clipped rect no longer contains the point, the request fails with an error instead of clicking another widget or retargeting. A target below an ordinary modal dialog may succeed as a no-op or a backdrop click, because egui routes that input to the dialog; a target covered by a non-modal overlay fails. The blocking library-problem/launch-list window is explicit: its dim takes the modal layer, but a background target fails instead of reporting a no-op success, and only that window's own controls (`button:library…`) pass. Its creation frame is shielded and redrawn with empty input like a prompt's, so background text/pointer input cannot act while the new modal areas settle. A quit prompt or settings notice is a real egui modal scope with a foreground backdrop. Only its own buttons (`button:quit…`, `button:noticeOk`) accept a `ui.clickWidget`; background targets fail, and background keystrokes, text/clipboard input, wheel/zoom input and AccessKit actions are dropped before panels see them. The prompt itself takes Tab/Shift+Tab, Enter/Space on the focused button, and Escape/Enter for the safe default Cancel; AccessKit Focus/Click works when targeted at a prompt button. Its first creation frame (including a Tasks→Unsaved or notice→next-notice transition) is shielded and redrawn with empty input, so a press/release in that frame, or a held press from before it, cannot act underneath it; a synthetic drag already in progress is canceled. Once settled, raw `ui.click`/`ui.drag`/`ui.pointer` and backdrop clicks are still delivered to the prompt backdrop as no-ops, and the prompt's own button clicks work normally. The area/layer check cannot see a different widget covering the point in the same layer. A `ui.clickWidget` whose widget disappears before its release also fails, after canceling the pointer press without a click or drag (the same rules apply when a click spans several host frames) |
|
||||
| `ui.clickWidget` / `ui.dragWidget` / `ui.hoverWidget` | `{id, count?, button?, fx?, fy?, alt?, shift?, cmd?, ctrl?}` (`button: "right"` right-clicks; `count` is capped at 16; the modifiers are held for the click or drag, e.g. `alt: true` on a sidebar triangle opens or folds the row with all the rows inside it; in Local it folds them and opens the one row) / `{id, fx?, fy?, toX?, toY?, dx?, dy?, steps?, alt?, shift?, cmd?, ctrl?}` (steps are capped at 1000) / `{id, fx?, fy?}` | Real egui input on a widget (hover: the pointer rests on it, e.g. for preset/profile previews). `fx`/`fy` are fractions of the registered rect and may lie outside `[0,1]`; the resulting point must still be inside egui's clipped interaction rect, and a non-finite fraction or resolved point is rejected before any input is queued. Geometry comes from the latest completed layout; if the widget moves before the first event or before a press, or its latest clipped rect no longer contains the point, the request fails with an error instead of clicking another widget or retargeting. A target below an ordinary modal dialog may succeed as a no-op or a backdrop click, because egui routes that input to the dialog; a target covered by a non-modal overlay fails. The blocking library-problem/launch-list window is explicit: its dim takes the modal layer, but a background target fails instead of reporting a no-op success, and only that window's own controls (`button:library…`) pass. Its creation frame is shielded and redrawn with empty input like a prompt's, so background text/pointer input cannot act while the new modal areas settle. A quit prompt or settings notice is a real egui modal scope with a foreground backdrop. Only its own buttons (`button:quit…`, `button:noticeOk`) accept a `ui.clickWidget`; background targets fail, and background keystrokes, text/clipboard input, wheel/zoom input and AccessKit actions are dropped before panels see them. The prompt itself takes Tab/Shift+Tab, Enter/Space on the focused button, and Escape/Enter for the safe default Cancel; AccessKit Focus/Click works when targeted at a prompt button. Its first creation frame (including a Tasks→Unsaved or notice→next-notice transition) is shielded and redrawn with empty input, so a press/release in that frame, or a held press from before it, cannot act underneath it; a synthetic drag already in progress is canceled. Once settled, raw `ui.click`/`ui.drag`/`ui.pointer` and backdrop clicks are still delivered to the prompt backdrop as no-ops, and the prompt's own button clicks work normally. The area/layer check cannot see a different widget covering the point in the same layer. A `ui.clickWidget` whose widget disappears before its release also fails, after canceling the pointer press without a click or drag (the same rules apply when a click spans several host frames) |
|
||||
| `ui.move` / `ui.click` / `ui.drag` | `{x, y, count?, button?}` / `{x, y, toX, toY, steps?}` | Raw pointer input, screen points (the same click and step caps apply). In every pointer and scroll gesture a number other than `count` and `steps` must lie between −1,000,000 and 1,000,000, or the request is refused and queues nothing |
|
||||
| `ui.pointer` | `{events: [{kind: down\|drag\|up, x, y}], alt?, shift?, cmd?}` | Gesture in normalized image coordinates (Detail view) |
|
||||
| `ui.key` | `{key, action?: press\|down\|up, cmd?, shift?, alt?, ctrl?}` | Key press (default), or the key going `down` and staying held until an `up` (Space held over a `ui.pointer` drag); while a prompt is up only its Tab/Shift+Tab, Enter, Space and Escape are delivered, every other key is dropped |
|
||||
|
||||
@@ -107,11 +107,11 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-LIB-OFFLINE | Keep album offline | P2 | 🚫 | | not applicable: local-first library |
|
||||
| LR-LIB-TARGET | Target album | P2 | ✅ | `cmd:album.setTarget`, `cmd:album.toggleTarget` | see LRC-LIB-COLLECTIONS |
|
||||
| LR-LIB-RATING | Star ratings | P0 | ✅ | `cmd:photo.rate` (`advance`), `cmd:photo.decreaseRating`, `cmd:photo.increaseRating`, `crates/ui-egui/src/shortcuts.rs`, `crates/ui-egui/src/widgets/rating.rs` | one shared star row in the bottom bar, Info panel and filter bar (hover previews, ←/→ on a focused star) and one painter for badges (grid cells, filmstrip, Compare caption); menu rows with star text (Photo ▸ Set Rating, Select By Rating, the grid context menu) are separate menu items, unchanged; 0 clears; 1–5 set; Shift+0–5 applies and advances once, including with Auto Advance. A rating, flag or label that takes the active photo out of the view (filter bar, Picks, smart album) makes the photo after it active (the one before at the end), and Shift / Auto Advance doesn't step past it (#2312). Default grid brackets adjust each photo by one, clamped to 0–5; one batch undo and AutoWrite. Batch grid and undo/redo regressions; macOS native ownership corrected (PR #261) |
|
||||
| LR-LIB-FLAG | Pick / reject flags | P0 | ✅ | `cmd:photo.pick`, `cmd:photo.reject`, `cmd:photo.unflag`, `cmd:photo.flag` | P pick, X reject, U clear; a flag or rating never waits for the drive: the catalog log is written and synced by a thread of its own, a failed write is held, retried and counted as unsaved (`crates/catalog/src/log_writer.rs`, PERF-STEP-STALL); Shift+P picks and advances in both grids (Presets elsewhere); Shift+X/U and legacy Shift+Z advance; no flag cycle; rejection does not delete the file; a pick shows as a filled flag on thumbnails, in Compare, in the loupe and on the Pick button, a reject outlined (#1013) |
|
||||
| LR-LIB-LABEL | Colour labels | P1 | ✅ | `cmd:photo.label`, `cmd:photo.clearLabel`, `cmd:label.setNames`, `cmd:label.names`, `cmd:dialog.labelNames`, keys 6–9 in `crates/ui-egui/src/shortcuts.rs` | Photo menu and grid context menu (coloured, named), Info-panel swatches, label dot plus translucent colour on square-grid/filmstrip surrounds and photo-grid footers (photo pixels unchanged); colour-label toasts have pale matching backgrounds; setting/clearing through keys (including Shift), menus or Info swatches shows the same bottom toast as ratings, with the colour/custom name; editable label names (undoable, journaled); no purple key (as in Lightroom), Clear Color Label (`photo.clearLabel`) has no key until one is given in Help → Keyboard Shortcuts, no custom extra labels |
|
||||
| LR-LIB-FLAG | Pick / reject flags | P0 | ✅ | `cmd:photo.pick`, `cmd:photo.reject`, `cmd:photo.unflag`, `cmd:photo.flag`, `crates/ui-egui/src/thumb.rs` | a rejected photo is dimmed on the grids and on the filmstrip, under its marks (the flag keeps its red); P pick, X reject, U clear; a flag or rating never waits for the drive: the catalog log is written and synced by a thread of its own, a failed write is held, retried and counted as unsaved (`crates/catalog/src/log_writer.rs`, PERF-STEP-STALL); Shift+P picks and advances in both grids (Presets elsewhere); Shift+X/U and legacy Shift+Z advance; no flag cycle; rejection does not delete the file; a pick shows as a filled flag on thumbnails, in Compare, in the loupe and on the Pick button, a reject outlined (#1013) |
|
||||
| LR-LIB-LABEL | Colour labels | P1 | ✅ | `cmd:photo.label`, `cmd:photo.clearLabel`, `cmd:label.setNames`, `cmd:label.names`, `cmd:dialog.labelNames`, keys 6–9 in `crates/ui-egui/src/shortcuts.rs`, `crates/ui-egui/src/thumb.rs` | Photo menu and grid context menu (coloured, named), Info-panel swatches, the label is a dot in the marks row on every surface (justified grid, square grid, filmstrip) plus translucent colour on the square-grid and filmstrip surrounds; nothing is laid over the photo's pixels (the justified grid's tinted footer band is gone). On the justified grid, which has no surround, the dot is kept before the stars and flag on a narrow photo and stays when Ratings & flags is Never; elsewhere the surround says the label; colour-label toasts have pale matching backgrounds; setting/clearing through keys (including Shift), menus or Info swatches shows the same bottom toast as ratings, with the colour/custom name; editable label names (undoable, journaled); no purple key (as in Lightroom), Clear Color Label (`photo.clearLabel`) has no key until one is given in Help → Keyboard Shortcuts, no custom extra labels |
|
||||
| LR-LIB-KEYWORD | Keywords | P0 | ✅ | `cmd:panel.keywords`, `cmd:photo.setMeta` (`addKeywords`/`removeKeywords`), `cmd:keyword.list`, `cmd:keyword.rename`, `cmd:keyword.delete`, `cmd:keyword.merge`, `cmd:keyword.suggest`, `crates/catalog/src/keywords.rs`, `crates/ui-egui/src/panels/left.rs` | left-panel keyword tree with counts (click filters, children included; context menu rename / merge / delete / add / remove); library-wide ops are one undo step and replay from the op log; suggestions (co-occurring / most used / completions) in the Keywords panel; keywords reorganize by drag and drop in the Keyword List (LRC-LIB-KEYWORDS) |
|
||||
| LR-LIB-PEOPLE | People / faces | P2 | 🟡 | `cmd:faces.detect`, `cmd:view.people`, `cmd:view.faceBoxes`, `cmd:photo.removeRegion`, `cmd:photo.setRegion`, `cmd:library.filter`, `crates/ui-egui/src/panels/people.rs`, `crates/catalog/src/query.rs` (`people`), `crates/engine/src/media.rs` (`face_job`), `crates/meta/src/xmp.rs` | MVP: named face regions read from XMP (MWG-RS, read-only, see `docs/xmp-interop.md`; clipped to the photo; Lightroom's `Rotation` of ±π/2 and π handled, mirrored orientations taken as written; boxes follow Rotate Left/Right and flips; a sidecar stating `mwg-rs:Regions`, even empty, replaces the photo's on re-read, one without leaves them) become cards in the People view (View ▸ People, or the People button in the toolbar): a close-up of the person's largest face, name and photo count; a click filters the grid (`person` in `library.filter`, `person:` search token, filter chip). Face boxes in the loupe can be switched off (View ▸ Face Boxes, toolbar) resized with eight drag handles and removed with the × shown on hover (catalog-only and undoable, one undo step per drag; the sidecar is never rewritten for either); no moving a box by dragging it yet. Photo ▸ Detect Faces (`cmd:faces.detect`) finds faces with the YuNet detector (pure Rust, about 200 ms a photo, matches OpenCV's own YuNet on a 45-photo test set; the 232 KB model is a one-time download offered in the same step, never part of LightCraft) and adds them as unnamed boxes; names are suggested from the faces already named (recognition models are opt-in downloads, run on the CPU in a background thread; a face is named only when you confirm it); a person's page shows their cropped faces and the unnamed faces that look like them (LRC-LIB-PEOPLE), with a user-triggered ↑ action or targeted A key to name all shown suggestions at or above one score in one undo step; with recognition on, a background scan finds faces in photos that have none and embeds every face (one to three worker threads, raws through their embedded preview); an Unnamed faces section orders faces by likeness and names a selected group at once; no separated clusters, no manual tagging, no writing regions back |
|
||||
| LR-LIB-STACK | Stacks | P1 | ✅ | `cmd:stack.group`, `cmd:stack.ungroup`, `cmd:stack.toggle`, `cmd:stack.setTop`, `cmd:stack.remove`, `cmd:stack.auto`, `cmd:photo.delete`, `crates/catalog/src/stacks.rs` | grid/filmstrip count badges (a click expands / collapses the stack, selected or not), expand/collapse (a click or double-click on a grid badge toggles the stack once, #2233), auto-stack by capture time; delete / remove folder drop the photo from the stack so `i/n` updates (#1493); no visual-similarity auto-stack |
|
||||
| LR-LIB-STACK | Stacks | P1 | ✅ | `cmd:stack.group`, `cmd:stack.ungroup`, `cmd:stack.toggle`, `cmd:stack.setTop`, `cmd:stack.remove`, `cmd:stack.auto`, `cmd:photo.delete`, `crates/catalog/src/stacks.rs`, `crates/ui-egui/src/thumb.rs` | grid/filmstrip count badges (the same badge on both, a click expands or collapses the stack, selected or not, one translated tooltip; widgets `stack:<id>`, `film:stack:<id>`), expand/collapse (a click or double-click on a grid badge toggles the stack once, #2233), auto-stack by capture time; delete / remove folder drop the photo from the stack so `i/n` updates (#1493); no visual-similarity auto-stack |
|
||||
| LR-LIB-VERSIONS | Versions | P1 | ✅ | `cmd:version.create` | see section M |
|
||||
| LR-LIB-DELETE | Delete / Recently Deleted | P0 | ✅ | `cmd:photo.delete`, `cmd:photo.restore`, `cmd:photo.deletePermanently` | Delete and Delete Permanently retain surviving selected photos; if none remain, select the next visible survivor (previous at the end) in the current source/filter/sort; permanent deletion removes catalog records, not files on disk; Restore and Delete Permanently in the Photo menu and the photo context menus for photos in Recently Deleted (before, the UI had no way to restore); importing a file that is in Recently Deleted again restores the photo with its edits, rating and albums (issues #298, #706: before, the import skipped it as "already in the library" while the grid showed it deleted) — the review dialog checks it, badges it "Will be restored", counts it as "in Recently Deleted" rather than "already in the library", and its choice Restore them / Import as new / Leave them starts on Restore; with Leave them such a file starts unchecked and Check All and the file-type toggles leave it out, but a click still checks it and it is restored (issue #1285: before, the click did nothing and the "In Recently Deleted" badge was drawn over the checkbox, which now sits above it); dropped files restore too ("Restored 1 photo from Recently Deleted"); a deleted photo matched by content whose file is gone is relinked to the imported file; Photo ▸ Empty Recently Deleted (`cmd:library.emptyRecentlyDeleted`, one undo step, shown while the trash is the source); import takes `onDeleted` restore (default) / skip / fresh for files in the trash (`cmd:library.import`; the report lists `restored`, and with skip flags the duplicate `existingDeleted`); browsing a folder in Local (`cmd:library.browse`), Auto Import and a Lightroom catalog import never restore a deleted photo; no confirmation dialog, no auto-purge after N days (needs a deleted-at date in the catalog); Delete asks first ("Move this photo to Recently Deleted?") from the key, the Photo menu and the photo context menu, on by default and switched off in Settings ▸ General (#1239: before, it was off by default and the context menu never asked); no auto-purge after N days (needs a deleted-at date in the catalog) |
|
||||
| LR-LIB-REMOVE-ALBUM | Remove from album | P0 | ✅ | `cmd:album.removePhotos`, `crates/engine/src/tests/album_remove.rs`, `crates/ui-egui/src/tests/album_remove.rs` | changes the album only: the photos stay in the library, their library folder and their folder on disk (issue #1805); `id` defaults to the album on screen; returns `{removed, album}`. In a normal album ⌫ removes from the album (as in Lightroom; no confirmation, one undo step), in a smart album it changes nothing and says to edit its rules |
|
||||
@@ -123,7 +123,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-LIB-CULL | Assisted culling | P2 | 🟡 | `cmd:photo.analyze`, `cmd:dialog.cull`, `crates/pipeline/src/cull.rs` | Photo ▸ Assisted Culling…: focus score (0–100), clipping, burst grouping (look-alike shots within 10 s, both limits adjustable in the dialog and as `burstGap` / `similarity`, #2275) with the sharpest marked; reject below a focus score, pick each burst's best; classical measures — no eyes-closed / expression detection |
|
||||
| LR-LIB-ACTIVITY | Comments & likes | OOS | 🚫 | | |
|
||||
| LR-LIB-QUICKCOLL | Quick collection [Classic] | P2 | ✅ | `cmd:album.toggleTarget`, `cmd:album.clearQuick` | B in the grids |
|
||||
| LR-LIB-VIRTUALCOPY | Virtual copies [Classic] | P1 | ✅ | `cmd:photo.virtualCopy`, `cmd:photo.delete`, `crates/engine/src/cmd/organize.rs` | “Copy N” badge, stacked with the original, same albums, no XMP writes; default numbers are checked across the batch before copies are created, while explicit names bypass the counter; deleting a copy dissolves or renumbers the stack (#1493); no “Set Copy as Master” |
|
||||
| LR-LIB-VIRTUALCOPY | Virtual copies [Classic] | P1 | ✅ | `cmd:photo.virtualCopy`, `cmd:photo.delete`, `crates/engine/src/cmd/organize.rs`, `crates/ui-egui/src/thumb.rs` | “Copy N” tag on the grid and on the filmstrip (widgets `copy:<id>`, `film:copy:<id>`; on a narrow thumbnail it drops its name and then hides rather than meet the stack badge), stacked with the original, same albums, no XMP writes; default numbers are checked across the batch before copies are created, while explicit names bypass the counter; deleting a copy dissolves or renumbers the stack (#1493); no “Set Copy as Master” |
|
||||
|
||||
## C. Views & navigation (VIEW)
|
||||
|
||||
@@ -134,7 +134,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-VIEW-DETAIL | Single-photo view | P0 | ✅ | `cmd:view.detail`, `crates/ui-egui/src/panels/detail.rs` | a “Rendering…” pill at the bottom of the photo (widget `loupe:rendering`; above the Navigator when that is in the way) once a render has been on its way for 0.5 s with nothing new on screen: over a stand-in (the raw's embedded JPEG, a thumbnail), the previous render after an edit, or, zoomed in, the magnified frame waiting for its window; Before views watch their own renders. Always on (Lightroom Classic makes it a View Options choice). When the render fails behind a stand-in, a caution pill says “This photo can't be opened” (“Original offline · no smart preview” when that is why) with the reason on hover and for screen readers (widget `loupe:renderFailed`; `ui.inspect` → `loupe.failed`). While the camera's embedded JPEG is on screen a “Camera preview” label at the top right says so, with what that means on hover (widget `loupe:cameraPreview`), so colour isn't judged on it. Culling: the stand-ins of the next five photos in the direction of travel and the one behind are made ahead and taken over at the step (`render::Slot::QuickAhead`; EOS R5 C wedding: step to the camera JPEG p50 187 → 0 ms), decoded camera JPEGs stay in memory for a step back, zoomed in on an unedited raw the camera JPEG is shown at full size under the window render until that arrives (100 % in ~0.9 s instead of ~5.6 s, `render::Slot::QuickFull`), and while an arrow key is held the raw render waits until a photo stays 0.12 s (`crates/ui-egui/src/loupe_timing.rs`); `ui.inspect` → `perf.loupeSteps` times each step on the frames drawn |
|
||||
| LR-VIEW-EDIT | Edit view | P0 | ✅ | `cmd:panel.edit` | |
|
||||
| LR-VIEW-FULLSCREEN | Full-screen preview | P1 | ✅ | `cmd:view.fullScreenPreview`, `cmd:view.enterFullScreen` | photo on black, arrows step, Esc exits; ⇧⌘F window full screen |
|
||||
| LR-VIEW-FILMSTRIP | Filmstrip | P0 | ✅ | `cmd:view.filmstrip`, `crates/ui-egui/src/panels/detail.rs` | the photo context menu on right-click; the mouse wheel scrolls it sideways, a third of its width per notch as in Lightroom Classic (trackpads scroll the points they report); it follows the active photo only when that changes (centred if off screen), so a scrolled strip stays put; every selected photo has the selected background; selected photos with a loaded thumbnail also show a ring, the active one in the heavier two-tone ring and the others in the lighter one, in the theme's colours, as in the grid (a selected cell with no thumbnail, still loading or failed, has the background and no ring); a drag from a cell carries the selection (a photo outside it drags alone and replaces it; in Compare it drags alone and leaves the selection, the active photo and the pair as they are) to the same sidebar rows as a drag from the grid, and a click without movement works as before (it selects the photo; in Compare it goes to the active side, see LR-VIEW-COMPARE) |
|
||||
| LR-VIEW-FILMSTRIP | Filmstrip | P0 | ✅ | `cmd:view.filmstrip`, `crates/ui-egui/src/panels/detail.rs`, `crates/ui-egui/src/thumb.rs` | its thumbnails wear the overlay of the grid's (one painter, `thumb.rs`): the virtual-copy tag, a clickable stack badge with the grid's tooltip, the label dot, the grid's placeholder until the picture is drawn, a rejected photo dimmed as in the grid, and a failure mark that says why on hover (`film:failed:<id>`); on a narrow thumbnail the marks degrade (edited mark, then the stars as ★ and the number, then what does not fit); the stack badge sheds its icon, then the `i/n`) and nothing is painted outside the photo; the preview pill keeps clear of the stack badge; right-click on the stack badge opens the photo menu; the photo context menu on right-click; the mouse wheel scrolls it sideways, a third of its width per notch as in Lightroom Classic (trackpads scroll the points they report); it follows the active photo only when that changes (centred if off screen), so a scrolled strip stays put; every selected photo has the selected background; selected photos with a loaded thumbnail also show a ring, the active one in the heavier two-tone ring and the others in the lighter one, in the theme's colours, as in the grid (a selected cell with no thumbnail, still loading or failed, has the background and the same ring (the filmstrip paints the ring on its placeholder too, as the grid does)); a drag from a cell carries the selection (a photo outside it drags alone and replaces it; in Compare it drags alone and leaves the selection, the active photo and the pair as they are) to the same sidebar rows as a drag from the grid, and a click without movement works as before (it selects the photo; in Compare it goes to the active side, see LR-VIEW-COMPARE) |
|
||||
| LR-VIEW-ZOOM | Zoom & pan | P0 | ✅ | `cmd:view.zoomFit`, `cmd:view.zoom100`, `cmd:view.zoomIn`, `cmd:view.zoomOut`, `cmd:view.zoomToggle`, `cmd:view.clickZoom`, `cmd:view.navigate`, `crates/ui-egui/src/panels/detail.rs`, `crates/ui-egui/src/headless.rs` | continuous native pinch / modifier-wheel zoom (Fit–800%, anchored under the pointer), two-finger scroll / touch pan with edge limits; in Detail a middle-button drag (the wheel pressed) pans with a hand cursor whatever tool is active, so Remove / Heal / Clone, mask brushes and Crop don't paint or move meanwhile (`middle_pan`, `tests_canvas_pan.rs`); in Detail a middle-button drag (the wheel pressed) pans with a hand cursor whatever tool is active, so Remove / Heal / Clone, mask brushes and Crop don't paint or move meanwhile (`middle_pan`, `tests_canvas_pan.rs`); Detail (including tools, Before/After and full-screen preview), Compare and Reference; fractional percentages preserve small gestures; image, picker and targeted-adjustment cursors stay steady between gesture events; keyboard steps 25–800 % (not 6–1600 %); Fill in the bottom bar; click / Z / Space eases to the chosen ratio (1:1 default, 2:1, 3:1, 4:1, 8:1). The loupe's cost follows the canvas, not the zoom (issue #323): the whole frame is rendered at about canvas size (at most the 2560 px preview source level unless a larger Preview size is chosen, and never above the GPU's texture side), and once the view is zoomed well past that (more than 25 %) the window on screen is rendered too, cut from a frame of at most the photo's own pixels, so beyond 100 % the GPU magnifies it (`region::plan`, `RenderRequest::window`, `Session::region_job`, `crates/ui-egui/src/region.rs`); 1:1 and 2:1–8:1 are sharp at any photo size. A slider tick takes 7–12 ms on a 1400 × 900 canvas and 11–25 ms on a 2800 × 1700 one at 100 % and 400 % of a 24 MP photo (M1 Max, GPU, `profile_slider_drag`); about 20–25 ms at 100 % on the big canvas is over a 16 ms frame. A slider drag renders the whole frame at full size where the GPU draws the view, so the fit view stays sharp while dragging, and at 0.6 of it where that would be too slow: on the CPU, with an output-device profile proof or the HDR range shown, or for a control whose full-size drafts on this photo went clearly over the 16 ms slider budget (more than 20 ms) in two drags in a row (a LUT profile or refined mask the CPU renders, a photo past a GPU limit, a slow GPU); a draft's time is its render plus the frame that uploads and shows it, and a host frame time over 1 s (a hidden or stalled window) counts as unknown. A slow verdict is per photo and control (the same control on another photo, or another control on this one, is timed afresh) and expires: after 30 s a drag tries full size again, the wait doubling after each slow retry up to 240 s. Only a drag timed at full size changes it: one whose full-size drafts' median time (leaving out the first) is at most 20 ms forgets it; a drag that drafts small from its start (while the verdict holds, or where the GPU does not draw the view) or times fewer than two full-size drafts leaves it unchanged. At most 256 (photo, control) pairs are remembered, the oldest forgotten first. The size is chosen when a drag starts and kept until it ends, unless its full-size drafts take more than twice the budget, when it drops to 0.6 after three of them (`region::DragScale`, issue #330). Zoomed in, the whole-frame draft under the window is the 0.6 one (only the histogram and the window's stand-in use it). Render workers convert the pixels for their textures, not the UI thread. Handing GPU renders to egui without a CPU readback is #1228. A continuous pinch holds the render sizes (and the windows there are) and the size the fit view is shrunk to until it is quiet. A fit view on a canvas up to about 3200 px (a Retina Mac) never decodes the original; larger displays get a window at fit, which does. Diagnostic overlays (Visualize Spots, Point Color range, HDR range) get windows too, tested equal to the whole-frame render's pixels. Photos whose spots or Auto Mask strokes read too far for one window (only photos longer than 8192 px) render the whole frame at the size it is drawn, as before windows; while a preset or profile is hovered, or over a picture that is not the frame (an unsupported raw's embedded JPEG), the whole frame stays canvas-sized. Before/After (side by side, stacked, `\\` and both wipes) gets the same windows on both sides, clipped to their pane or side of the line. Windows render on the GPU like whole frames (equivalence-tested against the CPU), in the browser build too (windows no wider than its GPU's texture side, at most 3072 px), and are not made while hovering a look, nor over a picture that is not the frame (an unsupported raw's embedded JPEG with another crop). No texture is larger than the GPU allows. Spots and Auto Mask brushes work while what a window reads fits one render (8192 px along an axis, 4096 in the bLine truncated
|
||||
| LR-VIEW-FOCUSPOINT | Camera focus point overlay and zoom (beyond Lightroom) | P2 | 🟡 | `cmd:view.focusPoint`, `cmd:view.zoomToFocus`, `cmd:view.zoomToggle`, `cmd:photo.reload`, `cmd:photo.readFocusPoints`, `cmd:focus.pump`, `crates/meta/src/focus.rs`, `crates/meta/src/focus.rs`, `crates/engine/src/focus_scan.rs`, `crates/engine/src/tests/focus_scan.rs`, `crates/ui-egui/src/panels/detail.rs` (`focus_box`, `draw_focus_point`), `crates/ui-egui/src/panels/compare.rs`, `crates/ui-egui/src/tests/focus_point.rs`, `docs/focus-points.md` | an extra (Lightroom shows no focus points): the AF frame read from the file at import; photos imported earlier get it in the background from a header-only read of each file (about 32 KB, ~100 photos/s from a spinning disk; activity row, cancellable, resumable; Photo ▸ Read Focus Points) as a box on the upright photo, drawn in Detail, Compare and Survey through rotation and crop (View ▸ Focus Point, ⌥F); Toggle Zoom centres on it (View ▸ Zoom to Focus Point, on by default); Info panel row `AF-C · Wide · Animal Eye Tracking`; `meta.focus` in `photo.inspect`. Partial: Sony ILCE-1 and ILCE-7SM3 only (layout checked against 333 files); other Sony bodies and other makers not yet; manual focus and centre-only Wide reports show nothing; Compare panes share one pan, so Z centres on the active photo's point only |
|
||||
| LR-VIEW-NAVIGATOR | Navigator mini map | P1 | ✅ | `cmd:view.navigator`, `crates/ui-egui/src/panels/detail.rs` | shown while zoomed (bottom right); click/drag pans |
|
||||
@@ -439,7 +439,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-PREF-GENERAL | General settings | P0 | ✅ | `cmd:app.settings`, `cmd:app.openLibrary`, `crates/ui-egui/src/dialogs/settings.rs`, `crates/ui-egui/src/panels/notices.rs` | General / Import / Performance / Display / Interface tabs; app settings in ui.json (written atomically, saved when the library changes and every few seconds), library settings in prefs.json; At launch: open the last library or ask (see LRC-LIB-CATALOG-SWITCH); a damaged settings file is kept as `.corrupt-<time>` and reported, an unreadable one is not overwritten that session (`library.info` → `settingsWarnings`); quitting with unsaved changes retries, then asks |
|
||||
| LR-PREF-LOCALSTORAGE | Storage & cache | P1 | ✅ | `cmd:library.preferences`, `cmd:library.clearPreviews`, `cmd:library.compact` | thumbnail cache size + clear in Settings → Performance; library location + Open Library… in General; the automatic size has no ceiling, so once per session (library open, then every few minutes) a notice says when the drive holding the cache has under 10 % or under 20 GB free, with its free space and the cache's size, and opens Settings → Performance (`crates/engine/src/disk_space.rs`, `library.info` → `lowDiskSpace`, `button:noticeSettings`) |
|
||||
| LR-PREF-ACCOUNT | Account | OOS | 🚫 | | |
|
||||
| LR-PREF-INTERFACE | Interface options | P1 | ✅ | `cmd:app.settings`, `cmd:view.appearance`, `cmd:view.theme` | Appearance Mode (Sync with System / Dark / Light; the top bar button cycles Auto, Light, Dark) with separate dark (Charcoal, Midnight) and light (Silver, Paper) themes previewed in cards; hover stars persist favorite themes, the appearance button context menu opens Interface settings and lists light favorites before dark favorites; filmstrip names/badges, grid badges (auto/always/never), square-grid names, navigator, info overlay |
|
||||
| LR-PREF-INTERFACE | Interface options | P1 | ✅ | `cmd:app.settings`, `cmd:view.appearance`, `cmd:view.theme` | Appearance Mode (Sync with System / Dark / Light; the top bar button cycles Auto, Light, Dark) with separate dark (Charcoal, Midnight) and light (Silver, Paper) themes previewed in cards; hover stars persist favorite themes, the appearance button context menu opens Interface settings and lists light favorites before dark favorites; filmstrip names/badges, grid badges (Ratings & flags: Stars on hover, the default, formerly "When rated or hovered": flags and colour labels always, stars and the edited mark on hover and selection; Always; Never), square-grid names, navigator, info overlay |
|
||||
| LR-PREF-DISPLAY | Monitor (display) colour management | P1 | 🟡 | `cmd:app.displayProfile`, `crates/codecs/src/display.rs`, `crates/engine/src/display.rs`, `crates/ui-egui/src/dialogs/settings.rs`, `apps/lightcraft/src/screen_profile.rs`, `apps/lightcraft/src/colord.rs`, `apps/lightcraft/src/win_screen_profile.rs`, `crates/wincolor/src/lib.rs`, `docs/display-profiles.md` | Settings ▸ Display: a monitor ICC profile (matrix/TRC exactly, LUT-based through the CMS) chosen by hand, or on macOS the profile of the screen showing the window (followed across screens, #787), on Linux the profile the desktop assigns in colord (read off the UI thread every 3 s; used with one display, or several sharing one profile), on Windows the profile Windows Color System assigns to the monitor showing the window (per-user or system, followed across monitors and profile changes; sRGB while Windows colour-manages the desktop itself: HDR or Auto Color Management; verified on Windows 11 with a Display P3 profile set and unset while the app ran); the loupe, Before, Compare, hover previews and the second window render into the display's primaries (its full gamut, CPU and GPU), thumbnails and stand-ins are converted from sRGB; histogram, preview caches and exports stay sRGB; soft proofing's display gamut warning uses the display's gamut. Missing: X11 `_ICC_PROFILE`, per-monitor profiles on Linux (eframe doesn't say which monitor the window is on) |
|
||||
| LR-PREF-PERFORMANCE | GPU / performance | P1 | ✅ | `cmd:app.gpu`, `cmd:app.memoryBudget`, `cmd:app.settings` | GPU on/off (a crash while the GPU device or its kernels are built, issue #250, turns it off for the next launch), preview size (Automatic = the whole-frame loupe render at canvas size, up to 2560 px; or a 1600–5120 px size for it; zoomed views add a window at up to 100 %, issue #323), memory budget (a quarter of it is the idle per-view stage caches' share; the open photo's views are counted and reported, and cut only past four times that, the before side's and the zoom window's first — a Before/After at 1:1 on a 2800 px canvas holds about 1 GB of GPU stages, plus the one 288 MB copy of the original, which `ui.inspect` reports as `sharedSourceBytes`), thumbnail cache size in Settings; Opt-in Windows DX12 DirectComposition preference to prevent VRR flicker (restart required; hardware verification pending) |
|
||||
| LR-PREF-PEOPLE | Face recognition | P2 | 🟡 | `cmd:faces.enable`, `cmd:faces.models.list`, `cmd:faces.models.inspect`, `cmd:faces.models.install`, `cmd:faces.models.download`, `cmd:faces.models.downloads`, `cmd:faces.models.downloadCancel`, `cmd:faces.models.remove`, `cmd:faces.models.select`, `cmd:dialog.faceModel`, `crates/faces/src/lib.rs`, `crates/ui-egui/src/dialogs/faces.rs` | Settings ▸ Faces: an off-by-default toggle and the face model list. Models are opt-in and never bundled, the 232 KB YuNet detector included. Press Download (terms first; then a pinned address, size and SHA-256 checked, fetched over pure-Rust https with `lightcraft-fetch`), or add any `.onnx` by picking or dropping it: it is recognised by hash or described from its shape, shows its licence terms and training-data note, runs a self-test, and installs only after an "I accept" box; an installed model is chosen and recognition switched on at once (the newest wins, each model keeps its own embedding cache). Non-commercial models are add-by-file only, never offered for download. Suggestions of names run on the shared pure-Rust CPU interpreter (`crates/faces/src/net.rs`, `crates/faces/src/runtime.rs`; bounded im2col/GEMM, checked ONNX shapes/operators; no external inference runtime; 40 public crops agree within 2.1e-6, one-thread SFace 34–36 ms / AuraFace 233–252 ms, see docs/faces.md) in a background worker and are never applied automatically. Thresholds are starting points calibrated on busts, not yet on live faces; the Recognise faces switch is off until a recognition model is chosen and installed (`faces.enable {enabled: true}` refuses otherwise; removing the last recogniser switches it off), issue #678 |
|
||||
@@ -477,7 +477,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-BEHAV-TOAST | Toast notifications | P1 | ✅ | `crates/ui-egui/src/panels.rs` | |
|
||||
| LR-BEHAV-DIALOGS | Dialogs fit the window | P1 | ✅ | `crates/ui-egui/src/dialogs.rs` (`dialog_body`, `list_height`), `crates/ui-egui/src/tests/dialog_fit.rs`, `crates/ui-egui/src/tests/dialog_copy.rs`, `crates/ui-egui/src/tests/dialogs.rs` (`a_click_outside_closes_the_dialog_when_settings_allow_it`) | a dialog taller than the window (Export on a 1366×768 screen, issue #781) never runs off it: its options scroll while the title bar and the Cancel / confirm row stay on screen (the confirm button names its action: Create, Rename, Create Stacks, Export 3 Photos…, with "OK" kept only for a one-field prompt opened with a command that has no verb, `crates/ui-egui/src/tests/dialog_copy.rs`); lists that scroll on their own (What's New, All Metadata, shortcuts, smart-album rules, credits) get shorter first; dialogs that fit look as before; Import keeps its own resizable, scrolling window; Settings → Dialogs → Close a dialog by clicking outside it (off by default, so a stray click never throws away a dialog's choices): a click pressed and released on the dimmed backdrop closes the dialog like Esc and doesn't reach the panels below, while a drag that ends outside (a slider pulled past the edge) or a click that closes a dropdown keeps it; the import review never closes this way (`clicked_backdrop`); a one-line prompt (Rename Folder, New Folder on Disk, the preset and version names, New Library when its name can't be used, Auto-Tag from Tracklog) the engine refuses stays open with its text and shows the reason in a toast, so the name can be corrected, where it used to close without a word; a New Folder on Disk that works says so (“Created folder “Selects” in “2026/Shoot””, naming the parent by its last two folders as dialogs do) |
|
||||
| LR-BEHAV-SIDEBAR-COLLAPSE | Collapsible left-sidebar sections | P2 | ✅ | `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`), `crates/ui-egui/src/sidebar.rs` (`SidebarLayout`), `crates/ui-egui/src/tests/panels.rs` | click the Albums, Local, By Date, Folders or Keywords header (or drive `ui.clickWidget` `sidebarSection:<albums\|local\|byDate\|folders\|keywords>`) to fold or unfold the section; a chevron before the title shows the state; the choice is kept across restarts (`sidebar` in the UI state; the `collapsedSidebar` list of older settings files is still read). the click itself is UI-only, like the By Date / Keywords disclosure triangles, and `cmd:view.sidebarSection` `{section, collapsed}` folds and unfolds for agents; photos dropped on a folded Albums section have no target |
|
||||
| LR-BEHAV-SIDEBAR-SECTIONS | Left-sidebar sections share one frame and one arrangement | P2 | ✅ | `crates/ui-egui/src/sidebar.rs` (`SidebarSection`, `SidebarLayout`), `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`, `tree_toggle`), `crates/ui-egui/src/tests/panels.rs` | Albums, Local, By Date, Folders and Keywords are drawn by one `section` frame (the same gap above, header, fold and accessibility name) from one arrangement, `sidebar` in the UI state: a list of `{id, hidden, collapsed}` top to bottom, also settable with `ui.set`. Whatever is read, every section is in it exactly once (unknown and repeated entries are dropped, the rest follow in the usual order), so a damaged or newer settings file never loses the other settings. Rows that open (album folders, Local folders, dates, library folders, keywords) share `tree_toggle`: the same triangle, the same remembered open state, announced as Expand / Collapse. A section with nothing to list (Folders before anything is imported, Keywords before any is added) stays, open, with a one-line note in place of rows (`sidebarEmpty:<id>`) instead of disappearing. `ui.set` reads `sidebar` strictly (`SidebarLayout::parse`): an unknown or repeated section, or a flag that is not true / false, is refused and changes nothing; sections left out follow in the usual order, shown and open; the older `collapsedSidebar` list still folds and unfolds. A section may have one button at the end of its header, declared in one place (`header_button`: an icon, a tooltip, and either an action or a menu): the frame draws it at the visible edge in the header and its pinned copy, keeps its click from folding the section and leaves it room beside a folded section's count. Albums has + (`icon:albumNew`: Create Album / Smart Album / Folder…), Keywords has + (`icon:keywordNew`: Create Keyword Tag, for a keyword inside the default parent, not inside what the Keyword List has picked; once made, Keywords is shown and opened down to it). My Photos (All Photos, Recently Added, Picks, Missing Photos, Recently Deleted) is not a section: it stays on top |
|
||||
| LR-BEHAV-SIDEBAR-SECTIONS | Left-sidebar sections share one frame and one arrangement | P2 | ✅ | `crates/ui-egui/src/sidebar.rs` (`SidebarSection`, `SidebarLayout`), `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`, `tree_toggle`), `crates/ui-egui/src/tests/panels.rs`, `crates/ui-egui/tests/it/sidebar_branch.rs` | Albums, Local, By Date, Folders and Keywords are drawn by one `section` frame (the same gap above, header, fold and accessibility name) from one arrangement, `sidebar` in the UI state: a list of `{id, hidden, collapsed}` top to bottom, also settable with `ui.set`. Whatever is read, every section is in it exactly once (unknown and repeated entries are dropped, the rest follow in the usual order), so a damaged or newer settings file never loses the other settings. Rows that open (album folders, Local folders, dates, library folders, keywords) share `tree_toggle`: the same triangle, the same remembered open state, announced as Expand / Collapse. A click on the triangle with Option (Alt on Windows and Linux) held opens or folds the row and all the rows inside it, however many and also those not drawn yet: it is kept for the session as one thing said of all the rows inside the row (a row is as the last thing said of it, or of a row above it, has it), so a folder made inside the branch later follows it; in Local it folds everything inside a folder and opens the one folder (opening them all would read every folder from the disk); `ui.clickWidget` takes `alt: true` for it. A section with nothing to list (Folders before anything is imported, Keywords before any is added) stays, open, with a one-line note in place of rows (`sidebarEmpty:<id>`) instead of disappearing. `ui.set` reads `sidebar` strictly (`SidebarLayout::parse`): an unknown or repeated section, or a flag that is not true / false, is refused and changes nothing; sections left out follow in the usual order, shown and open; the older `collapsedSidebar` list still folds and unfolds. A section may have one button at the end of its header, declared in one place (`header_button`: an icon, a tooltip, and either an action or a menu): the frame draws it at the visible edge in the header and its pinned copy, keeps its click from folding the section and leaves it room beside a folded section's count. Albums has + (`icon:albumNew`: Create Album / Smart Album / Folder…), Keywords has + (`icon:keywordNew`: Create Keyword Tag, for a keyword inside the default parent, not inside what the Keyword List has picked; once made, Keywords is shown and opened down to it). My Photos (All Photos, Recently Added, Picks, Missing Photos, Recently Deleted) is not a section: it stays on top |
|
||||
| LR-BEHAV-SIDEBAR-HIDE | Show and hide left-sidebar sections | P2 | ✅ | `cmd:view.sidebarSection`, `cmd:view.sidebarReset`, `crates/ui-egui/src/sidebar.rs`, `crates/ui-egui/src/panels/left.rs` (`sections_menu`), `crates/ui-egui/src/menus/menubar.rs`, `crates/ui-egui/src/tests/panels.rs` | View ▸ Sidebar Sections lists Albums, Local, By Date, Folders and Keywords in the sidebar's order, each checked while shown; unchecking one takes its header and rows off the sidebar, checking it puts it back where and how it was (still folded if it was). The same list opens with a right-click on any section header (with Hide This Section first; widgets `sidebarMenu:hide`, `sidebarMenu:section:<id>`, `sidebarMenu:reset`) and on the My Photos title (`sidebarTitle`), which is always there, so hidden sections can always come back. Reset Sidebar Sections (enabled once something changed) shows and opens every section in the usual order. `view.sidebarSection` `{section, show?, collapsed?}` flips shown / hidden when neither flag is given and refuses an unknown section or a flag that is not true / false. Hiding the section of what the grid shows (an album, a keyword filter) leaves the grid as it is; an album made while Albums is hidden or folded brings Albums back, open. Kept with the UI state (`sidebar`). My Photos itself can't be hidden |
|
||||
| LR-BEHAV-SIDEBAR-REORDER | Reorder left-sidebar sections | P2 | ✅ | `cmd:view.sidebarMoveSection`, `crates/ui-egui/src/sidebar.rs` (`move_before`, `move_by`), `crates/ui-egui/src/panels/left.rs` (`section_drag`, `section_drop_before`, `section_drag_feedback`), `crates/ui-egui/src/tests/panels.rs` | drag a section by its header: its name follows the pointer, a line (`sidebarSectionDrop`) shows the gap it would go to (above the section whose upper half the pointer is over, or below the last), releasing over the sidebar moves it there, Esc or releasing elsewhere leaves it; the sidebar scrolls when the drag nears its top or bottom edge, also over a pinned header (a section picked up by the pinned header scrolls once the pointer has left it). A press on a header's button is never a section drag. A click on the header still folds the section, and an album dragged onto the Albums header is still an album drag. The header's menu has Move Up / Move Down (`sidebarMenu:moveUp` / `moveDown`), one shown section at a time, stepping over hidden ones, disabled at the ends. `view.sidebarMoveSection` `{section, direction: up\|down}` or `{section, before: <section>\|null}` (null: last) answers `{moved, order}`. The order is kept with the UI state (`sidebar`). Recently Deleted is listed with My Photos (below Picks / Missing Photos), not after the sections. Not here: dragging My Photos, or rows from one section into another |
|
||||
| LR-BEHAV-SIDEBAR-STICKY | Pinned section header and section look | P2 | ✅ | `crates/ui-egui/src/panels/left.rs` (`pinned_header`, `section_header`, `empty_hint`), `crates/ui-egui/src/tests/panels.rs` | while the rows of an open section are in view but its header has scrolled away, a copy of the header (`sidebarSectionPinned:<id>`, with the section's buttons and menu) stays at the top of the sidebar; the next section's header pushes it out; folding from it brings the section's own header into view. Rows scrolled beneath the pinned header are covered by it: an album or photos dropped on the pinned Albums header go to the top level / nowhere, never to the row under it; folding from it keeps the sideways scroll. Sections are told apart by a hairline in the gap above each; the fold chevron sits in the gutter, in the column of the rows' triangles (`sidebarSectionChevron:<id>`); a header highlights under the pointer; a folded section shows how many top-level rows it holds (`sidebarSectionCount:<id>`, with View ▸ Photo Counts); a count of 0 is fainter. Not here: a height of its own per section (one scroll area serves the whole sidebar), a count for Recently Added, Local's Browse Folder… as a header button |
|
||||
@@ -724,7 +724,7 @@ From `08-lightroom-classic-extras.md` (Classic-only features) and part 2 of `06-
|
||||
| LRC-LIB-PEOPLE | People view | P2 | 🟡 | `cmd:view.people`, `cmd:view.person`, `cmd:faces.person`, `cmd:faces.unnamed`, `cmd:faces.nameFaces`, `crates/ui-egui/src/panels/people.rs`, `crates/ui-egui/src/panels/person.rs`, `crates/ui-egui/src/panels/unnamed.rs`, `crates/engine/src/face_tiles.rs` | Named People cards (face close-up, the photo count on the picture, name) for the photos the active filters let through, with the filter chips shown above them, sized by the thumbnail slider. Below them the **Unnamed faces**: every face nobody has named as a cropped picture, look-alikes next to each other once recognition has looked at them, a suggested name on a face the named ones recognise; click or Shift-click to select, type a name, Enter names the whole group in one undo step. A click on a person opens their page: only cropped faces, then **More** (unnamed faces that look like them, best first; click to confirm one, × to hide for the session, or ↑ / hovered-or-focused A key to confirm all currently shown non-hidden suggestions at or above that face's score, including ties, in one undo step). Every face is shown by the detector's box where the scan has one, so faces are equally close. Until recognition is set up a line at the top offers the next step (Settings ▸ Faces, or Turn on), as does the loupe's name box. Face pictures of unedited raws are cut from the largest embedded preview (planned read: header and JPEG only, never the sensor data) when it holds at least ¾ of the tile's pixels across the face, else developed as before; all are kept in the thumbnail disk cache at 16 px size steps, so a later launch shows them without reading the originals (#1440, `docs/faces.md`). No clusters with separators between groups, no persistent reject, no merge of two people
|
||||
| LRC-LIB-COMMENTS | Comments panel | P2 | ⬜ | | |
|
||||
| LRC-LIB-VISUALSEARCH | Find similar photos | P2 | ✅ | `cmd:library.findSimilar`, `crates/pipeline/src/cull.rs` (`signature`), `crates/engine/src/cmd/similar.rs`, `crates/ui-egui/src/find_similar.rs` | photo menu / Photo ▸ Find Similar Photos: look-alike photos (composition and tones), most similar first, as a filter (`only`); the app reads the photos on a worker thread under an activity row with ✕ |
|
||||
| LRC-LIB-MISSING | Missing files & relink | P1 | ✅ | `cmd:library.missing`, `cmd:photo.relink`, `cmd:library.findMissing`, `cmd:file.findMissing`, `cmd:photo.locate`, `crates/engine/src/cmd/missing.rs` (`checked_path`), `crates/ui-egui/src/missing_sweep.rs`, `crates/ui-egui/src/panels/left.rs` (`locate_missing_item`) | File → Find Missing Photos… (anywhere in a folder: same name, size and content hash; renamed files by size + content hash; same name and size alone only when unambiguous — look-alikes are skipped and reported; searched on a worker thread, one undo step), photo menu → Locate Missing File…; a folder or disk row's Locate Missing Files… chooses its new location and scopes the same recursive background finder to that folder and its subfolders. Unreadable files show "!" in the grid and a reason in the loupe; undo never moves files. Missing Photos in the sidebar (counted on a worker thread; the view, the Info panel, the grid's context menu and thumbnails read file availability from a cache a worker thread fills, so an offline NAS never stalls a frame); it covers library photos only — Local browse records are never checked, for the count, the view, `library.missing` and Find Missing alike; `library.missing` from the control channel or `mcp --connect` checks the files on a worker thread (a "Missing Photos" row in the activity stack, ✕ stops it) and answers when it ends, so a large library on a network share never stalls the window; the same request meanwhile shares the running check |
|
||||
| LRC-LIB-MISSING | Missing files & relink | P1 | ✅ | `cmd:library.missing`, `cmd:photo.relink`, `cmd:library.findMissing`, `cmd:file.findMissing`, `cmd:photo.locate`, `crates/engine/src/cmd/missing.rs` (`checked_path`), `crates/ui-egui/src/missing_sweep.rs`, `crates/ui-egui/src/panels/left.rs` (`locate_missing_item`), `crates/ui-egui/src/thumb.rs` | File → Find Missing Photos… (anywhere in a folder: same name, size and content hash; renamed files by size + content hash; same name and size alone only when unambiguous — look-alikes are skipped and reported; searched on a worker thread, one undo step), photo menu → Locate Missing File…; a folder or disk row's Locate Missing Files… chooses its new location and scopes the same recursive background finder to that folder and its subfolders. Unreadable files show a warning icon in the grid and the filmstrip (widgets `badge:failed:<id>`, `film:failed:<id>`) whose tooltip says why and where to go (Locate Missing File… for a missing original, else Reload from Disk), and a reason in the loupe; undo never moves files. Missing Photos in the sidebar (counted on a worker thread; the view, the Info panel, the grid's context menu and thumbnails read file availability from a cache a worker thread fills, so an offline NAS never stalls a frame); it covers library photos only — Local browse records are never checked, for the count, the view, `library.missing` and Find Missing alike; `library.missing` from the control channel or `mcp --connect` checks the files on a worker thread (a "Missing Photos" row in the activity stack, ✕ stops it) and answers when it ends, so a large library on a network share never stalls the window; the same request meanwhile shares the running check |
|
||||
| LRC-LIB-CONVERT | Convert to DNG | P2 | ✅ | `cmd:photo.convertToDng`, `crates/engine/src/cmd/convert.rs` | Photo ▸ Convert to DNG: lossless DNG next to the raw with the settings embedded, photo (and its virtual copies) relinked; originals kept; undoable; the DNG is decoded and compared with the raw data, written to a temp file, synced, read back and only then given a free name (never replacing a file) — a failed write leaves no DNG and the photo on its raw (issue #106) |
|
||||
| LRC-LIB-PREVIEWS | Build / discard previews | P1 | ✅ | `cmd:library.buildPreviews`, `cmd:library.previewProgress`, `cmd:library.cancelPreviews`, `cmd:library.clearPreviews`, `crates/engine/src/cmd/previews.rs`, `crates/preview/src/lib.rs`, `crates/engine/src/tests/preview_prep.rs` | File ▸ Previews: build standard-sized (as big as the loupe shows photos on this screen, at least 2048 px, or the Settings → Performance size) or 1:1 previews of the selected photos (more than one) or every photo in view, in the background (a row in the activity stack, ✕ to stop), discard the cache; disk thumbnail + view cache. The loupe shows a built preview that is big enough as the photo (fitted down, no render); a build skips photos whose previews are there and writes each to disk before it counts it; the disk cache's automatic size makes room for every photo of the library (about 1.5 MB a photo, no ceiling: a low drive is told once per session, see LR-PREF-LOCALSTORAGE), and memory for previews follows the memory budget |
|
||||
| LRC-PERF-PREP | Prepare photos in the background (beyond Lightroom) | P1 | 🟡 | `cmd:prefs.backgroundPrep`, `cmd:prefs.setBackgroundPrep`, `crates/engine/src/prep.rs`, `crates/ui-egui/src/dialogs/settings/performance.rs` | Settings ▸ Performance ▸ Prepare photos in the background, per mode (Culling, Library, Editing), app-wide or for one library: previews of every photo in view built in the spare time once the user steps through photos (yields to the photo on screen, nearest photos first in the direction of travel, one cancellable row), photos ahead rendered for the loupe (0 = off), eye focus strips ahead, which photos (every / picks, rated and labelled / only the one on screen); editing keeps the next photos decoded. Not yet: face detection, AI masks and AI Denoise as background jobs of these settings (they keep their own switches) |
|
||||
@@ -1060,6 +1060,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
| 2026-10-29 | minor | LR-MASK-OBJECTS: an Object / Describe selection's stored grid is enlarged along the photo's edges (fast guided filter of its logits by log luminance, a 1.5-cell window), so a raised Exposure no longer draws an outline around the subject (#3272); existing AI masks are 1–2 px tighter at edges; status unchanged (🟡) |
|
||||
| 2026-10-30 | patch | LR-MASK-COLORRANGE: a colour-range mask keeps its first 64 samples however it is loaded (sidecar `lc:settings`, presets, `develop.merge`, `render --settings`, catalog and history), not only through `mask.add` / `mask.update`, so a document with thousands can't stall a render or lose the GPU device (issue #2556); status unchanged (✅) |
|
||||
| 2026-11-01 | minor | LRC-LIB-CATALOG-IMPORT: Lightroom catalog backup `.zip` files import directly (streamed into a temporary folder in the library, deleted after reading); Open Library recognises `Backups/` and its dated folders; collections are matched by the catalog's `Adobe_storeProviderID` (issue #2592); status unchanged (🟡) |
|
||||
| 2026-10-23 | minor | LR-BEHAV-SIDEBAR-SECTIONS: a click on a tree row's triangle with Option (Alt) held opens or folds the row and all the rows inside it, for the session; status unchanged (✅) |
|
||||
| 2026-10-20 | patch | LR-PRE-PANEL, LR-PRE-AMOUNT: a preset changes only the settings it names; each is measured from the photo's import look when one is recorded, otherwise from its current value (issue #2159). Statuses and feature counts unchanged. |
|
||||
| 2026-10-17 | minor | LR-EXP-DIALOG: built-in export presets for the issue #2104 delivery targets — Instagram Feed (1080 px, screen sharpening), Instagram Story / Reel (1920 px), Web / Portfolio (2048 px, copyright-only metadata), Full Resolution Master (full size, Display P3, quality 95); LR-EXP-PREVIOUS drops its stale "no named export presets yet" note; status unchanged (✅) |
|
||||
| 2026-10-17 | minor | LR-EXP-DIALOG: built-in export presets for the issue #2104 delivery targets — Instagram Feed (1080 px, screen sharpening), Instagram Story / Reel (1920 px), Web / Portfolio (2048 px, copyright and creator metadata), Full Resolution Master (full size, Display P3, quality 95); LR-EXP-PREVIOUS drops its stale "no named export presets yet" note; status unchanged (✅) |
|
||||
@@ -1067,3 +1068,5 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
| 2026-10-31 | patch | LRC-LIB-VISUALSEARCH: Find Similar Photos reads the photos on a worker thread under an activity row with ✕ instead of on the UI thread, where a large library left the window not responding (#3468). A stopped search leaves the view as it was and keeps what it read; a control request gets the same `{photos}` when the search ends. |
|
||||
| 2026-10-27 | patch | LR-BEHAV-LOCALE: the Edit menu loses its Language submenu (18 rows); Settings ▸ General ▸ Language, which already lists every language, is the one place to choose; the `app.language.*` commands stay for agents; status counts unchanged |
|
||||
| 2026-10-24 | minor | LRC-LIB-SMARTCOLL: the rule editor reorders rules and groups (a grip on each row: drag, or Tab and the arrow keys), in every locale. Status and summary counts unchanged. |
|
||||
| 2026-10-17 | minor | LR-VIEW-FILMSTRIP, LR-LIB-VIRTUALCOPY, LR-LIB-STACK, LR-LIB-LABEL, LRC-LIB-MISSING: one thumbnail overlay for the justified grid, the square grid and the filmstrip (`thumb.rs`): the filmstrip gains the copy tag, a clickable stack badge, the placeholder, the failure mark and the label dot; the failure mark explains itself on hover; the justified grid's tinted label footer is gone; marks degrade on narrow thumbnails; the rating is read out without an English plural; statuses unchanged (✅) |
|
||||
| 2026-10-17 | minor | LR-PREF-INTERFACE: grid badges set to Stars on hover (the default, formerly "When rated or hovered") keep flags and colour labels on every tile but show the stars and the edited mark only on the hovered or selected photo (before, any rated photo wore the whole badge bar); Always / Never unchanged; status unchanged (✅) |
|
||||
+36
-1
@@ -305,7 +305,7 @@
|
||||
|
||||
### The photo in Detail is named with its file for screen readers
|
||||
- With VoiceOver, the photo in Detail view is now announced with its file name, rating, flag and colour label ("Photo:
|
||||
IMG_0042.JPG, 4 stars, picked") instead of only "Photo", as the grid names the same photo.
|
||||
IMG_0042.JPG, rating 4 of 5, picked") instead of only "Photo", as the grid names the same photo.
|
||||
|
||||
### The grid's thumbnail size slider is a slider to screen readers
|
||||
- With VoiceOver, the Thumbnail size control at the right of the grid's bottom bar is now announced as a slider with its
|
||||
@@ -588,6 +588,19 @@
|
||||
server's files written there; it is now refused. Each file is saved complete or not at all, and replaces whatever
|
||||
is in its place instead of writing through a link to somewhere else.
|
||||
|
||||
### Open or fold a whole branch of the sidebar
|
||||
- Hold Option (Alt on Windows and Linux) and click a row's triangle in the left sidebar to open or fold that row
|
||||
and all the rows inside it, however many: a folder of albums with the folders in it, a folder of the library
|
||||
down to its last folder, a keyword with the keywords inside it, a year with its months. A plain click still
|
||||
opens or folds the one row.
|
||||
- What you open or fold inside it afterwards holds for that row. A folder that appears inside it later is as
|
||||
the last Option-click on a row above it left the rest.
|
||||
- In Local, Option-click folds everything inside the folder; opening opens the one folder (opening them all
|
||||
would read every folder inside from the disk).
|
||||
- The sidebar's rows are not remembered between sessions, so a branch opened or folded this way starts again as
|
||||
the sidebar starts.
|
||||
- For scripts: `ui.clickWidget` takes `alt: true` for this click.
|
||||
|
||||
### Videos in the grid are no longer sent to the image decoders
|
||||
- A video in the library (an MP4 or MOV brought in from a Lightroom catalog) no longer asks the image decoders for a
|
||||
grid thumbnail (issue #2682). They can't read one, so each video failed with "unrecognised image format", showed a
|
||||
@@ -853,6 +866,12 @@
|
||||
the full count took about 14 s instead of about 23 s on a heavily loaded machine; the rest is the text rules of
|
||||
the albums themselves. The counts are the same as before, including for albums that loop through each other.
|
||||
|
||||
### Cleaner thumbnails in the grid
|
||||
- With Settings ▸ Interface ▸ Grid ▸ Ratings & flags set to Stars on hover (the default, which used to read "When rated
|
||||
or hovered"), a photo now shows its stars and its edited mark only while the pointer is on it or it is selected.
|
||||
Before, every rated photo wore the badge bar, which in a mostly rated library made it look like Always. Pick and
|
||||
reject flags and colour labels stay on every thumbnail. Always and Never work as before.
|
||||
|
||||
### Selection rings you can see in the light themes
|
||||
- The active photo's white outline vanished on Silver and Paper's light grid, and told the active photo from the other
|
||||
selected ones by lightness alone. Now the active photo has a heavier ring (3 pt, with a thin line against the photo so
|
||||
@@ -881,6 +900,22 @@
|
||||
in Recently Deleted apart, since they are restored and their files stay where they are: "Move 2 Photos · Restore 1
|
||||
Photo".
|
||||
|
||||
### The same marks on every thumbnail
|
||||
- The filmstrip's thumbnails now carry what the grid's do: a virtual copy has its "Copy N" tag, so a copy and its
|
||||
master tell apart; the stack badge can be clicked to expand or collapse the stack, with the same tooltip (now
|
||||
translated); the colour label is a dot, and the grid's photo-shaped placeholder stands in until the picture is drawn.
|
||||
- A thumbnail that can't be drawn shows a warning icon instead of a bare "!". Hover it to read why, and where to go:
|
||||
right-click ▸ Locate Missing File… when the original is gone, Reload from Disk otherwise.
|
||||
- In the Photo Grid a colour label is no longer a tinted band over the bottom of the picture; it is the dot in the
|
||||
row of marks, as in the Square Grid and the filmstrip.
|
||||
- On a narrow thumbnail (a portrait photo at the smallest size) the marks no longer run over the photo's edge: the
|
||||
copy tag drops its name, the edited mark goes, five stars become one star and the number, and what still doesn't fit is left out;
|
||||
the stack badge sheds its icon and then the "1/" of "1/12". Nothing is painted outside the photo. The Preview pill sits
|
||||
above the marks on the filmstrip too, and steps aside for the stack badge. In the Photo Grid, which has no tinted
|
||||
surround, the label dot is kept before the stars on a narrow photo and stays when ratings and flags are turned off.
|
||||
- The filmstrip now dims rejected photos as the grid does, and in the grid the dim sits under the marks, so the red
|
||||
reject flag stays clear. Right-clicking the stack badge opens the photo's menu.
|
||||
- Screen readers say "rating 3 of 5" in every language, instead of building "stars" from an English plural.
|
||||
|
||||
### Sharper resampling in HDR and panorama merges
|
||||
- Merged photos (HDR and panorama) are resampled with a sharper filter (Lanczos-3 instead of bilinear). Moving a
|
||||
|
||||
Reference in new issue
Block a user