Options bar: Show Transform Controls in every theme (#5740) (#5802)

The Studio, Adwaita and Breeze themes' Move tool options bar had only Auto-Select and a hint, so Show Transform Controls could not be turned on there and a click on a layer never showed its box and handles. The toggle is now in every theme, as Auto-Select is (#1275).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valentin Klein
2026-10-14 22:46:04 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent f4351cb37c
commit 2fbd171427
2 changed files with 29 additions and 0 deletions
@@ -152,6 +152,32 @@ fn every_theme_shows_the_auto_select_toggle() {
}
}
#[test]
fn every_theme_shows_the_transform_controls_toggle() {
// #5740: outside the Pro themes the Move tool's options bar had no Show Transform Controls, so
// a click on a layer never showed its box and handles there.
use egui_kittest::Harness;
use egui_kittest::kittest::Queryable;
for theme in crate::theme::ThemeKind::ALL {
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);
let before = h.state().ui.tool_options.move_show_transform;
h.get_by_label("Show Transform Controls").click();
h.run_steps(2);
assert_ne!(h.state().ui.tool_options.move_show_transform, before, "{theme:?}: the toggle flips Show Transform Controls");
}
}
#[test]
fn every_theme_shows_the_type_options() {
// #1387: outside the Pro themes the Type tool's options bar was only the hint "Click to add
+3
View File
@@ -1391,6 +1391,9 @@ pub fn options_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
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:"));
// And Show Transform Controls (#5740): without it the box could not be
// turned on outside the Pro themes.
widgets::checkbox(ui, &mut app.ui.tool_options.move_show_transform, tl!("Show Transform Controls"));
hint(ui, tl!("Drag to move the active layer"));
}
Tool::Eyedropper => crate::eyedropper_ui::options(app, ui),