mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-14 19:26:51 -04:00
Brush: the Mode dropdown shows in every theme, not only Pro (#4537)
* Brush: the Mode dropdown shows in every theme, not only Pro (fixes #4512) * Options bar scroll test: wheel over Studio's bar clear of the Brush Mode dropdown The Brush's new Mode dropdown takes the wheel to step through blend modes, so the test's pointer at the bar's centre landed on it at 800 px in Studio. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Brandon Thomas <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2 files changed
+27
-1
No files matched your search
@@ -379,6 +379,26 @@ fn options_bar_edits_are_one_set_brush_per_gesture() {
|
||||
assert_eq!(s.tools.brush, h.state().session.tools.brush);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn brush_mode_dropdown_shows_outside_the_pro_themes() {
|
||||
// #4512: only the Pro themes drew the Brush's Mode; the Pencil has it in every theme.
|
||||
use egui_kittest::kittest::{NodeT, Queryable};
|
||||
let mut h = options_bar_harness(crate::state::Tool::Brush);
|
||||
let n = h.state().session.journal.len();
|
||||
assert!(h.query_by_label("Mode").is_some(), "the Brush's Mode label");
|
||||
h.get_all_by_role(egui::accesskit::Role::ComboBox)
|
||||
.find(|c| c.accesskit_node().value().as_deref() == Some("Normal"))
|
||||
.expect("the Brush's Mode dropdown")
|
||||
.click();
|
||||
h.run();
|
||||
h.key_press(egui::Key::ArrowDown);
|
||||
h.run_steps(3);
|
||||
assert_eq!(h.state().session.tools.brush.mode, photocraft_doc::BlendMode::Dissolve);
|
||||
let j = &h.state().session.journal;
|
||||
assert_eq!(j.len(), n + 1, "{:?}", &j[n..]);
|
||||
assert_eq!(j[n].0, "tools.setBrush");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn airbrush_smoothing_options_and_symmetry_buttons_work() {
|
||||
// #1177: in the default (Photoshop) theme these options-bar buttons did nothing.
|
||||
|
||||
@@ -1062,6 +1062,10 @@ pub fn options_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
|
||||
widgets::vline(ui, 22.0);
|
||||
if app.ui.tool == Tool::Eraser {
|
||||
crate::eraser_ui::mode_dropdown(ui, &mut app.ui.tool_options.eraser_mode);
|
||||
} else {
|
||||
opt_label(ui, tl!("Mode"));
|
||||
let held = app.held_erase;
|
||||
paint_mode_dropdown(ui, "brush-mode", b, &mut app.ui.tool_options.brush_clear, held);
|
||||
}
|
||||
// A Pencil-mode Eraser is always hard and at full flow (Photoshop).
|
||||
let fixed = block || crate::eraser_ui::pencil_mode(app, app.ui.tool);
|
||||
@@ -5853,7 +5857,9 @@ mod compact_visual_regressions {
|
||||
egui::RawInput {
|
||||
time: Some(f64::from(frame) * 0.1),
|
||||
events: vec![
|
||||
egui::Event::PointerMoved(pos2(width * 0.5, 20.0)),
|
||||
// Studio: above the controls, clear of the Brush's Mode dropdown, which takes the wheel
|
||||
// to step through blend modes (#4512).
|
||||
egui::Event::PointerMoved(if Tokens::get(&ctx).pro { pos2(width * 0.5, 20.0) } else { pos2(width * 0.5, 2.0) }),
|
||||
egui::Event::MouseWheel {
|
||||
unit: egui::MouseWheelUnit::Point,
|
||||
delta: vec2(-1500.0, 0.0),
|
||||
|
||||
Reference in new issue
Block a user