Part of #1275: the Studio themes show the Move tool's Auto-Select toggle

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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA
This commit is contained in:
Claude committed 2026-10-08 18:08:51 +00:00
1 parent e5e3e39752
commit 7aef4eb4e7
2 files changed
+31 -1

No files matched your search

@@ -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");
}
}
+5 -1
View File
@@ -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(