mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
The Pro themes already had Photoshop's Auto-Select checkbox; 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]>
This commit is contained in:
1 parent
3e8d788441
commit
b3d10f9a48
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");
|
||||
}
|
||||
}
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user