diff --git a/crates/engine/src/cmd/symmetry_cmds/preset_tests.rs b/crates/engine/src/cmd/symmetry_cmds/preset_tests.rs index cdce342336..8a66c510a9 100644 --- a/crates/engine/src/cmd/symmetry_cmds/preset_tests.rs +++ b/crates/engine/src/cmd/symmetry_cmds/preset_tests.rs @@ -160,6 +160,7 @@ fn selection_transparency_lock_and_mask_targets_apply_to_all_passes() { assert!(s.active().unwrap().doc.layer(s.active().unwrap().active_layer.unwrap()).unwrap().surface().unwrap().content_bounds().is_empty()); } + #[test] fn streaming_across_dual_axes_keeps_one_opacity_and_matches_commit() { let points = [[40.0, 30.0], [40.0, 20.0], [35.0, 20.0], [45.0, 40.0]]; diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 61ea3f4eae..6888941bfb 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -84,6 +84,7 @@ choice!( LinuxDisplayServer { Auto = "auto", X11 = "x11" } default Auto ); choice!(UiFontSize { Tiny = "tiny", Small = "small", Medium = "medium", Large = "large" } default Small); +choice!(ScrollbarVisibility { Default = "default", Always = "always", AutoHide = "autoHide", Hidden = "hidden" } default Default); choice!(LogDestination { Metadata = "metadata", TextFile = "textFile", Both = "both" } default Metadata); choice!(LogDetail { SessionsOnly = "sessionsOnly", Concise = "concise", Detailed = "detailed" } default Concise); choice!(Ask { Always = "always", Never = "never", Ask = "ask" } default Always); @@ -279,6 +280,8 @@ pub struct Interface { /// Command ids and the control protocol stay English. pub language: String, pub ui_font_size: UiFontSize, + /// Default follows the theme; other modes apply to panel and canvas scrollbars (#3262). + pub scrollbar_visibility: ScrollbarVisibility, pub show_channels_in_color: bool, pub dynamic_color_sliders: bool, /// Draw menu item colours set with Edit › Menus. @@ -324,6 +327,7 @@ impl Default for Interface { ui_scale: UiScale::Auto, language: "auto".into(), ui_font_size: UiFontSize::Small, + scrollbar_visibility: ScrollbarVisibility::Default, show_channels_in_color: false, dynamic_color_sliders: true, show_menu_colors: true, diff --git a/crates/engine/src/prefs/tests.rs b/crates/engine/src/prefs/tests.rs index 6f17a21970..bf5552fc26 100644 --- a/crates/engine/src/prefs/tests.rs +++ b/crates/engine/src/prefs/tests.rs @@ -1033,3 +1033,23 @@ fn a_wrongly_typed_section_or_colour_setting_resets_only_that_part() { assert!(s.load_prefs_json(&deep).is_ok()); assert!(s.load_prefs_json(r#"{"interface": {"theme": 3, "uiScale": [1]}, "workspaces": {"x": 1}, "menus": 1}"#).is_ok()); } + +#[test] +fn scrollbar_visibility_round_trips_and_old_preferences_keep_the_theme_default() { + let old = serde_json::from_value::(json!({"interface": {"uiFontSize": "small"}})).unwrap(); + assert_eq!(old.interface.scrollbar_visibility, ScrollbarVisibility::Default); + assert_eq!(choices("interface.scrollbarVisibility"), Some(ScrollbarVisibility::NAMES)); + let mut s = Session::new(); + for mode in ScrollbarVisibility::NAMES { + s.execute("prefs.set", json!({"values": {"interface.scrollbarVisibility": mode}})).unwrap(); + let saved = s.prefs().to_json(); + let loaded: Preferences = serde_json::from_value(saved.clone()).unwrap(); + assert_eq!(loaded.interface.scrollbar_visibility, s.prefs().interface.scrollbar_visibility); + assert_eq!(saved["interface"]["scrollbarVisibility"], json!(mode)); + } + let before = s.prefs().to_json(); + assert!(s.execute("prefs.set", json!({"values": {"interface.scrollbarVisibility": "sometimes"}})).is_err()); + assert_eq!(s.prefs().to_json(), before); + s.execute("prefs.reset", json!({"path": "interface.scrollbarVisibility"})).unwrap(); + assert_eq!(s.prefs().interface.scrollbar_visibility, ScrollbarVisibility::Default); +} diff --git a/crates/engine/src/prefs/validate.rs b/crates/engine/src/prefs/validate.rs index 37d0fdf022..64a63a6850 100644 --- a/crates/engine/src/prefs/validate.rs +++ b/crates/engine/src/prefs/validate.rs @@ -80,6 +80,7 @@ pub fn choices(path: &str) -> Option<&'static [&'static str]> { "interface.canvasBorder" => CanvasBorder::NAMES, "interface.uiScale" => UiScale::NAMES, "interface.uiFontSize" => UiFontSize::NAMES, + "interface.scrollbarVisibility" => ScrollbarVisibility::NAMES, "historyLog.destination" => LogDestination::NAMES, "historyLog.detail" => LogDetail::NAMES, "fileHandling.imagePreviews" | "fileHandling.maximizePsdCompatibility" => Ask::NAMES, diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8c9affb855..5d04f2bed0 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1656,7 +1656,13 @@ fn finish_canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, view: &mut Vie // Scrollbars (scrollbars.rs): drawn over the canvas edges, they take the pointer there. let t0 = crate::gpu_canvas::now_ms(); let before = view.center; - let over_bars = app.ui.view.shows_scrollbars() + let mode=app.session.prefs().interface.scrollbar_visibility; + let visible=match mode { + photocraft_engine::prefs::ScrollbarVisibility::Hidden=>false, + photocraft_engine::prefs::ScrollbarVisibility::AutoHide=>ui.rect_contains_pointer(rect)||ui.input(|i|i.pointer.any_down()), + _=>true, + }; + let over_bars = visible && app.ui.view.shows_scrollbars() && crate::scrollbars::show(ui, rect, view, flip, aspect, app.session.prefs().tools.overscroll, egui::Id::unique(("pc-canvas", idx))); ctx.data_mut(|d| d.insert_temp(bars_id, over_bars)); if view.center != before { diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 4ff30277c1..0b71151fd3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4271,3 +4271,4 @@ cameraRaw Dehaze Odstranění oparu Choose a custom shape file (.csh). Vyberte soubor vlastních tvarů (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Počet tvarů importovaných z {file}: {n}|Počet tvarů importovaných z {file}: {n}|Počet tvarů importovaných z {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Počet tvarů importovaných z {group}: {n}|Počet tvarů importovaných z {group}: {n}|Počet tvarů importovaných z {group}: {n} + Scrollbar Visibility Viditelnost posuvníků diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index aeb38ab56f..30ad46a03d 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3546,3 +3546,5 @@ curves Smooth Glätten Choose a custom shape file (.csh). Wählen Sie eine Datei mit eigenen Formen (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Anzahl der aus {file} importierten Formen: {n}|Anzahl der aus {file} importierten Formen: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Anzahl der aus {group} importierten Formen: {n}|Anzahl der aus {group} importierten Formen: {n} + Scrollbar Visibility Sichtbarkeit der Scrollleisten + Hidden Ausgeblendet diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index c7f6b6fe24..8cde0d875d 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4226,3 +4226,4 @@ curves Smooth Εξομάλυνση Choose a custom shape file (.csh). Επιλέξτε ένα αρχείο προσαρμοσμένων σχημάτων (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Αριθμός σχημάτων που εισήχθησαν από {file}: {n}|Αριθμός σχημάτων που εισήχθησαν από {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Αριθμός σχημάτων που εισήχθησαν από {group}: {n}|Αριθμός σχημάτων που εισήχθησαν από {group}: {n} + Scrollbar Visibility Ορατότητα γραμμών κύλισης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 0b1fe128ff..fd589da85b 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -4483,3 +4483,4 @@ navigator Zoom Zoom Choose a custom shape file (.csh). Selecciona un archivo de formas personalizadas (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Cantidad de formas importadas de {file}: {n}|Cantidad de formas importadas de {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Cantidad de formas importadas de {group}: {n}|Cantidad de formas importadas de {group}: {n} + Scrollbar Visibility Visibilidad de las barras de desplazamiento diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3de84f3f90..b1c0ce6e41 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3296,6 +3296,8 @@ curves Smooth Lisser Remember to turn off the printer's own colour management in Print Settings… Pensez à désactiver la gestion des couleurs de l’imprimante dans les paramètres d’impression… Sent to {printer} Envoyé à {printer} set in Print Settings… défini dans les paramètres d’impression… + Scrollbar Visibility Visibilité des barres de défilement + Hidden Masqué ICO is limited to 256 × 256 pixels Le format ICO est limité à 256 × 256 pixels Show Favorite Fonts Afficher les polices favorites No favorite fonts yet: click the star beside a font to add it. Aucune police favorite pour l’instant : cliquez sur l’étoile à côté d’une police pour l’ajouter. diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index fc541b2193..b79eb95f92 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -4434,3 +4434,4 @@ cameraRaw Yellow Sárga Choose a custom shape file (.csh). Válasszon egy egyéni alakzatfájlt (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} A(z) {file} forrásból importált alakzatok száma: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} A(z) {group} forrásból importált alakzatok száma: {n} + Scrollbar Visibility Görgetősávok láthatósága diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index f20eac30ac..fddc0118ca 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3546,3 +3546,5 @@ curves Smooth Haluskan Choose a custom shape file (.csh). Pilih berkas bentuk khusus (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Jumlah bentuk yang diimpor dari {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Jumlah bentuk yang diimpor dari {group}: {n} + Scrollbar Visibility Visibilitas bilah gulir + Hidden Tersembunyi diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index fe1b9c0314..f03f0dd7a8 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -4637,3 +4637,4 @@ shape Appearance Aspetto Choose a custom shape file (.csh). Scegli un file di forme personalizzate (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Numero di forme importate da {file}: {n}|Numero di forme importate da {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Numero di forme importate da {group}: {n}|Numero di forme importate da {group}: {n} + Scrollbar Visibility Visibilità delle barre di scorrimento diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index cf50109398..cdebe57aeb 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3963,6 +3963,8 @@ curves Smooth スムーズ Clear Brush Controls ブラシのコントロールを消去 Reset All Locked Settings ロックされた設定をすべて初期化 Copy Texture to Other Tools テクスチャを他のツールにコピー + Scrollbar Visibility スクロールバーの表示 + Hidden 非表示 ICO is limited to 256 × 256 pixels ICO は 256 × 256 ピクセルまでです Show Favorite Fonts お気に入りのフォントを表示 No favorite fonts yet: click the star beside a font to add it. お気に入りのフォントはまだありません。フォントの横の星をクリックして追加してください。 diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index b1e332b398..2a3f7dab03 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3744,3 +3744,5 @@ curves Smooth 매끄럽게 Choose a custom shape file (.csh). 사용자 정의 모양 파일 (.csh)을 선택하세요. @plural Imported {n} shape from {file}|Imported {n} shapes from {file} {file}에서 가져온 모양 수: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} {group}에서 가져온 모양 수: {n} + Scrollbar Visibility 스크롤 막대 표시 + Hidden 숨김 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ef7be9641f..5adf0ceba6 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4283,3 +4283,4 @@ curves Smooth Vloeiend maken Choose a custom shape file (.csh). Kies een bestand met aangepaste vormen (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Aantal uit {file} geïmporteerde vormen: {n}|Aantal uit {file} geïmporteerde vormen: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Aantal uit {group} geïmporteerde vormen: {n}|Aantal uit {group} geïmporteerde vormen: {n} + Scrollbar Visibility Zichtbaarheid van schuifbalken diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 80ccbfcbe1..e937cc45dc 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4144,3 +4144,5 @@ curves Smooth Wygładź Choose a custom shape file (.csh). Wybierz plik kształtów własnych (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Liczba kształtów zaimportowanych z {file}: {n}|Liczba kształtów zaimportowanych z {file}: {n}|Liczba kształtów zaimportowanych z {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Liczba kształtów zaimportowanych z {group}: {n}|Liczba kształtów zaimportowanych z {group}: {n}|Liczba kształtów zaimportowanych z {group}: {n} + Scrollbar Visibility Widoczność pasków przewijania + Hidden Ukryte diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 339c2a5ae3..ff7bbde9c0 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4451,3 +4451,4 @@ layerLabel No Color Sem cor Choose a custom shape file (.csh). Escolha um arquivo de formas personalizadas (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Quantidade de formas importadas de {file}: {n}|Quantidade de formas importadas de {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Quantidade de formas importadas de {group}: {n}|Quantidade de formas importadas de {group}: {n} + Scrollbar Visibility Visibilidade das barras de rolagem diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 5427f4f200..f621fb6e3b 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3253,6 +3253,8 @@ curves Smooth Сгладить Remember to turn off the printer's own colour management in Print Settings… Не забудьте отключить управление цветом самого принтера в параметрах печати… Sent to {printer} Отправлено на {printer} set in Print Settings… задаётся в параметрах печати… + Scrollbar Visibility Видимость полос прокрутки + Hidden Скрыто ICO is limited to 256 × 256 pixels ICO ограничен размером 256 × 256 пикселей Calibration Калибровка Red Primary Красный основной diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv index a3fa24d139..7f77d2cdbd 100644 --- a/crates/ui-egui/src/i18n/sr.tsv +++ b/crates/ui-egui/src/i18n/sr.tsv @@ -4313,6 +4313,7 @@ shape Appearance Izgled set in Print Settings… podešava se u podešavanjima štampanja… Paper Width Širina papira Paper Height Visina papira + Scrollbar Visibility Vidljivost traka za pomeranje ICO is limited to 256 × 256 pixels ICO je ograničen na 256 × 256 piksela Mask Options… Opcije maske… Layer Mask Display Options… Opcije prikaza maske sloja… diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 4a312f44dd..ef7eca8806 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4250,3 +4250,4 @@ cameraData Lens Lens Choose a custom shape file (.csh). Özel şekil dosyası (.csh) seçin. @plural Imported {n} shape from {file}|Imported {n} shapes from {file} {file} kaynağından içe aktarılan şekil sayısı: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} {group} kaynağından içe aktarılan şekil sayısı: {n} + Scrollbar Visibility Kaydırma çubuklarının görünürlüğü diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 5c3975ba33..77536d7d28 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -4236,3 +4236,5 @@ curves Smooth Згладити Choose a custom shape file (.csh). Виберіть файл довільних фігур (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Кількість фігур, імпортованих із {file}: {n}|Кількість фігур, імпортованих із {file}: {n}|Кількість фігур, імпортованих із {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Кількість фігур, імпортованих із {group}: {n}|Кількість фігур, імпортованих із {group}: {n}|Кількість фігур, імпортованих із {group}: {n} + Scrollbar Visibility Видимість смуг прокручування + Hidden Приховано diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 219d527f73..b3fb5d3cdb 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -158,6 +158,9 @@ # Art History Brush (#213). # Egui 0.37 migration controls (Aspect Ratio, Category, Color Table, Gamma, Interpolation, Profile, Target, Units, Demosaic) + +# Custom shape set import + Mask Options… Tùy chọn mặt nạ… Layer Mask Display Options… Tùy chọn hiển thị mặt nạ lớp… Channel Color Màu kênh @@ -3796,13 +3799,10 @@ curves Smooth Làm mượt Could not write {name}: {error} Không thể ghi {name}: {error} Kept {name}: written by another application Đã giữ {name}: do ứng dụng khác ghi Shadow Tint Sắc độ bóng tối - -# Custom shape set import Import Shapes… Nhập hình dạng… Choose a custom shape file (.csh). Chọn tệp hình dạng tùy chỉnh (.csh). @plural Imported {n} shape from {file}|Imported {n} shapes from {file} Số hình dạng đã nhập từ {file}: {n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} Số hình dạng đã nhập từ {group}: {n} - Check for Updates… Kiểm tra bản cập nhật… PhotoCraft Updates Bản cập nhật PhotoCraft Checking for updates… Đang kiểm tra bản cập nhật… @@ -4026,3 +4026,5 @@ curves Smooth Làm mượt Select and Mask was closed: its document is no longer the active one Đã đóng Chọn và Mặt nạ: tài liệu của nó không còn là tài liệu đang hoạt động Select and Mask was closed: another layer was selected Đã đóng Chọn và Mặt nạ: một lớp khác đã được chọn Select Layer Under Cursor Chọn lớp dưới con trỏ + Scrollbar Visibility Hiển thị thanh cuộn + Hidden Ẩn diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 3f035f5d30..49e0dd5a3b 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3207,3 +3207,5 @@ curves Smooth 平滑 Choose a custom shape file (.csh). 请选择自定义形状文件 (.csh)。 @plural Imported {n} shape from {file}|Imported {n} shapes from {file} 从 {file} 导入的形状数量:{n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} 从 {group} 导入的形状数量:{n} + Scrollbar Visibility 滚动条可见性 + Hidden 隐藏 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1f7673b6fa..38cc69e833 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3163,3 +3163,5 @@ curves Smooth 平滑 Choose a custom shape file (.csh). 請選擇自訂形狀檔案 (.csh)。 @plural Imported {n} shape from {file}|Imported {n} shapes from {file} 從 {file} 匯入的形狀數量:{n} @plural Imported {n} shape from {group}|Imported {n} shapes from {group} 從 {group} 匯入的形狀數量:{n} + Scrollbar Visibility 捲軸可見性 + Hidden 隱藏 diff --git a/crates/ui-egui/src/prefs/prefs_ui/fields.rs b/crates/ui-egui/src/prefs/prefs_ui/fields.rs index 2258a3f7be..3bcbce3ec3 100644 --- a/crates/ui-egui/src/prefs/prefs_ui/fields.rs +++ b/crates/ui-egui/src/prefs/prefs_ui/fields.rs @@ -34,6 +34,7 @@ pub(super) fn humanize(key: &str) -> String { "darkTheme" => return "Dark Theme".into(), "lightTheme" => return "Light Theme".into(), "automaticallyCheckUpdates" => return "Automatically Check for Updates".into(), + "scrollbarVisibility" => return "Scrollbar Visibility".into(), _ => {} } // These controls appear only for WebP, so reuse the existing translated labels. @@ -96,6 +97,7 @@ pub(super) fn humanize(key: &str) -> String { pub(super) fn choice_label(v: &str) -> String { match v { + "autoHide" => "Auto Hide".into(), "exr" => "EXR".into(), "cm" => "Centimeters".into(), "mm" => "Millimeters".into(), diff --git a/crates/ui-egui/src/prefs/prefs_ui/save.rs b/crates/ui-egui/src/prefs/prefs_ui/save.rs index 9dba6f78f2..120a0e3991 100644 --- a/crates/ui-egui/src/prefs/prefs_ui/save.rs +++ b/crates/ui-egui/src/prefs/prefs_ui/save.rs @@ -11,6 +11,7 @@ pub fn tick(app: &mut PhotocraftApp, ctx: &egui::Context) { sync_rulers(app); sync_display_scale(app, ctx); sync_appearance(app, ctx); + crate::theme::sync_scrollbars(ctx, app.session.prefs().interface.scrollbar_visibility); crate::theme::set_ui_font_size(ctx, app.session.prefs().interface.ui_font_size); presets_store(app); sync_tooltips(app, ctx); diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 2c08f63faa..d5825858d0 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -1099,6 +1099,48 @@ pub fn apply(ctx: &egui::Context, kind: ThemeKind) { let style = ctx.global_style(); ctx.set_style_of(egui::Theme::Light, Arc::clone(&style)); ctx.set_style_of(egui::Theme::Dark, style); + ctx.data_mut(|d| d.remove::(egui::Id::unique("pc-scrollbar-visibility"))); +} + +/// Apply the saved override once per change, including after a theme switch. +pub(crate) fn sync_scrollbars(ctx: &egui::Context, mode: photocraft_engine::prefs::ScrollbarVisibility) { + use photocraft_engine::prefs::ScrollbarVisibility; + let id = egui::Id::unique("pc-scrollbar-visibility"); + if ctx.data(|d| d.get_temp::(id)) == Some(mode) { + return; + } + let t = Tokens::get(ctx); + let mut scroll = match mode { + ScrollbarVisibility::Always => egui::style::ScrollStyle::solid(), + ScrollbarVisibility::AutoHide | ScrollbarVisibility::Hidden => egui::style::ScrollStyle::floating(), + ScrollbarVisibility::Default if t.bevel => egui::style::ScrollStyle::solid(), + ScrollbarVisibility::Default => egui::style::ScrollStyle::thin(), + }; + if scroll.floating { + scroll.interact_handle_opacity = 1.0; + scroll.interact_background_opacity = 0.4; + if mode == ScrollbarVisibility::Default { + scroll.floating_width = 4.0; + } + } + if mode == ScrollbarVisibility::Hidden { + scroll.bar_width = 0.0; + scroll.floating_width = 0.0; + scroll.floating_allocated_width = 0.0; + scroll.bar_inner_margin = 0.0; + scroll.bar_outer_margin = 0.0; + scroll.dormant_handle_opacity = 0.0; + scroll.active_handle_opacity = 0.0; + scroll.interact_handle_opacity = 0.0; + scroll.dormant_background_opacity = 0.0; + scroll.active_background_opacity = 0.0; + scroll.interact_background_opacity = 0.0; + } + ctx.global_style_mut(|s| s.spacing.scroll = scroll); + let style = ctx.global_style(); + ctx.set_style_of(egui::Theme::Light, Arc::clone(&style)); + ctx.set_style_of(egui::Theme::Dark, style); + ctx.data_mut(|d| d.insert_temp(id, mode)); } /// Seconds the pointer rests on a control before its tooltip shows. diff --git a/crates/ui-egui/src/theme/tests.rs b/crates/ui-egui/src/theme/tests.rs index d869649853..45840eee4a 100644 --- a/crates/ui-egui/src/theme/tests.rs +++ b/crates/ui-egui/src/theme/tests.rs @@ -1,5 +1,57 @@ use super::*; +#[test] +fn scrollbar_visibility_applies_in_every_theme_and_survives_theme_changes() { + use photocraft_engine::prefs::ScrollbarVisibility as Mode; + let ctx = egui::Context::default(); + for kind in ThemeKind::ALL { + apply(&ctx, kind); + let original = ctx.global_style().spacing.scroll; + sync_scrollbars(&ctx, Mode::Default); + assert_eq!(ctx.global_style().spacing.scroll, original); + sync_scrollbars(&ctx, Mode::Always); + assert!(!ctx.global_style().spacing.scroll.floating); + assert!(ctx.global_style().spacing.scroll.bar_width > 0.0); + sync_scrollbars(&ctx, Mode::AutoHide); + assert!(ctx.global_style().spacing.scroll.floating); + assert_eq!(ctx.global_style().spacing.scroll.dormant_handle_opacity, 0.0); + sync_scrollbars(&ctx, Mode::Hidden); + assert_eq!(ctx.global_style().spacing.scroll.bar_width, 0.0); + apply(&ctx, kind); + sync_scrollbars(&ctx, Mode::Hidden); + assert_eq!(ctx.global_style().spacing.scroll.bar_width, 0.0, "theme changes retain the saved override"); + sync_scrollbars(&ctx, Mode::Default); + assert_eq!(ctx.global_style().spacing.scroll, original); + } +} + +#[test] +fn hidden_scrollbars_keep_wheel_scrolling_available() { + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(300.0, 120.0)).build_ui_state( + |ui, offset: &mut f32| { + let area = egui::ScrollArea::vertical().max_height(100.0).show(ui, |ui| { + for i in 0..30 { + ui.label(format!("Row {i}")); + } + }); + *offset = area.state.offset.y; + }, + 0.0, + ); + sync_scrollbars(&h.ctx, photocraft_engine::prefs::ScrollbarVisibility::Hidden); + h.run(); + h.hover_at(egui::pos2(30.0, 40.0)); + h.event(egui::Event::MouseWheel { + unit: egui::MouseWheelUnit::Line, + delta: egui::vec2(0.0, -3.0), + phase: egui::TouchPhase::Move, + modifiers: egui::Modifiers::NONE, + }); + h.run(); + assert!(*h.state() > 0.0); + assert_eq!(h.ctx.global_style().spacing.scroll.allocated_width(), 0.0); +} + fn text_sizes(ctx: &egui::Context) -> Vec { let mut sizes = Vec::new(); // The plugin queues changed fonts at the end of a pass; egui applies them next pass. diff --git a/docs/gaps.md b/docs/gaps.md index 4ef74c97d1..b119ba4eda 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -283,6 +283,8 @@ what an agent can't finish alone. - **Progress (2026-10-14, #5556):** Character and Paragraph controls stay available without a type target, editing persisted Type tool defaults inherited by new text. Formatting existing selected text keeps its current command and undo scope. Other panel gaps remain open. +- **Progress (2026-10-13):** scrollbar visibility can follow the theme, stay expanded, auto-hide + or be hidden; panel and canvas scrolling remain available (#3262). - **Progress (2026-10-12):** toolbar tool shortcuts can be reassigned, removed and reset (#4086), with saved bindings, matching toolbar hints and regression coverage (`ui-egui/src/tool_shortcuts.rs`). - **Progress (2026-10-15):** the Color panel has Photoshop's panel-menu modes (Hue Cube, Brightness @@ -469,6 +471,7 @@ what an agent can't finish alone. | 2026-10-13 | minor | G14: lossy DNG (#5112), `.xmp` sidecars, Camera Raw Defaults wired, Calibration panel and Auto; CR3 sensor decode ruled out under the clean-room rule | | 2026-10-13 | minor | G4: Hue Jitter amount-track appearance (#3825, partial); no readiness percentage or estimate changed | | 2026-10-13 | minor | G2: Content-Aware Scale (P28) measured: carve 2013 → 556 ms, row 3.28 → 1.64 s on a 4-core VM, output unchanged; baseline, budgets and estimate unchanged | +| 2026-10-13 | minor | Scrollbar visibility preference for panels and the canvas (#3262), with live application, theme retention and wheel-scrolling coverage | | 2026-10-13 | minor | G4: minimum inputs in Shape Dynamics and Transfer follow their Control (#3825, partial); no readiness percentage or estimate changed | | 2026-10-12 | minor | G5: Free Transform options bar H/V skew fields done | | 2026-10-12 | minor | G11: `.atn` import maps 112 events (Select and Mask, Spatter, Ripple, Crystallize, Pattern Fill, mask targeting, Step Backward, points, Bitmap) | diff --git a/docs/ui-design.md b/docs/ui-design.md index 58e07207f1..71887e89bd 100644 --- a/docs/ui-design.md +++ b/docs/ui-design.md @@ -166,6 +166,12 @@ On Windows and Linux, System Title Bar displays “Applies at next launch.” be including before editing and after Apply. Saving this preference does not restart the app or change the current window's decorations; the next launch reads the saved choice. +Interface → Scrollbar Visibility applies immediately. Default follows the selected theme. +Always keeps scrollbars expanded when the content needs them; Auto Hide uses overlay bars +that appear while hovering or scrolling. Hidden removes the bars while keeping wheel, +trackpad and keyboard scrolling available. The setting also applies to the canvas in +Standard Screen Mode and survives restarts and theme changes (#3262). + ## High DPI and 4K displays Edit → Preferences → Interface → UI Scale applies immediately. Auto follows the operating diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 8ee8d08838..f462468ec6 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -170,6 +170,7 @@ Triangle and Curvature Pen (minus legacy Rounded Rectangle and Targeted Adjustme | Ruler corner and gaps drawn as Photoshop | partial | #2600, #2601, #2551 | | Guides stored as f64 | missing | `Vec` (UI-217-20) | | Geometry precision | partial | `geom::Point` f64, paths f64; paint internals mostly f32 | +| Scrollbar visibility preference | done | Default, Always, Auto Hide and Hidden apply to panels and the canvas; live settings, theme changes and scrolling are covered (#3262) | | Numeric fields: arithmetic, scrubby labels | partial | units in expressions and double-click reset missing (UI-217-13) | | Wheel steps a value field, ⇧ ×10: clicked into, wherever the pointer is; not clicked, a gesture that starts over it | partial | `field_wheel.rs` (#5473, #4061). Photoshop: a field takes the wheel once clicked into (shortcut guides, user reports); whether the pointer must stay over it is unconfirmed. Stepping on hover alone is Photopea's, kept deliberately | | Type options bar: drag the "T" icon to change the font size | done | `type_tool.rs` `options_bar`: the icon scrubs the size field like the Character panel's icons (Shift x10, Alt fine), at layer or selection scope, one history step per drag, within 1–1296 pt (#6437) | @@ -286,6 +287,7 @@ Paragraph; the rest open as in-app floating windows. | 2026-10-14 | minor | ⌥ while dragging a guide turns it horizontal ↔ vertical, as in Photoshop; a guide dropped on either ruler is deleted (#5034) | | 2026-10-13 | minor | Stale "missing tool" rows corrected against main: Color Replacement (`paint.colorReplacement`), Red Eye (`paint.redEye`) and Add/Delete Anchor Point (the P flyout cycle) are live toolbar tools, so only Art History Brush is missing; no percentage or estimate changed | | 2026-10-13 | minor | Smart object perspective (non-affine) corrected to done: #426 landed four-corner placements with PSD round trip; scorecard FILE-215-6 flipped | +| 2026-10-13 | minor | Scrollbar visibility preference for panels and the canvas (#3262), with live application, theme retention and wheel-scrolling coverage | | 2026-10-10 | major | First version, from a source audit against Photoshop 2026 27.11.0's shortcuts file and the open issues | | 2026-10-12 | minor | New Group button groups two or more selected layers (CC 2014+); New Group dialog (Layer › New, Layers panel menu, row menu, ⌥-click); ⌘-click New Group adds the group below; groups made from layers start collapsed (#2561) | | 2026-10-12 | minor | New layers go into an open active group (or the artboard their content is on) and join the clip group they land in (#2203); ⌘-click New Layer adds below |