From 7aef4eb4e790d2989b658dc4ad700f845c8a142c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 8 Oct 2026 18:08:51 +0000 Subject: [PATCH] Part of #1275: the Studio themes show the Move tool's Auto-Select toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Pro themes' options bar already has Photoshop's Auto-Select checkbox (and ⌘/Ctrl-click inverts it for one click), but the Studio themes showed only a hint for the Move tool, so Auto-Select could not be turned off there. Both now have the toggle. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA --- crates/ui-egui/src/move_auto_select_tests.rs | 26 ++++++++++++++++++++ crates/ui-egui/src/panels.rs | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/move_auto_select_tests.rs b/crates/ui-egui/src/move_auto_select_tests.rs index 074e60dcf3..a718762304 100644 --- a/crates/ui-egui/src/move_auto_select_tests.rs +++ b/crates/ui-egui/src/move_auto_select_tests.rs @@ -125,3 +125,29 @@ fn shift_click_adds_the_layer_under_the_pointer() { assert!(st.is_layer_selected(a) && st.is_layer_selected(b)); assert_eq!(bounds(&app, a), Rect::new(8, 8, 24, 24)); } + +#[test] +fn every_theme_shows_the_auto_select_toggle() { + // #1275: the Studio themes' options bar had only a hint for the Move tool, so Auto-Select + // could not be turned off there. + use egui_kittest::Harness; + use egui_kittest::kittest::Queryable; + for theme in [crate::theme::ThemeKind::ProMedium, crate::theme::ThemeKind::Studio] { + let (app, _, _) = app(); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 60.0)).build_ui_state( + |ui, app: &mut PhotocraftApp| { + if !ui.ctx().fonts(|f| f.families().contains(&egui::FontFamily::Name("medium".into()))) { + return; + } + crate::panels::options_bar(app, ui); + }, + app, + ); + PhotocraftApp::setup_context(&h.ctx, theme); + h.run_steps(4); + assert!(h.state().ui.tool_options.move_auto_select); + h.get_by_label("Auto-Select:").click(); + h.run_steps(2); + assert!(!h.state().ui.tool_options.move_auto_select, "{theme:?}: the toggle turns Auto-Select off"); + } +} diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index d11b103cd7..dab9af8c6d 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -841,7 +841,11 @@ pub fn options_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui) { crate::shortcuts::pretty("Shift+Alt") ), ), - Tool::Move => hint(ui, tl!("Drag to move the active layer")), + Tool::Move => { + // The Studio themes keep Photoshop's Auto-Select toggle too (#1275). + widgets::checkbox(ui, &mut app.ui.tool_options.move_auto_select, tl!("Auto-Select:")); + hint(ui, tl!("Drag to move the active layer")); + } Tool::Eyedropper => hint( ui, &crate::i18n::fmt(