Skip to content

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

feat(ui): add hamburger menu to the Brush Settings panel (#4272) (#4358)

Sir Starch97d06b240b36
diff --git a/crates/ui-egui/src/brush_panel.rs b/crates/ui-egui/src/brush_panel.rs
index 4cadb6b21..6ea83d10e 100644
--- a/crates/ui-egui/src/brush_panel.rs
+++ b/crates/ui-egui/src/brush_panel.rs
@@ -409,6 +409,92 @@ fn settings_tab(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
commit_gesture(app, ui.ctx(), &before, &b);
}
+/// Clear brush controls: turns off every section except Smoothing and resets their options
+/// to the defaults (Photoshop), keeping locked sections intact.
+pub fn clear_brush_controls(current: &BrushSettings) -> BrushSettings {
+ let mut b = current.clone();
+ let d = BrushSettings::default();
+ let l = &current.locks;
+ if !l.shape_dynamics {
+ b.shape_dynamics = d.shape_dynamics;
+ }
+ if !l.scattering {
+ b.scattering = d.scattering;
+ }
+ if !l.texture {
+ b.texture = d.texture;
+ }
+ if !l.dual_brush {
+ b.dual_brush = d.dual_brush;
+ }
+ if !l.color_dynamics {
+ b.color_dynamics = d.color_dynamics;
+ }
+ if !l.transfer {
+ b.transfer = d.transfer;
+ }
+ if !l.pose {
+ b.pose = d.pose;
+ }
+ if !l.noise {
+ b.noise = d.noise;
+ }
+ if !l.wet_edges {
+ b.wet_edges = d.wet_edges;
+ }
+ if !l.build_up {
+ b.build_up = d.build_up;
+ b.build_up_rate = d.build_up_rate;
+ }
+ if !l.protect_texture {
+ b.protect_texture = d.protect_texture;
+ }
+ b
+}
+
+/// Copy the current brush's Texture settings to other painting tools that have Texture enabled.
+pub fn copy_texture_to_other_tools(app: &mut PhotocraftApp) {
+ let texture = app.session.tools.brush.texture.clone();
+ for (_, brush) in &mut app.ui.tool_brushes {
+ if brush.texture.enabled {
+ brush.texture = texture.clone();
+ }
+ }
+}
+
+/// The Brush Settings panel menu actions (hamburger menu).
+pub fn panel_menu(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
+ if ui.button(tl!("New Brush Preset…")).clicked() {
+ let name = new_preset_name(&app.session.tools.presets);
+ run_or_status(app, "brush.presets.save", json!({ "name": name }));
+ if app.session.tools.presets.iter().any(|p| p.name == name) {
+ app.ui.brushes_panel.renaming = Some(Renaming { group: false, name: name.clone(), folder: Vec::new(), text: String::new() });
+ app.ui.brush_picker_list.renaming = Some(Renaming { group: false, name, folder: Vec::new(), text: String::new() });
+ }
+ ui.close();
+ }
+ ui.separator();
+ if ui.button(tl!("Clear Brush Controls")).clicked() {
+ let before = app.session.tools.brush.clone();
+ let cleared = clear_brush_controls(&before);
+ commit(app, &before, &cleared);
+ ui.close();
+ }
+ let has_locks = app.session.tools.brush.locks != photocraft_paint::brush::SectionLocks::default();
+ if ui.add_enabled(has_locks, egui::Button::new(tl!("Reset All Locked Settings"))).clicked() {
+ let before = app.session.tools.brush.clone();
+ let mut after = before.clone();
+ after.locks = photocraft_paint::brush::SectionLocks::default();
+ commit(app, &before, &after);
+ ui.close();
+ }
+ let has_texture = app.session.tools.brush.texture.enabled;
+ if ui.add_enabled(has_texture, egui::Button::new(tl!("Copy Texture to Other Tools"))).clicked() {
+ copy_texture_to_other_tools(app);
+ ui.close();
+ }
+}
+
pub fn window(app: &mut PhotocraftApp, ctx: &egui::Context) {
if !app.ui.panels.brush_settings {
return;
@@ -442,6 +528,21 @@ pub fn window(app: &mut PhotocraftApp, ctx: &egui::Context) {
if icons::button(ui, "x", 20.0, false, tl!("Close")).clicked() {
open = false;
}
+ let menu_btn = widgets::panel_menu_button(ui);
+ egui::Popup::menu(&menu_btn).show(|ui| {
+ widgets::style_spectrum_popup_menu(ui);
+ ui.set_min_width(180.0);
+ panel_menu(app, ui);
+ ui.separator();
+ if ui.button(tl!("Close")).clicked() {
+ open = false;
+ ui.close();
+ }
+ if ui.button(tl!("Close Tab Group")).clicked() {
+ open = false;
+ ui.close();
+ }
+ });
});
});
ui.add_space(6.0);
diff --git a/crates/ui-egui/src/brush_panel_tests.rs b/crates/ui-egui/src/brush_panel_tests.rs
index 6a2338295..2e48b2abb 100644
--- a/crates/ui-egui/src/brush_panel_tests.rs
+++ b/crates/ui-egui/src/brush_panel_tests.rs
@@ -1176,6 +1176,96 @@ fn hand_tool_offers_scale_buttons_and_requests_the_right_view() {
assert!(!h.state().ui.views[0].fit_pending);
}
+#[test]
+fn brush_settings_hamburger_menu_actions() {
+ use egui_kittest::kittest::Queryable;
+
+ // 1. Menu opens and offers Photoshop actions
+ let mut h = harness(0, 0);
+ h.get_by_label("Panel menu").click();
+ h.run_steps(2);
+
+ assert!(h.query_all_by_label("New Brush Preset…").count() > 0);
+ assert!(h.query_all_by_label("Clear Brush Controls").count() > 0);
+ assert!(h.query_all_by_label("Reset All Locked Settings").count() > 0);
+ assert!(h.query_all_by_label("Copy Texture to Other Tools").count() > 0);
+ assert!(h.query_all_by_label("Close").count() > 0);
+ assert!(h.query_all_by_label("Close Tab Group").count() > 0);
+
+ // 2. New Brush Preset… saves a preset
+ let count0 = h.state().session.tools.presets.len();
+ h.get_by_label("New Brush Preset…").click();
+ h.run_steps(2);
+ assert_eq!(h.state().session.tools.presets.len(), count0 + 1);
+ assert_eq!(last_journal(h.state()).unwrap().0, "brush.presets.save");
+
+ // 3. Clear Brush Controls resets dynamics, keeps locked sections and smoothing
+ let mut h = harness(0, 0);
+ h.state_mut().session.tools.brush.size = 45.0;
+ h.state_mut().session.tools.brush.scattering.enabled = true;
+ h.state_mut().session.tools.brush.texture.enabled = true;
+ h.state_mut().session.tools.brush.locks.texture = true;
+ h.state_mut().session.tools.brush.smoothing.amount = 0.5;
+ h.run_steps(1);
+
+ h.get_by_label("Panel menu").click();
+ h.run_steps(2);
+ h.get_by_label("Clear Brush Controls").click();
+ h.run_steps(2);
+
+ let b = &h.state().session.tools.brush;
+ assert!(!b.scattering.enabled, "unlocked scattering cleared");
+ assert!(b.texture.enabled, "locked texture preserved");
+ assert_eq!(b.smoothing.amount, 0.5, "smoothing preserved");
+ assert_eq!(b.size, 45.0, "tip size preserved");
+
+ // 4. Reset All Locked Settings clears all locks
+ assert!(b.locks.texture);
+ h.get_by_label("Panel menu").click();
+ h.run_steps(2);
+ h.get_by_label("Reset All Locked Settings").click();
+ h.run_steps(2);
+ assert_eq!(h.state().session.tools.brush.locks, photocraft_paint::brush::SectionLocks::default());
+
+ // 5. Copy Texture to Other Tools copies texture to other tools with texture enabled
+ let mut h = harness(0, 0);
+ h.state_mut().session.tools.brush.texture.enabled = true;
+ h.state_mut().session.tools.brush.texture.scale = 2.5;
+ let mut pencil_brush = BrushSettings::default();
+ pencil_brush.texture.enabled = true;
+ pencil_brush.texture.scale = 1.0;
+ h.state_mut().ui.tool_brushes = vec![(crate::state::Tool::Pencil, pencil_brush)];
+ h.run_steps(1);
+
+ h.get_by_label("Panel menu").click();
+ h.run_steps(2);
+ h.get_by_label("Copy Texture to Other Tools").click();
+ h.run_steps(2);
+
+ let pencil = h.state().ui.tool_brushes.iter().find(|(t, _)| *t == crate::state::Tool::Pencil).unwrap();
+ assert_eq!(pencil.1.texture.scale, 2.5);
+
+ // 6. Close closes the window
+ let mut h = harness(0, 0);
+ assert!(h.state().ui.panels.brush_settings);
+ h.get_by_label("Panel menu").click();
+ h.run_steps(2);
+ let close_buttons: Vec<_> = h.query_all_by_label("Close").collect();
+ assert!(close_buttons.len() >= 2);
+ close_buttons.last().unwrap().click();
+ h.run_steps(2);
+ assert!(!h.state().ui.panels.brush_settings);
+
+ // 7. Close Tab Group closes the window
+ let mut h = harness(0, 0);
+ assert!(h.state().ui.panels.brush_settings);
+ h.get_by_label("Panel menu").click();
+ h.run_steps(2);
+ h.get_by_label("Close Tab Group").click();
+ h.run_steps(2);
+ assert!(!h.state().ui.panels.brush_settings);
+}
+
#[test]
fn brushes_button_at_top_of_brush_settings_opens_brushes_panel() {
use egui_kittest::kittest::Queryable;
diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs
index 4bd043da6..0aab2769e 100644
--- a/crates/ui-egui/src/dock.rs
+++ b/crates/ui-egui/src/dock.rs
@@ -601,6 +601,10 @@ pub fn show(app: &mut PhotocraftApp, ui: &mut egui::Ui, shown: &[Group], mut bod
crate::swatches_ui::panel_menu(app, ui);
ui.separator();
}
+ if tabs.get(sel) == Some(&"Brush Settings") {
+ crate::brush_panel::panel_menu(app, ui);
+ ui.separator();
+ }
if tabs.get(sel) == Some(&"Actions") {
crate::actions::panel_menu(app, ui);
ui.separator();
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index 11438131d..16c1d9d2d 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -3666,6 +3666,9 @@ navigator Zoom Zvětšení
Remove after each stroke Odstranit po každém tahu
Apply the removal ({key}) Použít odstranění ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Tahy k odstranění: {n} (Enter použije, Esc zruší)
+ Clear Brush Controls Obnovit ovládací prvky stopy
+ Reset All Locked Settings Obnovit všechna zamknutá nastavení
+ Copy Texture to Other Tools Kopírovat texturu do jiných nástrojů
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Načíst akce…
diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv
index a9b676634..25d19ff71 100644
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@ -2698,6 +2698,9 @@ curves Smooth Glätten
Remove after each stroke Nach jedem Strich entfernen
Apply the removal ({key}) Entfernen anwenden ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Striche zum Entfernen: {n} (Eingabe wendet an, Esc bricht ab)
+ Clear Brush Controls Pinselsteuerungen löschen
+ Reset All Locked Settings Alle gesperrten Einstellungen zurücksetzen
+ Copy Texture to Other Tools Struktur auf andere Werkzeuge kopieren
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Aktionen laden…
diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv
index 5c33da43c..c840fbcb2 100644
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@ -3756,6 +3756,9 @@ curves Smooth Εξομάλυνση
Remove after each stroke Αφαίρεση μετά από κάθε πινελιά
Apply the removal ({key}) Εφαρμογή της αφαίρεσης ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Πινελιές προς αφαίρεση: {n} (Enter εφαρμόζει, Esc ακυρώνει)
+ Clear Brush Controls Απαλοιφή στοιχείων ελέγχου πινέλου
+ Reset All Locked Settings Επαναφορά όλων των κλειδωμένων ρυθμίσεων
+ Copy Texture to Other Tools Αντιγραφή υφής σε άλλα εργαλεία
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Φόρτωση ενεργειών…
diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv
index e7f2385d5..71f4d655e 100644
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@ -2739,6 +2739,9 @@ curves Smooth Suavizar
Remove after each stroke Eliminar después de cada trazo
Apply the removal ({key}) Aplicar la eliminación ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Trazos por eliminar: {n} (Intro aplica, Esc cancela)
+ Clear Brush Controls Borrar controles de pincel
+ Reset All Locked Settings Restaurar todos los ajustes bloqueados
+ Copy Texture to Other Tools Copiar textura en otras herramientas
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Cargar acciones…
diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv
index 6076c41b5..7d9c50069 100644
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@ -3059,6 +3059,9 @@ curves Smooth Lisser
Remove after each stroke Supprimer après chaque trait
Apply the removal ({key}) Appliquer la suppression ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Traits à supprimer : {n} (Entrée applique, Échap annule)
+ Clear Brush Controls Effacer les commandes de pinceau
+ Reset All Locked Settings Réinitialiser tous les paramètres verrouillés
+ Copy Texture to Other Tools Copier la texture dans d'autres outils
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Charger des actions…
diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv
index a7dd7723b..56e203fde 100644
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@ -3972,6 +3972,9 @@ cameraRaw Yellow Sárga
Transform On Drop Átalakítás elengedéskor
Vanishing Point is not active Az Enyészpont nem aktív
Vanishing Point: click four corners to create a plane Enyészpont: sík létrehozásához kattints a négy sarokra
+ Clear Brush Controls Ecsetvezérlők törlése
+ Reset All Locked Settings Összes zárolt beállítás visszaállítása
+ Copy Texture to Other Tools Textúra másolása más eszközökre
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Műveletek betöltése…
diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv
index bb35e8cba..618687ff4 100644
--- a/crates/ui-egui/src/i18n/id.tsv
+++ b/crates/ui-egui/src/i18n/id.tsv
@@ -3046,6 +3046,9 @@ curves Smooth Haluskan
Remove after each stroke Hapus setelah setiap goresan
Apply the removal ({key}) Terapkan penghapusan ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Goresan untuk dihapus: {n} (Enter menerapkan, Esc membatalkan)
+ Clear Brush Controls Hapus Kontrol Kuas
+ Reset All Locked Settings Atur Ulang Semua Pengaturan Terkunci
+ Copy Texture to Other Tools Salin Tekstur ke Alat Lain
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Muat Tindakan…
diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv
index ca8e1cf71..5aa105c5f 100644
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@ -4022,6 +4022,9 @@ navigator Zoom Zoom
Remove after each stroke Rimuovi dopo ogni tratto
Apply the removal ({key}) Applica la rimozione ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Tratti da rimuovere: {n} (Invio applica, Esc annulla)
+ Clear Brush Controls Cancella controlli pennello
+ Reset All Locked Settings Ripristina tutte le impostazioni bloccate
+ Copy Texture to Other Tools Copia texture su altri strumenti
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Carica azioni…
diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv
index 7d0bf7dc4..eebc97e3e 100644
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@ -3668,6 +3668,9 @@ curves Smooth スムーズ
Remove after each stroke ストロークごとに削除
Apply the removal ({key}) 削除を適用 ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) 削除するストローク: {n}(Enter で適用、Esc で取り消し)
+ Clear Brush Controls ブラシのコントロールを消去
+ Reset All Locked Settings ロックされた設定をすべて初期化
+ Copy Texture to Other Tools テクスチャを他のツールにコピー
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… アクションを読み込み…
diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv
index 135a87286..0e31d4893 100644
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@ -3228,6 +3228,9 @@ curves Smooth 매끄럽게
Remove after each stroke 획마다 제거
Apply the removal ({key}) 제거 적용 ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) 제거할 획: {n} (Enter 적용, Esc 취소)
+ Clear Brush Controls 브러시 제어 지우기
+ Reset All Locked Settings 모든 잠긴 설정 재설정
+ Copy Texture to Other Tools 다른 도구로 텍스처 복사
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… 액션 불러오기…
diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv
index 6d8b52bf9..270ec8935 100644
--- a/crates/ui-egui/src/i18n/nl.tsv
+++ b/crates/ui-egui/src/i18n/nl.tsv
@@ -3818,6 +3818,9 @@ curves Smooth Vloeiend maken
Remove after each stroke Verwijderen na elke streek
Apply the removal ({key}) Verwijdering toepassen ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Streken om te verwijderen: {n} (Enter past toe, Esc annuleert)
+ Clear Brush Controls Penseelbesturing wissen
+ Reset All Locked Settings Alle vergrendelde instellingen opnieuw instellen
+ Copy Texture to Other Tools Structuur kopiëren naar andere gereedschappen
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Handelingen laden…
diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv
index 7c89aa596..39c1928ca 100644
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@ -3655,6 +3655,9 @@ curves Smooth Wygładź
Remove after each stroke Usuwaj po każdym pociągnięciu
Apply the removal ({key}) Zastosuj usuwanie ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Pociągnięcia do usunięcia: {n} (Enter stosuje, Esc anuluje)
+ Clear Brush Controls Wyczyść elementy sterujące pędzlem
+ Reset All Locked Settings Resetuj wszystkie zablokowane ustawienia
+ Copy Texture to Other Tools Kopiuj teksturę do innych narzędzi
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Wczytaj operacje…
diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv
index be6c0381f..17247be9b 100644
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@ -3848,6 +3848,9 @@ layerLabel No Color Sem cor
Remove after each stroke Remover após cada traço
Apply the removal ({key}) Aplicar a remoção ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Traços a remover: {n} (Enter aplica, Esc cancela)
+ Clear Brush Controls Limpar controles de pincel
+ Reset All Locked Settings Redefinir todas as configurações bloqueadas
+ Copy Texture to Other Tools Copiar textura para outras ferramentas
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Carregar ações…
diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv
index 125155cad..0cd3f56b1 100644
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@ -3003,6 +3003,9 @@ curves Smooth Сгладить
Remove after each stroke Удалять после каждого штриха
Apply the removal ({key}) Применить удаление ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Штрихов к удалению: {n} (Enter применяет, Esc отменяет)
+ Clear Brush Controls Очистить параметры кисти
+ Reset All Locked Settings Сбросить все заблокированные параметры
+ Copy Texture to Other Tools Скопировать текстуру в другие инструменты
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Загрузить операции…
diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv
index e4d4ec9ae..1f69babad 100644
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@ -3784,6 +3784,9 @@ cameraData Lens Lens
@plural {n} step|{n} steps {n} adım
@plural {warning} (+{n} more brush preset warning)|{warning} (+{n} more brush preset warnings) {warning} (+{n} fırça ön ayarı uyarısı daha)
@plural {what} with {n} warning|{what} with {n} warnings {what}, {n} uyarı ile
+ Clear Brush Controls Fırça Denetimlerini Temizle
+ Reset All Locked Settings Tüm Kilitli Ayarları Sıfırla
+ Copy Texture to Other Tools Dokuyu Diğer Araçlara Kopyala
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Eylemleri Yükle…
diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv
index 83f125012..253ca6b82 100644
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@ -3756,6 +3756,9 @@ curves Smooth Згладити
Remove after each stroke Видаляти після кожного штриха
Apply the removal ({key}) Застосувати видалення ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Штрихів для видалення: {n} (Enter застосовує, Esc скасовує)
+ Clear Brush Controls Очистити параметри пензля
+ Reset All Locked Settings Скинути всі заблоковані параметри
+ Copy Texture to Other Tools Скопіювати текстуру в інші інструменти
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Завантажити операції…
diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv
index 718278b5d..1d0e15b6e 100644
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@ -3539,6 +3539,9 @@ curves Smooth Làm mượt
Remove after each stroke Xóa sau mỗi nét vẽ
Apply the removal ({key}) Áp dụng việc xóa ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) Nét vẽ cần xóa: {n} (Enter áp dụng, Esc hủy)
+ Clear Brush Controls Xóa điều khiển cọ
+ Reset All Locked Settings Đặt lại tất cả cài đặt đã khóa
+ Copy Texture to Other Tools Sao chép họa tiết sang các công cụ khác
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… Nạp hành động…
diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv
index e2d5a3d6b..7b1862545 100644
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@ -2663,6 +2663,9 @@ curves Smooth 平滑
Remove after each stroke 每次描边后移除
Apply the removal ({key}) 应用移除 ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) 待移除的描边:{n}(Enter 应用,Esc 取消)
+ Clear Brush Controls 清除画笔控件
+ Reset All Locked Settings 复位所有锁定的设置
+ Copy Texture to Other Tools 将纹理复制到其他工具
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… 载入动作…
diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv
index 8543251b0..abcc5cb71 100644
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@ -2648,6 +2648,9 @@ curves Smooth 平滑
Remove after each stroke 每次描邊後移除
Apply the removal ({key}) 套用移除 ({key})
Strokes to remove: {n} (Enter applies, Esc cancels) 待移除的描邊:{n}(Enter 套用,Esc 取消)
+ Clear Brush Controls 清除筆刷控制項
+ Reset All Locked Settings 重設所有鎖定的設定
+ Copy Texture to Other Tools 複製紋理至其他工具
# Actions panel: Load/Save Actions (.atn) and kept Photoshop steps
Load Actions… 載入動作…
diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs
index 4aff73c01..7a1cb4df1 100644
--- a/crates/ui-egui/src/panel_docking.rs
+++ b/crates/ui-egui/src/panel_docking.rs
@@ -843,6 +843,10 @@ fn panel_menu(app: &mut PhotocraftApp, ui: &mut egui::Ui, panel: &str) {
crate::swatches_ui::panel_menu(app, ui);
ui.separator();
}
+ "brushSettings" | "brush_settings" => {
+ crate::brush_panel::panel_menu(app, ui);
+ ui.separator();
+ }
"actions" => {
crate::actions::panel_menu(app, ui);
ui.separator();
diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs
index 8d57c51e7..1bb5ee601 100644
--- a/crates/ui-egui/src/widgets.rs
+++ b/crates/ui-egui/src/widgets.rs
@@ -220,6 +220,25 @@ fn pro_panel(
CardResponse::new(strip_resp, mresp, tabs_out)
}
+/// The panel menu button (hamburger in Pro, ellipsis in Studio), matching the dock and cards.
+pub fn panel_menu_button(ui: &mut Ui) -> Response {
+ let t = Tokens::get(ui.ctx());
+ let size = vec2(20.0, 20.0);
+ let (rect, resp) = ui.allocate_exact_size(size, Sense::click());
+ let tint = crate::icons::button_chrome(ui, rect, false, resp.hovered());
+ if t.pro {
+ for k in 0..3 {
+ let y = rect.center().y - 3.5 + k as f32 * 3.5;
+ ui.painter().line_segment([pos2(rect.center().x - 5.0, y), pos2(rect.center().x + 5.0, y)], Stroke::new(1.0, tint));
+ }
+ } else {
+ crate::icons::paint(ui, rect, "ellipsis", 14.0, tint);
+ }
+ let tip = tl!("Panel menu");
+ resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, tip));
+ resp.on_hover_text(tip)
+}
+
pub fn pill_tab(ui: &mut Ui, label: &str, selected: bool) -> Response {
let t = Tokens::get(ui.ctx());
let font = theme::medium(12.5);