Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Merge upstream/main (8d840eab) into Layers Panel options

abc2cba40b95f2506a
diff --cc crates/ui-egui/src/i18n/de.tsv
index 4a6673abc,05ac77803..2609ff88d
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@@ -2670,26 -2676,8 +2676,27 @@@ cameraData Lens Objekti
Snap to Origin An Ursprung ausrichten
Search settings… Einstellungen durchsuchen…
No matching settings Keine passenden Einstellungen
+ Animation Options Animationsoptionen
+ Entire Document Gesamtes Dokument
+ Filter Options Filteroptionen
+ Layer Bounds Ebenenbegrenzungen
+ Layers Panel Options Optionen des Ebenenbedienfelds
+ Lock Layers Ebenen sperren
+ New Artboard… Neue Zeichenfläche…
+ New Group… Neue Gruppe…
+ New Layer… Neue Ebene…
+ Panel Options… Bedienfeldoptionen…
+ Prevent Auto-Nesting Automatisches Verschachteln verhindern
+ Show Layers Ebenen einblenden
+ Thumbnail Contents Miniaturinhalt
+ Thumbnail Size Miniaturgröße
+ Expand New Effects Neue Effekte aufklappen
+ Add “copy” to Copied Layers and Groups „Kopie“ zu kopierten Ebenen und Gruppen hinzufügen
+ Preview on canvas when reordering layers Vorschau auf der Arbeitsfläche beim Neuanordnen von Ebenen
+ Show layer mask badges Ebenenmasken-Abzeichen anzeigen
+
Loading fonts… Schriften werden geladen…
+ Response curve Reaktionskurve
Tool Werkzeug
Simulate Pressure Druck simulieren
Stroke Path… Pfad nachziehen…
diff --cc crates/ui-egui/src/i18n/el.tsv
index 90149aea4,c6c5ff8f6..1b7d7ad51
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@@ -3726,23 -3732,8 +3732,24 @@@ cameraData Lens Φακό�
Snap to Origin Προσκόλληση στην αρχή
Search settings… Αναζήτηση ρυθμίσεων…
No matching settings Δεν βρέθηκαν ρυθμίσεις
+ Animation Options Επιλογές κίνησης
+ Entire Document Ολόκληρο έγγραφο
+ Filter Options Επιλογές φίλτρου
+ Layer Bounds Όρια επιπέδου
+ Layers Panel Options Επιλογές πίνακα επιπέδων
+ New Artboard… Νέος πίνακας σχεδίασης…
+ New Group… Νέα ομάδα…
+ Prevent Auto-Nesting Αποτροπή αυτόματης ένθεσης
+ Show Layers Εμφάνιση επιπέδων
+ Thumbnail Contents Περιεχόμενο μικρογραφιών
+ Thumbnail Size Μέγεθος μικρογραφιών
+ Expand New Effects Ανάπτυξη νέων εφέ
+ Add “copy” to Copied Layers and Groups Προσθήκη «αντίγραφο» σε αντιγραμμένα επίπεδα και ομάδες
+ Preview on canvas when reordering layers Προεπισκόπηση στον καμβά κατά την αναδιάταξη επιπέδων
+ Show layer mask badges Εμφάνιση σημάτων μασκών επιπέδου
+
Loading fonts… Φόρτωση γραμματοσειρών…
+ Response curve Καμπύλη απόκρισης
Simulate Pressure Προσομοίωση πίεσης
Stroke Path… Περίγραμμα διαδρομής…
Background Eraser Γόμα φόντου
diff --cc crates/ui-egui/src/i18n/es.tsv
index fbdad2880,e24171195..164b53361
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@@ -2711,26 -2718,8 +2718,27 @@@ cameraData Lens Objetiv
Snap to Origin Ajustar a origen
Search settings… Buscar ajustes…
No matching settings No hay ajustes que coincidan
+ Animation Options Opciones de animación
+ Entire Document Documento entero
+ Filter Options Opciones de filtro
+ Layer Bounds Límites de capa
+ Layers Panel Options Opciones del panel Capas
+ Lock Layers Bloquear capas
+ New Artboard… Nueva mesa de trabajo…
+ New Group… Nuevo grupo…
+ New Layer… Nueva capa…
+ Panel Options… Opciones de panel…
+ Prevent Auto-Nesting Impedir anidación automática
+ Show Layers Mostrar capas
+ Thumbnail Contents Contenido de miniaturas
+ Thumbnail Size Tamaño de miniaturas
+ Expand New Effects Expandir nuevos efectos
+ Add “copy” to Copied Layers and Groups Añadir «copia» a las capas y grupos duplicados
+ Preview on canvas when reordering layers Previsualizar en el lienzo al reordenar capas
+ Show layer mask badges Mostrar insignias de máscaras de capa
+
Loading fonts… Cargando fuentes…
+ Response curve Curva de respuesta
Tool Herramienta
Simulate Pressure Simular presión
Stroke Path… Contornear trazado…
diff --cc crates/ui-egui/src/i18n/fr.tsv
index 9aaa7e74d,db40d97ab..03e9109dd
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@@ -3045,24 -3052,8 +3052,25 @@@ cameraData Lens Objecti
Snap to Origin Aligner sur l'origine
Search settings… Rechercher des réglages…
No matching settings Aucun réglage correspondant
+ Animation Options Options d’animation
+ Entire Document Document entier
+ Filter Options Options de filtrage
+ Layer Bounds Limites du calque
+ Layers Panel Options Options du panneau Calques
+ Lock Layers Verrouiller les calques
+ New Artboard… Nouveau plan de travail…
+ New Group… Nouveau groupe…
+ Prevent Auto-Nesting Empêcher l’imbrication automatique
+ Show Layers Afficher les calques
+ Thumbnail Contents Contenu des vignettes
+ Thumbnail Size Taille des vignettes
+ Expand New Effects Développer les nouveaux effets
+ Add “copy” to Copied Layers and Groups Ajouter « copie » aux calques et groupes dupliqués
+ Preview on canvas when reordering layers Prévisualiser sur la zone de travail lors du réagencement des calques
+ Show layer mask badges Afficher les badges des masques de fusion
+
Loading fonts… Chargement des polices…
+ Response curve Courbe de réponse
Tool Outil
Simulate Pressure Simuler la pression
Stroke Path… Contourner le tracé…
diff --cc crates/ui-egui/src/i18n/hu.tsv
index ea8222bc8,0404b429c..4aff6d731
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@@ -4058,20 -4074,23 +4074,40 @@@ cameraRaw Yellow Sárg
Ink Characteristics Festék jellemzői
Solidity: Fedőképesség:
Redrawing Újrarajzolás
+ # Embedded Profile Mismatch: profile names beside the choices, Remember this choice
+ Use the embedded profile ({profile}) A beágyazott profil használata ({profile})
+ Convert to the working space ({profile}) Átalakítás a munkaszíntérbe ({profile})
+ Remember this choice for future images A választás megjegyzése a későbbi képekhez
+ Turn the prompt back on with Ask On Mismatch in Edit › Color Settings. A kérdés a Szerkesztés › Színbeállítások Ask On Mismatch beállításával kapcsolható vissza.
+ Button Mode Gomb mód
+ Button Mode On Gomb mód be
+
+ # Darken / Lighten Interface (⇧⌘F1 / ⇧⌘F2)
+ Darken Interface Felület sötétítése
+ Lighten Interface Felület világosítása
+ # Bevel & Emboss Technique.
+ Technique Technika
+ Chisel Hard Kemény vésés
+ Chisel Soft Lágy vésés
+ Open color-less EXR as ACEScg Színinformáció nélküli EXR megnyitása ACEScg-ként
+
+ # View › Guides › right-click a guide
+ Edit Selected Guides Kijelölt segédvonalak szerkesztése
+ Clear Selected Guides Kijelölt segédvonalak törlése
+
+# Layers panel options and Smart Filter editors
+ Add “copy” to Copied Layers and Groups „másolat” hozzáadása a másolt rétegekhez és csoportokhoz
+ Animation Options Animációs beállítások
+ Entire Document Teljes dokumentum
+ Expand New Effects Új effektusok kibontása
+ Filter Options Szűrési beállítások
+ Layer Bounds Réteghatárok
+ Layers Panel Options Rétegek panel beállításai
+ New Artboard… Új rajztábla…
+ New Group… Új csoport…
+ Prevent Auto-Nesting Automatikus beágyazás tiltása
+ Preview on canvas when reordering layers Előnézet a vásznon a rétegek átrendezésekor
+ Show Layers Rétegek megjelenítése
+ Show layer mask badges Rétegmaszk-jelvények megjelenítése
+ Thumbnail Contents Bélyegkép tartalma
+ Thumbnail Size Bélyegképméret
diff --cc crates/ui-egui/src/i18n/id.tsv
index 090ddc734,544ead05a..5b0b148fe
--- a/crates/ui-egui/src/i18n/id.tsv
+++ b/crates/ui-egui/src/i18n/id.tsv
@@@ -3032,24 -3039,8 +3039,25 @@@ cameraData Lens Lens
Snap to Origin Jepret ke Titik Asal
Search settings… Cari pengaturan…
No matching settings Tidak ada pengaturan yang cocok
+ Animation Options Opsi Animasi
+ Entire Document Seluruh Dokumen
+ Filter Options Opsi Filter
+ Layer Bounds Batas Lapisan
+ Layers Panel Options Opsi Panel Lapisan
+ Lock Layers Kunci Lapisan
+ New Artboard… Artboard Baru…
+ New Group… Grup Baru…
+ Prevent Auto-Nesting Cegah Pengelompokan Otomatis
+ Show Layers Tampilkan Lapisan
+ Thumbnail Contents Isi Gambar Mini
+ Thumbnail Size Ukuran Gambar Mini
+ Expand New Effects Perluas Efek Baru
+ Add “copy” to Copied Layers and Groups Tambahkan “salinan” ke Lapisan dan Grup yang Disalin
+ Preview on canvas when reordering layers Pratinjau pada kanvas saat mengurutkan ulang lapisan
+ Show layer mask badges Tampilkan Lencana Masker Lapisan
+
Loading fonts… Memuat font…
+ Response curve Kurva respons
Tool Alat
Simulate Pressure Simulasikan Tekanan
Stroke Path… Stroke Path…
diff --cc crates/ui-egui/src/i18n/it.tsv
index 44b9f70eb,40b468926..424e48a97
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@@ -2699,23 -2706,8 +2706,24 @@@ cameraData Lens Obiettiv
Snap to Origin Aggancia all'origine
Search settings… Cerca impostazioni…
No matching settings Nessuna impostazione corrispondente
+ Animation Options Opzioni animazione
+ Entire Document Documento intero
+ Filter Options Opzioni filtro
+ Layer Bounds Limiti livello
+ Layers Panel Options Opzioni pannello Livelli
+ New Artboard… Nuova tavola da disegno…
+ New Group… Nuovo gruppo…
+ Prevent Auto-Nesting Impedisci annidamento automatico
+ Show Layers Mostra livelli
+ Thumbnail Contents Contenuto miniature
+ Thumbnail Size Dimensione miniature
+ Expand New Effects Espandi nuovi effetti
+ Add “copy” to Copied Layers and Groups Aggiungi «copia» ai livelli e ai gruppi duplicati
+ Preview on canvas when reordering layers Anteprima sulla tela durante il riordino dei livelli
+ Show layer mask badges Mostra distintivi delle maschere di livello
+
Loading fonts… Caricamento font…
+ Response curve Curva di risposta
Tool Strumento
Simulate Pressure Simula pressione
Stroke Path… Traccia tracciato…
diff --cc crates/ui-egui/src/i18n/ja.tsv
index 4ce3c8da6,1d64bf868..162b35eff
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@@ -3640,23 -3647,8 +3647,24 @@@ cameraData Lens レン�
Snap to Origin 原点にスナップ
Search settings… 設定を検索…
No matching settings 一致する設定はありません
+ Animation Options アニメーションオプション
+ Entire Document ドキュメント全体
+ Filter Options フィルターオプション
+ Layer Bounds レイヤーの境界
+ Layers Panel Options レイヤーパネルオプション
+ New Artboard… 新規アートボード…
+ New Group… 新規グループ…
+ Prevent Auto-Nesting 自動的な入れ子を防ぐ
+ Show Layers レイヤーを表示
+ Thumbnail Contents サムネールの内容
+ Thumbnail Size サムネールのサイズ
+ Expand New Effects 新しい効果を展開
+ Add “copy” to Copied Layers and Groups コピーしたレイヤーとグループの名前に「コピー」を追加
+ Preview on canvas when reordering layers レイヤーの並べ替え時にカンバスでプレビュー
+ Show layer mask badges レイヤーマスクのバッジを表示
+
Loading fonts… フォントを読み込み中…
+ Response curve 応答カーブ
Simulate Pressure 筆圧をシミュレート
Stroke Path… パスのストローク…
Background Eraser 背景消しゴム
diff --cc crates/ui-egui/src/i18n/ko.tsv
index 3d1f8f5b5,e76a3c982..dcb32120b
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@@ -3214,26 -3220,8 +3220,27 @@@ cameraData Lens 렌�
Snap to Origin 원점에 스냅
Search settings… 설정 검색…
No matching settings 일치하는 설정 없음
+ Animation Options 애니메이션 옵션
+ Entire Document 전체 문서
+ Filter Options 필터 옵션
+ Layer Bounds 레이어 경계
+ Layers Panel Options 레이어 패널 옵션
+ New Artboard… 새 아트보드…
+ New Group 새 그룹
+ New Group… 새 그룹…
+ New Layer… 새 레이어…
+ Panel Options… 패널 옵션…
+ Prevent Auto-Nesting 자동 중첩 방지
+ Show Layers 레이어 표시
+ Thumbnail Contents 축소판 내용
+ Thumbnail Size 축소판 크기
+ Expand New Effects 새 효과 펼치기
+ Add “copy” to Copied Layers and Groups 복사한 레이어 및 그룹에 “복사” 추가
+ Preview on canvas when reordering layers 레이어 순서 변경 시 캔버스에서 미리보기
+ Show layer mask badges 레이어 마스크 배지 표시
+
Loading fonts… 글꼴 불러오는 중…
+ Response curve 응답 곡선
Simulate Pressure 압력 시뮬레이션
Stroke Path… 패스 획…
Background Eraser 배경 지우개
diff --cc crates/ui-egui/src/i18n/nl.tsv
index 583b11506,2c9416c70..e106f188b
--- a/crates/ui-egui/src/i18n/nl.tsv
+++ b/crates/ui-egui/src/i18n/nl.tsv
@@@ -3785,23 -3791,8 +3791,24 @@@ cameraData Lens Len
Search settings… Instellingen zoeken…
No matching settings Geen overeenkomende instellingen
PhotoCraft — Screen Color Picker PhotoCraft — Schermkleurkiezer
+ Animation Options Animatieopties
+ Entire Document Hele document
+ Filter Options Filteropties
+ Layer Bounds Laaggrenzen
+ Layers Panel Options Opties van het deelvenster Lagen
+ New Artboard… Nieuw tekengebied…
+ New Group… Nieuwe groep…
+ Prevent Auto-Nesting Automatisch nesten voorkomen
+ Show Layers Lagen tonen
+ Thumbnail Contents Inhoud van miniaturen
+ Thumbnail Size Grootte van miniaturen
+ Expand New Effects Nieuwe effecten uitvouwen
+ Add “copy” to Copied Layers and Groups „kopie” toevoegen aan gekopieerde lagen en groepen
+ Preview on canvas when reordering layers Voorvertoning op canvas bij herschikken van lagen
+ Show layer mask badges Badges voor laagmaskers tonen
+
Loading fonts… Lettertypen laden…
+ Response curve Responscurve
Simulate Pressure Druk simuleren
Stroke Path… Pad omlijnen…
Background Eraser Achtergrondgum
diff --cc crates/ui-egui/src/i18n/pl.tsv
index 374608b97,eee1e61a9..80739808b
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@@ -3643,23 -3649,8 +3649,24 @@@ cameraData Lens Obiekty
Snap to Origin Przyciągnij do początku
Search settings… Szukaj ustawień…
No matching settings Brak pasujących ustawień
+ Animation Options Opcje animacji
+ Entire Document Cały dokument
+ Filter Options Opcje filtrowania
+ Layer Bounds Granice warstwy
+ Layers Panel Options Opcje panelu Warstwy
+ New Artboard… Nowy obszar roboczy…
+ New Group… Nowa grupa…
+ Prevent Auto-Nesting Zapobiegaj automatycznemu zagnieżdżaniu
+ Show Layers Pokaż warstwy
+ Thumbnail Contents Zawartość miniaturek
+ Thumbnail Size Rozmiar miniaturek
+ Expand New Effects Rozwijaj nowe efekty
+ Add “copy” to Copied Layers and Groups Dodawaj „kopia” do skopiowanych warstw i grup
+ Preview on canvas when reordering layers Podgląd na obszarze roboczym podczas zmiany kolejności warstw
+ Show layer mask badges Pokaż odznaki masek warstw
+
Loading fonts… Wczytywanie czcionek…
+ Response curve Krzywa odpowiedzi
Simulate Pressure Symuluj nacisk
Stroke Path… Obrysuj ścieżkę…
Background Eraser Gumka tła
diff --cc crates/ui-egui/src/i18n/pt-br.tsv
index 0d340365a,3e10fe7db..4809a8abc
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@@ -3049,23 -3055,8 +3055,24 @@@ cameraData Lens Lent
Snap to Origin Ajustar à origem
Search settings… Pesquisar configurações…
No matching settings Nenhuma configuração encontrada
+ Animation Options Opções de animação
+ Entire Document Documento inteiro
+ Filter Options Opções de filtro
+ Layer Bounds Limites da camada
+ Layers Panel Options Opções do painel Camadas
+ New Artboard… Nova prancheta…
+ New Group… Novo grupo…
+ Prevent Auto-Nesting Impedir aninhamento automático
+ Show Layers Mostrar camadas
+ Thumbnail Contents Conteúdo das miniaturas
+ Thumbnail Size Tamanho das miniaturas
+ Expand New Effects Expandir novos efeitos
+ Add “copy” to Copied Layers and Groups Adicionar “cópia” às camadas e grupos copiados
+ Preview on canvas when reordering layers Pré-visualizar na tela ao reordenar camadas
+ Show layer mask badges Mostrar emblemas de máscaras de camada
+
Loading fonts… Carregando fontes…
+ Response curve Curva de resposta
Tool Ferramenta
Simulate Pressure Simular pressão
Stroke Path… Traçar demarcador…
diff --cc crates/ui-egui/src/i18n/ru.tsv
index e56b83d55,862788630..e87579840
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@@ -2968,24 -2976,8 +2976,25 @@@ cameraData Lens Объекти�
Rasterize Layer Style Растрировать стиль слоя
Search settings… Поиск настроек…
No matching settings Нет подходящих настроек
+ Animation Options Параметры анимации
+ Entire Document Весь документ
+ Filter Options Параметры фильтра
+ Layer Bounds Границы слоя
+ Layers Panel Options Параметры панели «Слои»
+ Lock Layers Блокировка слоёв
+ New Artboard… Новая монтажная область…
+ New Group… Новая группа…
+ Prevent Auto-Nesting Запретить автоматическое вложение
+ Show Layers Показать слои
+ Thumbnail Contents Содержимое миниатюр
+ Thumbnail Size Размер миниатюр
+ Expand New Effects Раскрывать новые эффекты
+ Add “copy” to Copied Layers and Groups Добавлять «копия» к дублированным слоям и группам
+ Preview on canvas when reordering layers Предпросмотр на холсте при изменении порядка слоёв
+ Show layer mask badges Показывать значки типов масок слоя
+
Loading fonts… Загрузка шрифтов…
+ Response curve Кривая отклика
Tool Инструмент
Simulate Pressure Имитировать нажим
Stroke Path… Обвести контур…
diff --cc crates/ui-egui/src/i18n/sr.tsv
index 33246ab96,b91b67b3e..41a2f6839
--- a/crates/ui-egui/src/i18n/sr.tsv
+++ b/crates/ui-egui/src/i18n/sr.tsv
@@@ -4211,20 -4226,25 +4226,42 @@@ shape Appearance Izgle
Ink Characteristics Karakteristike mastila
Solidity: Punoća:
Redrawing Ponovno iscrtavanje
+ Response curve Kriva odziva
+ # Embedded Profile Mismatch: profile names beside the choices, Remember this choice
+ Use the embedded profile ({profile}) Koristi ugrađeni profil ({profile})
+ Convert to the working space ({profile}) Pretvori u radni prostor ({profile})
+ Remember this choice for future images Zapamti ovaj izbor za buduće slike
+ Turn the prompt back on with Ask On Mismatch in Edit › Color Settings. Pitanje ponovo uključite opcijom Ask On Mismatch u Uređivanje › Podešavanja boja.
+ Button Mode Režim dugmadi
+ Button Mode On Režim dugmadi uključen
+
+ # Darken / Lighten Interface (⇧⌘F1 / ⇧⌘F2)
+ Darken Interface Zatamni interfejs
+ Lighten Interface Posvetli interfejs
+ # Bevel & Emboss Technique.
+ Technique Tehnika
+ Chisel Hard Tvrdo klesanje
+ Chisel Soft Meko klesanje
+ Open color-less EXR as ACEScg Otvori EXR bez podatka o bojama kao ACEScg
+ Show home recent files Prikaži nedavne datoteke na početnom ekranu
+
+ # View › Guides › right-click a guide
+ Edit Selected Guides Uredi izabrane vodilje
+ Clear Selected Guides Ukloni izabrane vodilje
+
+# Layers panel options
+ Add “copy” to Copied Layers and Groups Dodaj „kopija” kopiranim slojevima i grupama
+ Animation Options Opcije animacije
+ Entire Document Ceo dokument
+ Expand New Effects Proširi nove efekte
+ Filter Options Opcije filtera
+ Layer Bounds Granice sloja
+ Layers Panel Options Opcije panela Slojevi
+ New Artboard… Nova radna tabla…
+ New Group… Nova grupa…
+ Prevent Auto-Nesting Spreči automatsko ugnežđavanje
+ Preview on canvas when reordering layers Pregled na platnu pri promeni redosleda slojeva
+ Show Layers Prikaži slojeve
+ Show layer mask badges Prikaži oznake maske sloja
+ Thumbnail Contents Sadržaj sličice
+ Thumbnail Size Veličina sličice
diff --cc crates/ui-egui/src/i18n/tr.tsv
index f00ad246d,4c8f06ccc..261ac3c89
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@@ -3869,20 -3885,23 +3885,40 @@@ cameraData Lens Len
Ink Characteristics Mürekkep Özellikleri
Solidity: Doluluk:
Redrawing Yeniden çiziliyor
+ # Embedded Profile Mismatch: profile names beside the choices, Remember this choice
+ Use the embedded profile ({profile}) Gömülü profili kullanın ({profile})
+ Convert to the working space ({profile}) Çalışma alanına dönüştürün ({profile})
+ Remember this choice for future images Bu seçimi sonraki görüntüler için hatırla
+ Turn the prompt back on with Ask On Mismatch in Edit › Color Settings. Soruyu Düzen › Renk Ayarları'ndaki Ask On Mismatch ile yeniden açabilirsiniz.
+ Button Mode Düğme modu
+ Button Mode On Düğme modu açık
+
+ # Darken / Lighten Interface (⇧⌘F1 / ⇧⌘F2)
+ Darken Interface Arayüzü koyulaştır
+ Lighten Interface Arayüzü açıklaştır
+ # Bevel & Emboss Technique.
+ Technique Teknik
+ Chisel Hard Sert Keski
+ Chisel Soft Yumuşak Keski
+ Open color-less EXR as ACEScg Renk bilgisi olmayan EXR'yi ACEScg olarak aç
+
+ # View › Guides › right-click a guide
+ Edit Selected Guides Seçili Kılavuzları Düzenle
+ Clear Selected Guides Seçili Kılavuzları Temizle
+
+# Layers panel options and Smart Filter editors
+ Add “copy” to Copied Layers and Groups Kopyalanan Katman ve Gruplara “kopya” Ekle
+ Animation Options Animasyon Seçenekleri
+ Entire Document Tüm Belge
+ Expand New Effects Yeni Efektleri Genişlet
+ Filter Options Filtre Seçenekleri
+ Layer Bounds Katman Sınırları
+ Layers Panel Options Katmanlar Paneli Seçenekleri
+ New Artboard… Yeni Çalışma Yüzeyi…
+ New Group… Yeni Grup…
+ Prevent Auto-Nesting Otomatik Yerleştirmeyi Önle
+ Preview on canvas when reordering layers Katmanları yeniden sıralarken kanvasta önizle
+ Show Layers Katmanları Göster
+ Show layer mask badges Katman maskesi rozetlerini göster
+ Thumbnail Contents Küçük Resim İçeriği
+ Thumbnail Size Küçük Resim Boyutu
diff --cc crates/ui-egui/src/i18n/uk.tsv
index 9793ba212,39597c15c..4dcec9f3c
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@@ -3717,23 -3723,8 +3723,24 @@@ cameraData Lens Об'єкти�
Search settings… Пошук налаштувань…
No matching settings Немає відповідних налаштувань
PhotoCraft — Screen Color Picker PhotoCraft — Піпетка кольору екрана
+ Animation Options Параметри анімації
+ Entire Document Увесь документ
+ Filter Options Параметри фільтрів
+ Layer Bounds Межі шару
+ Layers Panel Options Параметри панелі «Шари»
+ New Artboard… Нова монтажна область…
+ New Group… Нова група…
+ Prevent Auto-Nesting Заборонити автоматичне вкладення
+ Show Layers Показати шари
+ Thumbnail Contents Вміст мініатюр
+ Thumbnail Size Розмір мініатюр
+ Expand New Effects Розгортати нові ефекти
+ Add “copy” to Copied Layers and Groups Додавати «копія» до скопійованих шарів і груп
+ Preview on canvas when reordering layers Попередній перегляд на полотні під час зміни порядку шарів
+ Show layer mask badges Показувати позначки масок шарів
+
Loading fonts… Завантаження шрифтів…
+ Response curve Крива відгуку
Simulate Pressure Імітувати натиск
Stroke Path… Обвести контур…
Background Eraser Фонова гумка
diff --cc crates/ui-egui/src/i18n/vi.tsv
index 7abfa340b,ac7123d85..d6c44cabb
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@@ -3623,22 -3633,31 +3633,49 @@@ curves Smooth Làm mượ
Import .GRD Nhập .GRD
Choose a gradient file (.grd). Chọn tệp chuyển sắc (.grd).
Auto Add/Delete Tự động thêm/xóa
+
+ # Native Windows printing qualification
+ Don't also tick Mirror Image in Print Settings…: the two flips cancel out. Đừng bật thêm Ảnh phản chiếu trong thiết lập in: hai lần lật sẽ triệt tiêu nhau.
+ Print Settings… Thiết lập in…
+ Remember to turn off the printer's own colour management in Print Settings… Nhớ tắt quản lý màu riêng của máy in trong thiết lập in…
+ Sent to {printer} Đã gửi tới {printer}
+ set in Print Settings… đặt trong thiết lập in…
ICO is limited to 256 × 256 pixels ICO giới hạn ở 256 × 256 pixel
+ # Embedded Profile Mismatch: profile names beside the choices, Remember this choice
+ Use the embedded profile ({profile}) Dùng hồ sơ nhúng ({profile})
+ Convert to the working space ({profile}) Chuyển sang không gian làm việc ({profile})
+ Remember this choice for future images Ghi nhớ lựa chọn này cho các ảnh sau
+ Turn the prompt back on with Ask On Mismatch in Edit › Color Settings. Bật lại câu hỏi bằng Ask On Mismatch trong Chỉnh sửa › Cài đặt màu.
+ Button Mode Chế độ nút
+ Button Mode On Chế độ nút bật
+
+ # Darken / Lighten Interface (⇧⌘F1 / ⇧⌘F2)
+ Darken Interface Làm tối giao diện
+ Lighten Interface Làm sáng giao diện
+ # Bevel & Emboss Technique.
+ Technique Kỹ thuật
+ Chisel Hard Đục cứng
+ Chisel Soft Đục mềm
+ Open color-less EXR as ACEScg Mở EXR không khai báo màu sắc dưới dạng ACEScg
+
+ # View › Guides › right-click a guide
+ Edit Selected Guides Sửa đường căn đã chọn
+ Clear Selected Guides Xóa đường căn đã chọn
+
+# Layers panel options and Smart Filter editors
+ Add “copy” to Copied Layers and Groups Thêm “bản sao” vào lớp và nhóm được sao chép
+ Animation Options Tùy chọn hoạt ảnh
+ Entire Document Toàn bộ tài liệu
+ Expand New Effects Mở rộng hiệu ứng mới
+ Filter Options Tùy chọn bộ lọc
+ Layer Bounds Đường biên lớp
+ Layers Panel Options Tùy chọn bảng Lớp
+ New Artboard… Bảng vẽ mới…
+ New Group… Nhóm mới…
+ Panel Options… Tùy chọn bảng…
+ Prevent Auto-Nesting Chặn tự lồng
+ Preview on canvas when reordering layers Xem trước trên Canvas khi sắp xếp lại lớp
+ Show Layers Hiện các lớp
+ Show layer mask badges Hiện huy hiệu mặt nạ lớp
+ Thumbnail Contents Nội dung hình thu nhỏ
+ Thumbnail Size Kích thước hình thu nhỏ
diff --cc crates/ui-egui/src/i18n/zh-hans.tsv
index 69f1ed082,2307739ed..83611f652
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@@ -2641,27 -2648,8 +2648,28 @@@ cameraData Lens 镜�
Snap to Origin 贴紧原点
Search settings… 搜索设置…
No matching settings 没有匹配的设置
+ Animation Options 动画选项
+ Entire Document 整个文档
+ Filter Options 过滤选项
+ Layer Bounds 图层边界
+ Layers Panel Options 图层面板选项
+ Lock Layers 锁定图层
+ New Artboard… 新建画板…
+ New Group 新建组
+ New Group… 新建组…
+ New Layer… 新建图层…
+ Panel Options… 面板选项…
+ Prevent Auto-Nesting 防止自动嵌套
+ Show Layers 显示图层
+ Thumbnail Contents 缩略图内容
+ Thumbnail Size 缩略图大小
+ Expand New Effects 展开新效果
+ Add “copy” to Copied Layers and Groups 为复制的图层和组添加“副本”
+ Preview on canvas when reordering layers 重新排列图层时在画布上预览
+ Show layer mask badges 显示图层蒙版标记
+
Loading fonts… 正在加载字体…
+ Response curve 响应曲线
Tool 工具
Simulate Pressure 模拟压力
Stroke Path… 描边路径…
diff --cc crates/ui-egui/src/i18n/zh-hant.tsv
index 9e2e2fcf2,478489f8c..3a8725d66
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@@ -2611,27 -2618,8 +2618,28 @@@ cameraData Lens 鏡�
Snap to Origin 靠齊原點
Search settings… 搜尋設定…
No matching settings 沒有符合的設定
+ Animation Options 動畫選項
+ Entire Document 整份文件
+ Filter Options 篩選選項
+ Layer Bounds 圖層邊界
+ Layers Panel Options 圖層面板選項
+ Lock Layers 鎖定圖層
+ New Artboard… 新增工作區域…
+ New Group 新增群組
+ New Group… 新增群組…
+ New Layer… 新增圖層…
+ Panel Options… 面板選項…
+ Prevent Auto-Nesting 防止自動巢狀
+ Show Layers 顯示圖層
+ Thumbnail Contents 縮圖內容
+ Thumbnail Size 縮圖大小
+ Expand New Effects 展開新效果
+ Add “copy” to Copied Layers and Groups 為複製的圖層和群組加上「副本」
+ Preview on canvas when reordering layers 重新排列圖層時在畫布上預覽
+ Show layer mask badges 顯示圖層遮色片標記
+
Loading fonts… 正在載入字體…
+ Response curve 回應曲線
Tool 工具
Simulate Pressure 模擬壓力
Stroke Path… 筆畫路徑…
diff --cc crates/ui-egui/src/layer_row_ui.rs
index 660f1c68d,5a6e60f79..679aae2ea
--- a/crates/ui-egui/src/layer_row_ui.rs
+++ b/crates/ui-egui/src/layer_row_ui.rs
@@@ -195,58 -193,10 +195,60 @@@ pub fn label(painter: &Painter, x: f32
Some(r)
}
-/// The Layers panel's own items at the top of its panel menu (Photoshop's flyout).
+/// Photoshop-style Layers flyout commands. The dock owns tab-group controls, not this menu.
pub fn panel_menu(app: &mut crate::PhotocraftApp, ui: &mut egui::Ui) {
- let can = app.session.is_enabled("layer.setExpanded");
- if ui.add_enabled(can, egui::Button::new(tl!("Collapse All Groups"))).clicked() {
+ use crate::layers_panel_ui::run_menu_command;
+ use crate::state::LayersPanelDialog;
+
+ let has_doc = app.session.active().is_some();
+ if ui.add_enabled(has_doc, egui::Button::new(tl!("New Layer…"))).clicked() {
+ app.ui.layers_panel_dialog = Some(LayersPanelDialog::NewLayer(String::new()));
+ ui.close();
+ }
+ if ui.add_enabled(has_doc, egui::Button::new(tl!("New Group…"))).clicked() {
+ app.ui.layers_panel_dialog = Some(LayersPanelDialog::NewGroup(String::new()));
+ ui.close();
+ }
+ ui.separator();
+ run_menu_command(app, ui, tl!("Flatten Image"), "layer.flattenImage");
+ ui.separator();
+ if ui.add_enabled(app.session.is_enabled("layer.lockLayers"), egui::Button::new(tl!("Lock Layers…"))).clicked() {
+ app.ui.layers_panel_dialog = Some(LayersPanelDialog::LockLayers { transparency: false, pixels: false, position: false, artboard: false, all: true });
+ ui.close();
+ }
+ run_menu_command(app, ui, tl!("Rename Layer…"), "layer.renameLayer");
+ let any_hidden = app.session.active().is_some_and(|st| st.selected_layers().iter().any(|id| st.doc.layer(*id).is_some_and(|l| !l.visible)));
+ if any_hidden {
+ run_menu_command(app, ui, tl!("Show Layers"), "layer.showLayers");
+ } else {
+ run_menu_command(app, ui, tl!("Hide Layers"), "layer.hideLayers");
+ }
+ ui.separator();
+ run_menu_command(app, ui, tl!("New Artboard…"), "layer.new.artboard");
+ ui.separator();
+ ui.menu_button(tl!("Filter Options"), |ui| {
+ let mut show = app.ui.layers_panel_options.show_filters;
+ if ui.checkbox(&mut show, tl!("Show")).changed() {
+ app.ui.layers_panel_options.show_filters = show;
+ crate::layers_panel_ui::persist_options(app);
+ ui.close();
+ }
+ });
+ // Animation Options control Photoshop's frame-unification buttons. PhotoCraft's Layers
+ // panel does not expose those buttons; do not offer nonfunctional toggles.
+ ui.add_enabled_ui(false, |ui| {
+ ui.menu_button(tl!("Animation Options"), |_ui| {});
+ });
+ if ui.button(tl!("Panel Options…")).clicked() {
- app.ui.layers_panel_dialog = Some(LayersPanelDialog::PanelOptions(app.ui.layers_panel_options.clone()));
++ let mut options = app.ui.layers_panel_options.clone();
++ options.thumbnail_contents = crate::layers_panel_ui::thumbnail_contents(app);
++ app.ui.layers_panel_dialog = Some(LayersPanelDialog::PanelOptions(options));
+ ui.close();
+ }
+ ui.separator();
+ // Preserve PhotoCraft's existing group disclosure action when expanding the flyout.
+ let can_collapse = app.session.is_enabled("layer.setExpanded");
+ if ui.add_enabled(can_collapse, egui::Button::new(tl!("Collapse All Groups"))).clicked() {
if let Err(e) = app.run("layer.setExpanded", json!({"all": true, "expanded": false})) {
app.ui.status = e;
app.ui.status_error = true;
diff --cc crates/ui-egui/src/layers_panel_ui.rs
index 43c2df5c0,000000000..ef6bbccf7
mode 100644,000000..100644
--- a/crates/ui-egui/src/layers_panel_ui.rs
+++ b/crates/ui-egui/src/layers_panel_ui.rs
@@@ -1,446 -1,0 +1,444 @@@
+//! Layers panel flyout and display preferences, observed from Photoshop's panel menu.
+//! UI options do not edit document pixels or add history steps.
+use egui::{self, Context, Ui};
- use photocraft_doc::{Document, Layer};
- use photocraft_geom::Rect;
++use photocraft_doc::Document;
+use serde_json::json;
+
+use crate::PhotocraftApp;
+use crate::state::{LayerThumbnailContents, LayerThumbnailSize, LayersPanelDialog, LayersPanelOptions};
+
+const OPTIONS_PREF: &str = "ui.layersPanelOptions";
+
+/// Save independently of Workspace > Remember Workspace Changes, as Photoshop does.
+pub fn persist_options(app: &mut PhotocraftApp) {
+ if let Ok(value) = serde_json::to_value(&app.ui.layers_panel_options) {
+ app.session.prefs.edit(|p| {
+ p.dialogs.insert(OPTIONS_PREF.into(), value);
+ });
+ }
+}
+
+/// Restore independently from a saved workspace. Older preferences retain the defaults.
+pub fn restore_options(app: &mut PhotocraftApp) {
+ if let Some(opts) = app.session.prefs().dialogs.get(OPTIONS_PREF)
+ && let Ok(value) = serde_json::from_value(opts.clone())
+ {
+ app.ui.layers_panel_options = value;
+ }
+}
+
+/// The real menu command dispatcher handles rename's in-place editor and other shell routing.
+pub fn run_menu_command(app: &mut PhotocraftApp, ui: &mut Ui, label: &str, id: &str) {
+ if ui.add_enabled(app.session.is_enabled(id), egui::Button::new(label)).clicked() {
+ let ctx = ui.ctx().clone();
+ if let Err(e) = crate::menus::invoke(app, &ctx, id, json!({})) {
+ app.ui.status = e;
+ app.ui.status_error = true;
+ }
+ ui.close();
+ }
+}
+
- /// Layer Bounds excludes fully transparent pixels and retains the layer's aspect ratio;
- /// fully blank/non-raster layers fall back to document space.
- pub fn thumbnail_region(app: &mut PhotocraftApp, doc: &Document, layer: &Layer, mode: LayerThumbnailContents) -> Rect {
- if mode == LayerThumbnailContents::LayerBounds
- && let Some(surface) = layer.surface()
- {
- let bounds = app.cached_bounds(layer.id.0, surface).intersect(&doc.bounds());
- if !bounds.is_empty() {
- return bounds;
- }
++/// Thumbnail Contents as the shared preference has it: Layer Bounds is Clip Thumbnails to Layer
++/// Bounds (#4281), which frames each layer's pixels instead of the canvas.
++pub fn thumbnail_contents(app: &PhotocraftApp) -> LayerThumbnailContents {
++ if app.session.prefs().interface.clip_thumbnails_to_layer_bounds { LayerThumbnailContents::LayerBounds } else { LayerThumbnailContents::EntireDocument }
++}
++
++/// Panel Options › OK: the panel's own options, and Thumbnail Contents into the shared preference.
++fn apply_options(app: &mut PhotocraftApp, options: LayersPanelOptions) -> Result<(), String> {
++ let contents = options.thumbnail_contents;
++ app.ui.layers_panel_options = options;
++ persist_options(app);
++ if contents == thumbnail_contents(app) {
++ return Ok(());
+ }
- doc.bounds()
++ let clip = contents == LayerThumbnailContents::LayerBounds;
++ app.run("prefs.set", json!({"path": "interface.clipThumbnailsToLayerBounds", "value": clip})).map(|_| ())
+}
+
+/// Preview cache recomputes only when hovering a new target, not each pointer frame.
+/// Compositor sees it as a temporary document and never commits it to history.
+pub(crate) struct ReorderPreview {
+ pub source: photocraft_doc::DocId,
+ pub revision: u64,
+ pub signature: u64,
+ pub key: u64,
+ pub document: std::sync::Arc<Document>,
+}
+
+pub(crate) fn preview_reorder(app: &mut PhotocraftApp, payload: &serde_json::Value) {
+ if !app.ui.layers_panel_options.preview_on_canvas_when_reordering_layers {
+ app.reorder_preview = None;
+ return;
+ }
+ // Mark the destination as hovered even if the cached preview already matches.
+ app.reorder_preview_hit = true;
+ let Some(st) = app.session.active() else { return };
+ let mut hasher = std::collections::hash_map::DefaultHasher::new();
+ use std::hash::{Hash, Hasher};
+ payload.to_string().hash(&mut hasher);
+ st.doc.id.0.hash(&mut hasher);
+ st.revision.hash(&mut hasher);
+ let signature = hasher.finish();
+ if app.reorder_preview.as_ref().is_some_and(|cache| cache.signature == signature) {
+ return;
+ }
+ let (source, revision) = (st.doc.id, st.revision);
+ let add_copy = app.ui.layers_panel_options.add_copy_to_copied_layers_and_groups;
+ let preview = photocraft_engine::layer_multi_cmds::preview_move(&st.doc, payload, add_copy);
+ app.reorder_preview = preview.map(|document| ReorderPreview {
+ source,
+ revision,
+ signature,
+ key: (1u64 << 60) | (signature & ((1u64 << 60) - 1)),
+ document: std::sync::Arc::new(document),
+ });
+}
+
+pub(crate) fn display_reorder(app: &PhotocraftApp, index: usize) -> Option<(std::sync::Arc<Document>, u64)> {
+ if !app.ui.layers_panel_options.preview_on_canvas_when_reordering_layers {
+ return None;
+ }
+ let st = app.session.documents().get(index)?;
+ let cached = app.reorder_preview.as_ref()?;
+ (cached.source == st.doc.id && cached.revision == st.revision).then(|| (cached.document.clone(), cached.key))
+}
+
+/// Photoshop shows the same flower at three resolutions. This example is original,
+/// vector-painted artwork, not an extracted Adobe asset, and it is independent of
+/// whichever layer happens to be selected (including adjustment layers).
+fn paint_flower_example(ui: &Ui, rect: egui::Rect) {
+ use egui::{Color32, Rect as UiRect, Shape, Stroke, pos2, vec2};
+ let painter = ui.painter().with_clip_rect(rect);
+ let side = rect.width();
+ let point = |x: f32, y: f32| pos2(rect.min.x + x * side, rect.min.y + y * side);
+ // A monochrome miniature landscape: light sky, shaded hills and a dark meadow.
+ for n in 0..22 {
+ let y0 = n as f32 / 22.0;
+ let y1 = (n + 1) as f32 / 22.0;
+ let f = n as f32 / 22.0;
+ painter.rect_filled(UiRect::from_min_max(point(0.0, y0), point(1.0, y1)), 0.0, Color32::from_gray((119.0 + f * 30.0) as u8));
+ }
+ painter.add(Shape::convex_polygon(
+ vec![point(0.0, 0.60), point(0.22, 0.36), point(0.46, 0.56), point(0.72, 0.33), point(1.0, 0.62)],
+ Color32::from_gray(80),
+ Stroke::NONE,
+ ));
+ painter.add(Shape::convex_polygon(
+ vec![point(0.0, 0.76), point(0.32, 0.60), point(0.57, 0.69), point(1.0, 0.51), point(1.0, 1.0), point(0.0, 1.0)],
+ Color32::from_gray(64),
+ Stroke::NONE,
+ ));
+ for n in 0..16 {
+ let x = ((n * 43 + 13) % 97) as f32 / 96.0;
+ let y = 0.78 + ((n * 11 % 19) as f32) / 100.0;
+ painter.line_segment([point(x, 1.0), point((x + 0.02).min(1.0), y)], Stroke::new(side * 0.01, Color32::from_gray(104)));
+ }
+ // A white daisy with layered petals and a dark central disc, in the same
+ // composition at all three sizes, so the controls genuinely preview scale.
+ let center = point(0.49, 0.57);
+ let unit = side * 0.34;
+ for n in 0..15 {
+ let theta = (n as f32 + 0.5) * std::f32::consts::TAU / 15.0;
+ let direction = vec2(theta.cos(), theta.sin());
+ let normal = vec2(-theta.sin(), theta.cos());
+ let mut outline = Vec::with_capacity(20);
+ for i in 0..=9 {
+ let t = i as f32 / 9.0;
+ let base = center + direction * unit * (0.22 + 0.83 * t);
+ outline.push(base + normal * (unit * 0.22 * (std::f32::consts::PI * t).sin()));
+ }
+ for i in (0..=9).rev() {
+ let t = i as f32 / 9.0;
+ let base = center + direction * unit * (0.22 + 0.83 * t);
+ outline.push(base - normal * (unit * 0.22 * (std::f32::consts::PI * t).sin()));
+ }
+ painter.add(Shape::convex_polygon(
+ outline,
+ if n % 3 == 0 { Color32::from_gray(213) } else { Color32::from_gray(238) },
+ Stroke::new(0.3, Color32::from_gray(155)),
+ ));
+ }
+ painter.circle_filled(center, unit * 0.27, Color32::from_gray(33));
+ painter.circle_filled(center - vec2(unit * 0.065, unit * 0.055), unit * 0.16, Color32::from_gray(55));
+ for n in 0..16 {
+ let theta = (n as f32) * std::f32::consts::TAU / 16.0;
+ let r = unit * if n % 2 == 0 { 0.16 } else { 0.21 };
+ painter.circle_filled(center + vec2(theta.cos(), theta.sin()) * r, (side * 0.008).max(0.3), Color32::from_gray(119));
+ }
+ painter.rect_stroke(rect, 0.0, Stroke::new(1.0, Color32::from_gray(92)), egui::StrokeKind::Inside);
+}
+
+/// Returns both the actual thumbnail width and the height allocated by the Layers
+/// row. Used by painting and by tests to keep the preference functional.
+pub(crate) fn thumbnail_geometry(size: LayerThumbnailSize, pro: bool) -> (f32, f32) {
+ let thumb: f32 = match size {
+ LayerThumbnailSize::None => 0.0,
+ LayerThumbnailSize::Small => 18.0,
+ LayerThumbnailSize::Medium => {
+ if pro {
+ 24.0
+ } else {
+ 34.0
+ }
+ }
+ LayerThumbnailSize::Large => 48.0,
+ };
+ let row = if thumb == 0.0 { 23.0 } else { (thumb + 8.0).max(if pro { 32.0 } else { 40.0 }) };
+ (thumb, row)
+}
+
+/// Content column of the Photoshop-style dialog, with fixed-size radio/preview
+/// slots rather than text labels that change the position of each thumbnail.
+fn options_body(ui: &mut Ui, draft: &mut LayersPanelOptions) {
+ ui.group(|ui| {
+ ui.set_min_width(308.0);
+ ui.label(egui::RichText::new(tl!("Thumbnail Size")).strong());
+ ui.add_space(7.0);
+ // The original Photoshop dialog has None with a label, then progressively
+ // larger previews, with the radio controls aligned vertically.
+ ui.horizontal(|ui| {
+ let r = ui.radio_value(&mut draft.thumbnail_size, LayerThumbnailSize::None, tl!("None"));
+ r.on_hover_text(tl!("None"));
+ });
+ ui.add_space(3.0);
+ for (size, side, name) in [
+ (LayerThumbnailSize::Small, 38.0, tl!("Small")),
+ (LayerThumbnailSize::Medium, 68.0, tl!("Medium")),
+ (LayerThumbnailSize::Large, 96.0, tl!("Large")),
+ ] {
+ ui.horizontal(|ui| {
+ // Empty radio captions are intentional: the sample itself conveys
+ // size. The accessible/hover label still names the setting.
+ let radio = ui.radio_value(&mut draft.thumbnail_size, size, "");
+ radio.on_hover_text(name);
+ ui.add_space(8.0);
+ let (rect, response) = ui.allocate_exact_size(egui::vec2(side, side), egui::Sense::click());
+ paint_flower_example(ui, rect);
+ if response.clicked() {
+ draft.thumbnail_size = size;
+ }
+ response.on_hover_text(name);
+ });
+ ui.add_space(5.0);
+ }
+ });
+ ui.add_space(9.0);
+ ui.group(|ui| {
+ ui.set_min_width(308.0);
+ ui.label(egui::RichText::new(tl!("Thumbnail Contents")).strong());
+ ui.add_space(10.0);
+ ui.radio_value(&mut draft.thumbnail_contents, LayerThumbnailContents::LayerBounds, tl!("Layer Bounds"));
+ ui.add_space(4.0);
+ ui.radio_value(&mut draft.thumbnail_contents, LayerThumbnailContents::EntireDocument, tl!("Entire Document"));
+ ui.add_space(4.0);
+ });
+ ui.add_space(9.0);
+ ui.checkbox(&mut draft.expand_new_effects, tl!("Expand New Effects"));
+ ui.add_space(3.0);
+ ui.checkbox(&mut draft.add_copy_to_copied_layers_and_groups, tl!("Add “copy” to Copied Layers and Groups"));
+ ui.add_space(3.0);
+ ui.checkbox(&mut draft.preview_on_canvas_when_reordering_layers, tl!("Preview on canvas when reordering layers"));
+ ui.add_space(3.0);
+ ui.checkbox(&mut draft.show_layer_mask_badges, tl!("Show layer mask badges"));
+}
+
+pub fn show_dialog(app: &mut PhotocraftApp, ctx: &Context) {
+ let Some(mut dialog) = app.ui.layers_panel_dialog.take() else { return };
+ let mut confirmed = false;
+ let mut cancelled = ctx.input(|i| i.key_pressed(egui::Key::Escape));
+ let title = match &dialog {
+ LayersPanelDialog::PanelOptions(_) => tl!("Layers Panel Options"),
+ LayersPanelDialog::NewLayer(_) => tl!("New Layer"),
+ LayersPanelDialog::NewGroup(_) => tl!("New Group"),
+ LayersPanelDialog::LockLayers { .. } => tl!("Lock Layers"),
+ };
+ egui::Modal::new(egui::Id::new("layers-panel-options-modal")).show(ctx, |ui| {
+ ui.set_width(if matches!(dialog, LayersPanelDialog::PanelOptions(_)) { 480.0 } else { 380.0 });
+ ui.horizontal(|ui| {
+ ui.heading(title);
+ ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
+ if ui.small_button("×").on_hover_text(tl!("Cancel")).clicked() {
+ cancelled = true;
+ }
+ });
+ });
+ ui.separator();
+ match &mut dialog {
+ LayersPanelDialog::PanelOptions(opts) => {
+ ui.horizontal_top(|ui| {
+ ui.vertical(|ui| {
+ ui.set_width(345.0);
+ ui.vertical(|ui| options_body(ui, opts));
+ });
+ ui.add_space(10.0);
+ ui.vertical(|ui| {
+ ui.set_min_width(74.0);
+ if ui.add_sized([74.0, 29.0], egui::Button::new(tl!("OK"))).clicked() {
+ confirmed = true;
+ }
+ ui.add_space(6.0);
+ if ui.add_sized([74.0, 29.0], egui::Button::new(tl!("Cancel"))).clicked() {
+ cancelled = true;
+ }
+ });
+ });
+ }
+ LayersPanelDialog::NewLayer(name) | LayersPanelDialog::NewGroup(name) => {
+ ui.label(tl!("Name:"));
+ ui.text_edit_singleline(name);
+ }
+ LayersPanelDialog::LockLayers { transparency, pixels, position, artboard, all } => {
+ ui.checkbox(transparency, tl!("Transparency"));
+ ui.checkbox(pixels, tl!("Image"));
+ ui.checkbox(position, tl!("Position"));
+ ui.checkbox(artboard, tl!("Prevent Auto-Nesting"));
+ ui.checkbox(all, tl!("All"));
+ }
+ }
+ if !matches!(dialog, LayersPanelDialog::PanelOptions(_)) {
+ ui.add_space(10.0);
+ ui.horizontal(|ui| {
+ if ui.button(tl!("OK")).clicked() {
+ confirmed = true;
+ }
+ if ui.button(tl!("Cancel")).clicked() {
+ cancelled = true;
+ }
+ });
+ }
+ });
+ if confirmed && !cancelled {
+ let r = match dialog {
- LayersPanelDialog::PanelOptions(options) => {
- app.ui.layers_panel_options = options;
- persist_options(app);
- Ok(())
- }
++ LayersPanelDialog::PanelOptions(options) => apply_options(app, options),
+ LayersPanelDialog::NewLayer(name) => {
+ app.run("layer.new.layer", if name.trim().is_empty() { json!({}) } else { json!({"name": name.trim()}) }).map(|_| ())
+ }
+ LayersPanelDialog::NewGroup(name) => {
+ app.run("layer.new.group", if name.trim().is_empty() { json!({}) } else { json!({"name": name.trim()}) }).map(|_| ())
+ }
+ LayersPanelDialog::LockLayers { transparency, pixels, position, artboard, all } => app
+ .run("layer.lockLayers", json!({"transparency": transparency, "pixels": pixels, "position": position, "artboard": artboard, "all": all}))
+ .map(|_| ()),
+ };
+ if let Err(e) = r {
+ app.ui.status = e;
+ app.ui.status_error = true;
+ }
+ } else if !cancelled {
+ app.ui.layers_panel_dialog = Some(dialog);
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn default_panel_options_match_medium_document_previews() {
+ let options = LayersPanelOptions::default();
+ assert_eq!(options.thumbnail_size, LayerThumbnailSize::Medium);
+ assert_eq!(options.thumbnail_contents, LayerThumbnailContents::EntireDocument);
+ assert!(options.show_filters);
+ assert!(options.expand_new_effects);
+ assert!(options.add_copy_to_copied_layers_and_groups);
+ assert!(options.preview_on_canvas_when_reordering_layers);
+ assert!(!options.show_layer_mask_badges);
+ }
+
++ /// Thumbnail Contents is the same setting as the panel menu's Clip Thumbnails to Layer Bounds
++ /// (#4281): the dialog shows it and OK sets it, so the two never disagree.
+ #[test]
- fn thumbnail_contents_crop_to_pixels_and_fall_back_for_blank_layers() {
++ fn thumbnail_contents_is_clip_thumbnails_to_layer_bounds() {
+ let mut session = photocraft_engine::Session::new();
- session.execute("file.new", json!({"width": 100, "height": 60})).unwrap();
- let id = session.execute("layer.new.layer", json!({"name": "mark"})).unwrap()["layer"].as_u64().unwrap();
++ session.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
+ let mut app = PhotocraftApp::new(session, crate::Services::default());
- let doc = app.session.active().unwrap().doc.clone();
- let layer = doc.layer(photocraft_doc::LayerId(id)).unwrap();
- let original = thumbnail_region(&mut app, &doc, layer, LayerThumbnailContents::LayerBounds);
- assert_eq!(original, doc.bounds(), "empty raster layers use document dimensions");
- app.run("select.rect", json!({"x": 70, "y": 10, "width": 5, "height": 12})).unwrap();
- app.run("edit.fill", json!({"contents": "color", "color": "#ff0000"})).unwrap();
- let updated = app.session.active().unwrap().doc.clone();
- let layer = updated.layer(photocraft_doc::LayerId(id)).unwrap();
- let cropped = thumbnail_region(&mut app, &updated, layer, LayerThumbnailContents::LayerBounds);
- assert_eq!(cropped, Rect::new(70, 10, 75, 22));
- assert_eq!(thumbnail_region(&mut app, &updated, layer, LayerThumbnailContents::EntireDocument), updated.bounds());
++ assert_eq!(thumbnail_contents(&app), LayerThumbnailContents::EntireDocument);
++ let mut options = app.ui.layers_panel_options.clone();
++ options.thumbnail_contents = LayerThumbnailContents::LayerBounds;
++ apply_options(&mut app, options.clone()).unwrap();
++ assert!(app.session.prefs().interface.clip_thumbnails_to_layer_bounds);
++ assert_eq!(thumbnail_contents(&app), LayerThumbnailContents::LayerBounds);
++ assert!(app.session.prefs().dialogs[OPTIONS_PREF].get("thumbnailContents").is_none(), "saved once, in the shared preference");
++ options.thumbnail_contents = LayerThumbnailContents::EntireDocument;
++ apply_options(&mut app, options).unwrap();
++ assert!(!app.session.prefs().interface.clip_thumbnails_to_layer_bounds);
+ }
+
+ #[test]
+ fn options_round_trip_without_a_pending_dialog() {
+ let mut ui = crate::state::UiState::default();
+ ui.layers_panel_options.thumbnail_size = LayerThumbnailSize::Large;
- ui.layers_panel_options.thumbnail_contents = LayerThumbnailContents::LayerBounds;
+ ui.layers_panel_options.show_filters = false;
+ ui.layers_panel_dialog = Some(LayersPanelDialog::NewGroup("test".into()));
+ let json = serde_json::to_value(&ui).unwrap();
+ assert!(json.get("layers_panel_dialog").is_none());
+ let restored: crate::state::UiState = serde_json::from_value(json).unwrap();
+ assert_eq!(restored.layers_panel_options, ui.layers_panel_options);
+ assert!(restored.layers_panel_dialog.is_none());
+ }
+
+ #[test]
+ fn prefs_options_save_and_restore_all_switches() {
+ let mut session = photocraft_engine::Session::new();
+ session.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
+ let mut app = PhotocraftApp::new(session, crate::Services::default());
+ let saved = LayersPanelOptions {
+ thumbnail_size: LayerThumbnailSize::Large,
- thumbnail_contents: LayerThumbnailContents::LayerBounds,
++ thumbnail_contents: LayerThumbnailContents::EntireDocument,
+ show_filters: false,
+ expand_new_effects: false,
+ add_copy_to_copied_layers_and_groups: false,
+ preview_on_canvas_when_reordering_layers: false,
+ show_layer_mask_badges: true,
+ };
+ app.ui.layers_panel_options = saved.clone();
+ persist_options(&mut app);
+ assert_eq!(app.session.prefs().dialogs[OPTIONS_PREF]["showLayerMaskBadges"], true);
+ app.ui.layers_panel_options = LayersPanelOptions::default();
+ restore_options(&mut app);
+ assert_eq!(app.ui.layers_panel_options, saved);
+ }
+
+ #[test]
+ fn flyout_flatten_routes_to_real_engine_and_undo_restores_layers() {
+ let mut session = photocraft_engine::Session::new();
+ session.execute("file.new", json!({"width": 18, "height": 12})).unwrap();
+ session.execute("layer.new.layer", json!({"name": "Red pixels"})).unwrap();
+ session.execute("edit.fill", json!({"color": "#ff0000"})).unwrap();
+ let mut app = PhotocraftApp::new(session, crate::Services::default());
+ let count = app.session.active().unwrap().doc.layers.len();
+ assert!(count >= 2);
+ // The flyout uses menus::invoke with this exact command id.
+ crate::menus::invoke(&mut app, &egui::Context::default(), "layer.flattenImage", json!({})).unwrap();
+ let flattened = app.session.active().unwrap();
+ assert_eq!(flattened.doc.layers.len(), 1);
+ assert_eq!(flattened.doc.layers[0].name, "Background");
+ assert!(flattened.doc.layers[0].surface().is_some());
+ app.run("edit.undo", json!({})).unwrap();
+ assert_eq!(app.session.active().unwrap().doc.layers.len(), count);
+ }
+
+ #[test]
+ fn geometry_matches_four_real_panel_sizes() {
+ for pro in [false, true] {
+ let mut previous = -1.0;
+ for size in [LayerThumbnailSize::None, LayerThumbnailSize::Small, LayerThumbnailSize::Medium, LayerThumbnailSize::Large] {
+ let (thumb, row) = thumbnail_geometry(size, pro);
+ assert!(thumb > previous && row >= thumb, "{size:?}: {thumb}/{row}");
+ previous = thumb;
+ }
+ }
+ assert_eq!(thumbnail_geometry(LayerThumbnailSize::None, true), (0.0, 23.0));
+ assert_eq!(thumbnail_geometry(LayerThumbnailSize::Large, true), (48.0, 56.0));
+ }
+
+ #[test]
+ fn panel_options_missing_fields_deserialize_with_defaults() {
+ let options: LayersPanelOptions = serde_json::from_value(json!({})).unwrap();
+ assert_eq!(options, LayersPanelOptions::default());
+ let saved = serde_json::to_value(&options).unwrap();
+ assert_eq!(saved["thumbnailSize"], "medium");
+ }
+}
diff --cc crates/ui-egui/src/panels.rs
index e57228af5,82c2b667a..d705a13a6
--- a/crates/ui-egui/src/panels.rs
+++ b/crates/ui-egui/src/panels.rs
@@@ -2200,36 -2210,8 +2210,12 @@@ fn layers(app: &mut PhotocraftApp, ui:
let mut actions: Vec<(String, Value)> = Vec::new();
let t = Tokens::get(ui.ctx());
- if t.pro {
+ app.reorder_preview_hit = false;
+ if !ui.input(|i| i.pointer.primary_down()) || !app.ui.layers_panel_options.preview_on_canvas_when_reordering_layers {
+ app.reorder_preview = None;
+ }
+ if t.pro && app.ui.layers_panel_options.show_filters {
- ui.horizontal(|ui| {
- ui.spacing_mut().item_spacing.x = 2.0;
- let (r, _) = ui.allocate_exact_size(vec2(64.0, 22.0), Sense::hover());
- ui.painter().rect_filled(r, t.radius_sm, t.field);
- ui.painter().rect_stroke(r, t.radius_sm, Stroke::new(1.0, t.field_border), StrokeKind::Inside);
- icons::paint(ui, Rect::from_center_size(r.left_center() + vec2(11.0, 0.0), vec2(14.0, 14.0)), "search", 11.0, t.text_faint);
- ui.painter().text(r.left_center() + vec2(22.0, 0.0), Align2::LEFT_CENTER, tl!("Kind"), egui::FontId::proportional(11.5), t.text_dim);
- ui.add_space(4.0);
- for (kind, icon, tip) in [
- ("pixel", "image", tl!("Filter for pixel layers")),
- ("adjustment", "adjustment-layer", tl!("Filter for adjustment layers")),
- ("type", "type", tl!("Filter for type layers")),
- ("shape", "square", tl!("Filter for shape layers")),
- ("smart", "app-window", tl!("Filter for smart objects")),
- ] {
- let on = app.ui.layer_filter.iter().any(|k| k == kind);
- if icons::button(ui, icon, 22.0, on, tip).clicked() {
- if on {
- app.ui.layer_filter.retain(|k| k != kind);
- } else {
- app.ui.layer_filter.push(kind.to_string());
- }
- }
- }
- });
+ crate::layer_filter_ui::bar(app, ui);
ui.add_space(4.0);
}
if let Some(l) = active_layer {
diff --cc crates/ui-egui/src/state.rs
index a1d283562,aeefb3ecb..5fff56214
--- a/crates/ui-egui/src/state.rs
+++ b/crates/ui-egui/src/state.rs
@@@ -3,66 -3,6 +3,70 @@@
use serde::{Deserialize, Serialize};
+/// Photoshop-style Layers panel display preferences; part of serialized UI state.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
+#[serde(rename_all = "camelCase")]
+pub enum LayerThumbnailSize {
+ None,
+ Small,
+ #[default]
+ Medium,
+ Large,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
+#[serde(rename_all = "camelCase")]
+pub enum LayerThumbnailContents {
+ LayerBounds,
+ #[default]
+ EntireDocument,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(default, rename_all = "camelCase")]
+pub struct LayersPanelOptions {
+ pub thumbnail_size: LayerThumbnailSize,
++ /// Thumbnail Contents in the Panel Options dialog. Not saved with these options: the dialog
++ /// shows and sets `interface.clipThumbnailsToLayerBounds` (Layer Bounds = clipped, #4281),
++ /// which the panel menu's Clip Thumbnails to Layer Bounds toggles too.
++ #[serde(skip)]
+ pub thumbnail_contents: LayerThumbnailContents,
+ pub show_filters: bool,
+ pub expand_new_effects: bool,
+ pub add_copy_to_copied_layers_and_groups: bool,
+ pub preview_on_canvas_when_reordering_layers: bool,
+ pub show_layer_mask_badges: bool,
+}
+
+impl LayersPanelOptions {
+ pub fn defaults() -> Self {
+ Self {
+ thumbnail_size: LayerThumbnailSize::Medium,
+ thumbnail_contents: LayerThumbnailContents::EntireDocument,
+ show_filters: true,
+ expand_new_effects: true,
+ add_copy_to_copied_layers_and_groups: true,
+ preview_on_canvas_when_reordering_layers: true,
+ show_layer_mask_badges: false,
+ }
+ }
+}
+
+impl Default for LayersPanelOptions {
+ fn default() -> Self {
+ Self::defaults()
+ }
+}
+
+/// Pending dialog data is transient: Cancel never changes persisted options.
+#[derive(Clone, Debug, PartialEq)]
+pub enum LayersPanelDialog {
+ PanelOptions(LayersPanelOptions),
+ NewLayer(String),
+ NewGroup(String),
+ LockLayers { transparency: bool, pixels: bool, position: bool, artboard: bool, all: bool },
+}
+
/// Shared selection and capture for a point curve; document parameters remain with the host.
#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
@@@ -1200,12 -1161,15 +1225,21 @@@ pub struct UiState
/// Layers panel kind filter ("pixel", "adjustment", "type", "shape", "smart"); empty = all.
#[serde(default)]
pub layer_filter: Vec<String>,
+ /// Thumbnail dimensions, content cropping and filter-strip visibility.
+ #[serde(default)]
+ pub layers_panel_options: LayersPanelOptions,
+ /// Transient dialog; never restored with a workspace.
+ #[serde(skip)]
+ pub layers_panel_dialog: Option<LayersPanelDialog>,
+ /// Layers panel filter type (#5048): kind (above), name or blend mode.
+ #[serde(default)]
+ pub layer_filter_by: crate::layer_filter_ui::FilterBy,
+ /// Layers panel name filter: part of a layer name, ignoring case; empty = all.
+ #[serde(default)]
+ pub layer_filter_name: String,
+ /// Layers panel blend-mode filter.
+ #[serde(default = "default_layer_filter_mode")]
+ pub layer_filter_mode: photocraft_color::BlendMode,
/// Actions panel: which row is selected and which are expanded. The list lives on the session.
#[serde(default)]
pub actions: crate::actions::ActionsUi,
@@@ -1373,8 -1338,9 +1408,11 @@@ impl Default for UiState
artboard_tool: Default::default(),
shell: Default::default(),
layer_filter: Vec::new(),
+ layers_panel_options: LayersPanelOptions::default(),
+ layers_panel_dialog: None,
+ layer_filter_by: Default::default(),
+ layer_filter_name: String::new(),
+ layer_filter_mode: default_layer_filter_mode(),
pen: None,
stroke_editor: None,
direct_selection: Default::default(),