Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Layers panel: the scroll wheel over the blend-mode menu steps through the modes (#1961)

Simon72cabac616c6
diff --git a/contributors/people.toml b/contributors/people.toml
index 410fe6fa1..f47928d95 100644
--- a/contributors/people.toml
+++ b/contributors/people.toml
@@ -60,3 +60,6 @@ sync_github_name = true
[people.maxm11]
sync_github_name = true
+
+[people.skraus2]
+sync_github_name = true
diff --git a/crates/ui-egui/src/blend_dropdown_wheel_tests.rs b/crates/ui-egui/src/blend_dropdown_wheel_tests.rs
new file mode 100644
index 000000000..c6b9186f8
--- /dev/null
+++ b/crates/ui-egui/src/blend_dropdown_wheel_tests.rs
@@ -0,0 +1,213 @@
+//! #1747: the scroll wheel over the Layers panel's Blend Mode dropdown steps through the modes,
+//! as in Photoshop: down picks the next mode, up the previous one, one history step per notch.
+
+use egui::accesskit::Role;
+use egui::{Pos2, Rect, vec2};
+use egui_kittest::Harness;
+use egui_kittest::kittest::Queryable;
+use photocraft_doc::BlendMode;
+use serde_json::json;
+
+use crate::PhotocraftApp;
+
+/// The app with a new document after `setup` (its last layer is the active one).
+fn harness(setup: impl FnOnce(&mut PhotocraftApp) + 'static) -> Harness<'static, PhotocraftApp> {
+ let mut h = Harness::builder().with_size(vec2(1440.0, 900.0)).with_max_steps(64).build_eframe(move |cc| {
+ PhotocraftApp::setup_context(&cc.egui_ctx, Default::default());
+ let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"width": 64, "height": 48})).unwrap();
+ setup(&mut app);
+ app
+ });
+ h.run_steps(8);
+ h
+}
+
+/// A filled pixel layer above the Background, active.
+fn pixel_layer(app: &mut PhotocraftApp) {
+ app.run("layer.new.layer", json!({})).unwrap();
+ app.run("edit.fill", json!({"color": "#cc3366"})).unwrap();
+}
+
+fn blend(h: &Harness<'_, PhotocraftApp>) -> BlendMode {
+ let st = h.state().session.active().unwrap();
+ st.doc.layer(st.active_layer.unwrap()).unwrap().blend
+}
+
+fn steps(h: &Harness<'_, PhotocraftApp>) -> usize {
+ h.state().session.active().unwrap().history.past_len()
+}
+
+/// The Layers panel's dropdown: the lowest one (the options bar and the title bar have some too).
+fn dropdown(h: &Harness<'_, PhotocraftApp>) -> Rect {
+ h.query_all_by_role(Role::ComboBox).map(|n| n.rect()).max_by(|a, b| a.top().total_cmp(&b.top())).unwrap()
+}
+
+/// `lines` wheel lines at `at` in one event: negative is down.
+fn wheel(h: &mut Harness<'_, PhotocraftApp>, at: Pos2, lines: f32) {
+ h.hover_at(at);
+ h.run_steps(1);
+ h.event(egui::Event::MouseWheel {
+ unit: egui::MouseWheelUnit::Line,
+ delta: vec2(0.0, lines),
+ phase: egui::TouchPhase::Move,
+ modifiers: Default::default(),
+ });
+ h.run_steps(3);
+}
+
+#[test]
+fn each_wheel_notch_over_the_blend_mode_dropdown_steps_one_mode_and_one_history_step() {
+ let mut h = harness(pixel_layer);
+ let at = dropdown(&h).center();
+ let undo = steps(&h);
+ assert_eq!(blend(&h), BlendMode::Normal);
+ for (n, mode) in [BlendMode::Dissolve, BlendMode::Darken, BlendMode::Multiply].into_iter().enumerate() {
+ wheel(&mut h, at, -1.0);
+ assert_eq!(blend(&h), mode, "notch {} down", n + 1);
+ assert_eq!(steps(&h), undo + n + 1, "one history step per notch");
+ }
+ wheel(&mut h, at, 1.0);
+ assert_eq!(blend(&h), BlendMode::Darken, "a notch up goes back one");
+ assert_eq!(steps(&h), undo + 4);
+}
+
+#[test]
+fn several_notches_in_one_wheel_event_record_one_history_step_per_notch() {
+ let mut h = harness(pixel_layer);
+ let at = dropdown(&h).center();
+ let undo = steps(&h);
+ wheel(&mut h, at, -3.0);
+ assert_eq!(blend(&h), BlendMode::Multiply);
+ assert_eq!(steps(&h), undo + 3, "one history step per notch");
+ h.state_mut().run("edit.undo", json!({})).unwrap();
+ h.run_steps(2);
+ assert_eq!(blend(&h), BlendMode::Darken, "undo goes back one notch");
+}
+
+#[test]
+fn the_wheel_stops_at_the_first_and_last_blend_mode() {
+ let mut h = harness(|app| {
+ pixel_layer(app);
+ let id = app.session.active().unwrap().active_layer.unwrap().0;
+ app.run("layer.setProps", json!({"layer": id, "blend": "Luminosity"})).unwrap();
+ });
+ let at = dropdown(&h).center();
+ let undo = steps(&h);
+ wheel(&mut h, at, -1.0);
+ assert_eq!((blend(&h), steps(&h)), (BlendMode::Luminosity, undo), "down on the last mode");
+ let id = h.state().session.active().unwrap().active_layer.unwrap().0;
+ h.state_mut().run("layer.setProps", json!({"layer": id, "blend": "Normal"})).unwrap();
+ h.run_steps(2);
+ let undo = steps(&h);
+ wheel(&mut h, at, 1.0);
+ assert_eq!((blend(&h), steps(&h)), (BlendMode::Normal, undo), "up on the first mode");
+}
+
+#[test]
+fn the_wheel_steps_a_group_through_its_list_with_pass_through() {
+ let mut h = harness(|app| {
+ app.run("layer.new.group", json!({})).unwrap();
+ });
+ assert_eq!(blend(&h), BlendMode::PassThrough);
+ let at = dropdown(&h).center();
+ wheel(&mut h, at, -1.0);
+ assert_eq!(blend(&h), BlendMode::Normal);
+ wheel(&mut h, at, 1.0);
+ assert_eq!(blend(&h), BlendMode::PassThrough);
+ let undo = steps(&h);
+ wheel(&mut h, at, 1.0);
+ assert_eq!((blend(&h), steps(&h)), (BlendMode::PassThrough, undo), "Pass Through is the first");
+}
+
+#[test]
+fn the_wheel_leaves_the_greyed_background_blend_mode_alone() {
+ let mut h = harness(|_| {});
+ let st = h.state().session.active().unwrap();
+ assert!(crate::doc_props_ui::is_background(&st.doc, st.doc.layer(st.active_layer.unwrap()).unwrap()));
+ let at = dropdown(&h).center();
+ let undo = steps(&h);
+ wheel(&mut h, at, -1.0);
+ wheel(&mut h, at, -1.0);
+ assert_eq!((blend(&h), steps(&h)), (BlendMode::Normal, undo));
+}
+
+fn click(h: &mut Harness<'_, PhotocraftApp>, at: Pos2) {
+ h.hover_at(at);
+ h.run_steps(1);
+ for pressed in [true, false] {
+ h.event(egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() });
+ h.run_steps(1);
+ }
+ h.run_steps(2);
+}
+
+/// Where the entry `label` of the open list is (also when it is scrolled out of sight).
+fn entry(h: &Harness<'_, PhotocraftApp>, label: &str) -> Rect {
+ h.get_by_label(label).rect()
+}
+
+#[test]
+fn the_wheel_over_the_open_list_steps_modes_instead_of_scrolling_it() {
+ let mut h = harness(pixel_layer);
+ let undo = steps(&h);
+ let at = dropdown(&h).center();
+ click(&mut h, at);
+ let (last, darken) = (entry(&h, "Luminosity"), entry(&h, "Darken").center());
+ wheel(&mut h, darken, -1.0);
+ h.run_steps(10);
+ assert_eq!((blend(&h), steps(&h)), (BlendMode::Dissolve, undo + 1), "one mode, one step");
+ assert_eq!(entry(&h, "Luminosity"), last, "the list stays open and doesn't scroll");
+}
+
+#[test]
+fn wheel_steps_in_the_open_list_keep_the_chosen_mode_in_view() {
+ let mut h = harness(pixel_layer);
+ let at = dropdown(&h).center();
+ click(&mut h, at);
+ // Unscrolled, the list shows its first entry at the top and is at most 420 pt tall.
+ let (top, darken) = (entry(&h, "Normal").top(), entry(&h, "Darken").center());
+ for _ in 0..22 {
+ wheel(&mut h, darken, -1.0);
+ }
+ h.run_steps(30);
+ assert_eq!(blend(&h), BlendMode::Divide);
+ let in_view = |r: Rect| r.top() >= top - 0.5 && r.bottom() <= top + 420.0 + 0.5;
+ let chosen = entry(&h, "Divide");
+ assert!(in_view(chosen), "{chosen:?} in view below {top}");
+ // The wheel over the button scrolls the open list along too.
+ for _ in 0..21 {
+ wheel(&mut h, at, 1.0);
+ }
+ h.run_steps(30);
+ assert_eq!(blend(&h), BlendMode::Dissolve);
+ let chosen = entry(&h, "Dissolve");
+ assert!(in_view(chosen), "{chosen:?} in view below {top}");
+}
+
+/// The mode the canvas previews on the active layer, if any (#970).
+fn previewed(h: &mut Harness<'_, PhotocraftApp>) -> Option<BlendMode> {
+ let st = h.state().session.active().unwrap();
+ let id = st.active_layer.unwrap();
+ crate::blend_preview::display_doc(h.state_mut(), 0).map(|(d, _)| d.layer(id).unwrap().blend)
+}
+
+#[test]
+fn a_wheel_step_ends_the_hover_preview_until_the_pointer_moves() {
+ let mut h = harness(pixel_layer);
+ let at = dropdown(&h).center();
+ click(&mut h, at);
+ let screen = entry(&h, "Screen").center();
+ h.hover_at(screen);
+ h.run_steps(3);
+ assert_eq!(previewed(&mut h), Some(BlendMode::Screen));
+ wheel(&mut h, screen, -1.0);
+ assert_eq!(blend(&h), BlendMode::Dissolve);
+ assert_eq!(previewed(&mut h), None, "the chosen mode shows, not the one under the pointer");
+ h.run_steps(10);
+ assert_eq!(previewed(&mut h), None, "still, while the pointer rests");
+ let multiply = entry(&h, "Multiply").center();
+ h.hover_at(multiply);
+ h.run_steps(3);
+ assert_eq!(previewed(&mut h), Some(BlendMode::Multiply), "a moved pointer previews again");
+}
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index f2bbcbd56..1da4fb55f 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -1708,6 +1708,9 @@ mod hidden_layer_tests;
#[cfg(test)]
mod blend_dropdown_keys_tests;
+#[cfg(test)]
+mod blend_dropdown_wheel_tests;
+
#[cfg(test)]
mod marquee_tests;
diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs
index ef8e71040..593d1674b 100644
--- a/crates/ui-egui/src/panels.rs
+++ b/crates/ui-egui/src/panels.rs
@@ -1642,12 +1642,13 @@ fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
let opacity_label = if t.pro { tl!("Opacity:") } else { tl!("Opacity") };
let right = (body_text_width(ui, opacity_label) + LAYER_PCT_W + 2.0 * ui.spacing().item_spacing.x + 16.0).max(150.0);
let w = ui.available_width() - right;
- let (chosen, hovered) = widgets::dropdown_hovered(ui, "blend", &mut m, &blend_options(l.is_group()), w.max(100.0));
- if chosen {
+ let (chosen, hovered) = widgets::dropdown_wheel_hovered(ui, "blend", &mut m, &blend_options(l.is_group()), w.max(100.0));
+ // One step per choice: a click, an arrow key or each wheel notch (#1747).
+ for m in &chosen {
actions.push(("layer.setProps".into(), json!({"layer": l.id.0, "blend": m.label()})));
}
// Hovering a mode previews it on the canvas (#970).
- crate::blend_preview::hover(app, l.id, hovered.filter(|_| !chosen));
+ crate::blend_preview::hover(app, l.id, hovered.filter(|_| chosen.is_empty()));
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
let mut o = l.opacity * 100.0;
let r = widgets::popup_value_field(ui, opacity_label, &mut o, 0.0..=100.0, "%", LAYER_PCT_W);
diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs
index 6a5b8966e..05c582444 100644
--- a/crates/ui-egui/src/widgets.rs
+++ b/crates/ui-egui/src/widgets.rs
@@ -422,10 +422,15 @@ pub struct RowGestures {
/// egui memory until they make whole notches (high-resolution wheels report fractions of one);
/// smooth (point) deltas count `line_scroll_speed` points per notch, like the canvas wheel.
fn wheel_notches(ui: &Ui, resp: &Response) -> f32 {
- if !resp.hovered() {
+ wheel_notches_of(ui, resp.id, resp.hovered(), 10.0)
+}
+
+/// [`wheel_notches`] of widget `id` while `hovered`, a notch with Shift counting `shift_notches`.
+fn wheel_notches_of(ui: &Ui, id: egui::Id, hovered: bool, shift_notches: f32) -> f32 {
+ if !hovered {
return 0.0;
}
- let acc_id = resp.id.with("wheel-acc");
+ let acc_id = id.with("wheel-acc");
let mut acc: f32 = ui.data(|d| d.get_temp(acc_id)).unwrap_or(0.0);
let per_line = ui.ctx().options(|o| o.input_options.line_scroll_speed);
let per_line = if per_line.is_finite() && per_line > 0.0 { per_line } else { 40.0 };
@@ -448,7 +453,7 @@ fn wheel_notches(ui: &Ui, resp: &Response) -> f32 {
};
let whole = acc.trunc();
acc -= whole;
- notches += if shift { whole * 10.0 } else { whole };
+ notches += if shift { whole * shift_notches } else { whole };
}
if !acc.is_finite() {
acc = 0.0;
@@ -822,22 +827,107 @@ pub fn dropdown<T: PartialEq + Clone>(ui: &mut Ui, id: &str, current: &mut T, op
/// [`dropdown`], also returning the option under the pointer in its open list (live previews).
pub fn dropdown_hovered<T: PartialEq + Clone>(ui: &mut Ui, id: &str, current: &mut T, options: &[(T, &str)], width: f32) -> (bool, Option<T>) {
+ let (chosen, hovered) = dropdown_with(ui, id, current, options, width, false);
+ (!chosen.is_empty(), hovered)
+}
+
+/// [`dropdown_hovered`] whose value also steps with the wheel over its button or open list: down
+/// picks the next option, up the previous one, one per notch (Shift too), stopping at the ends
+/// (Photoshop's Layers panel blend modes, #1747). The wheel then scrolls neither the list, which
+/// follows the value instead, nor what the dropdown is in. Returns every option chosen this frame
+/// in order (one per notch; the last is `current`) and the option under the pointer in the open
+/// list, none while the pointer rests where the wheel last stepped.
+pub fn dropdown_wheel_hovered<T: PartialEq + Clone>(ui: &mut Ui, id: &str, current: &mut T, options: &[(T, &str)], width: f32) -> (Vec<T>, Option<T>) {
+ dropdown_with(ui, id, current, options, width, true)
+}
+
+fn dropdown_with<T: PartialEq + Clone>(ui: &mut Ui, id: &str, current: &mut T, options: &[(T, &str)], width: f32, wheel: bool) -> (Vec<T>, Option<T>) {
let label = options.iter().find(|(v, _)| v == current).map(|(_, l)| tl!(l)).unwrap_or("—");
- let (mut changed, mut hovered) = (false, None);
+ let (mut chosen, mut hovered) = (Vec::new(), None);
+ // The wheel's notches add up over the button and the open list alike.
+ let wheel_id = ui.make_persistent_id(id).with("wheel");
+ let wheel = wheel && ui.is_enabled();
+ let (mut over_list, mut wheeled) = (false, false);
+ // A wheel step scrolls the open list to the new value: at once over the list, the next frame
+ // after a step over the button.
+ let reveal_id = wheel_id.with("reveal");
+ let mut reveal = wheel && ui.data_mut(|d| d.remove_temp::<bool>(reveal_id)).unwrap_or(false);
let response = egui::ComboBox::from_id_salt(id).selected_text(label).width(width).height(420.0).icon(chevron_icon).show_ui(ui, |ui| {
+ // Over the open list the wheel steps the value too, instead of scrolling the list.
+ over_list = wheel && ui.rect_contains_pointer(ui.clip_rect());
+ if over_list {
+ let stepped = wheel_steps(ui, wheel_id, true, current, options);
+ wheeled = !stepped.is_empty();
+ reveal |= wheeled;
+ chosen.extend(stepped);
+ }
for (v, l) in options {
let item = ui.selectable_label(v == current, tl!(l));
+ if reveal && v == current {
+ item.scroll_to_me(None);
+ }
if item.hovered() {
hovered = Some(v.clone());
}
if item.clicked() {
*current = v.clone();
- changed = true;
+ chosen.push(v.clone());
}
}
});
- let stepped = combo_box_arrow_keys(ui, &response.response, current, options);
- (changed || stepped, hovered)
+ if combo_box_arrow_keys(ui, &response.response, current, options) {
+ chosen.push(current.clone());
+ }
+ if wheel && !over_list {
+ let stepped = wheel_steps(ui, wheel_id, response.response.hovered(), current, options);
+ wheeled = !stepped.is_empty();
+ if wheeled && egui::ComboBox::is_open(ui.ctx(), response.response.id) {
+ ui.data_mut(|d| d.insert_temp(reveal_id, true));
+ }
+ chosen.extend(stepped);
+ }
+ if wheel && wheel_rests(ui, wheel_id, wheeled) {
+ hovered = None;
+ }
+ (chosen, hovered)
+}
+
+/// Whether the pointer still rests where the wheel last stepped dropdown `id` (`wheeled`: it did
+/// this frame). The option under it then isn't the one to preview: the value moved on without it.
+fn wheel_rests(ui: &Ui, id: egui::Id, wheeled: bool) -> bool {
+ let key = id.with("at");
+ let pointer = ui.input(|i| i.pointer.hover_pos());
+ if wheeled && let Some(p) = pointer {
+ ui.data_mut(|d| d.insert_temp(key, p));
+ }
+ let rests = pointer.is_some() && ui.data(|d| d.get_temp::<Pos2>(key)) == pointer;
+ if !rests {
+ ui.data_mut(|d| d.remove::<Pos2>(key));
+ }
+ rests
+}
+
+/// The options the wheel over dropdown `id` (while `hovered`) steps `current` through this frame,
+/// one per notch, in order; the last is the new `current`. While the pointer is over it the wheel
+/// scrolls nothing else.
+fn wheel_steps<T: PartialEq + Clone>(ui: &mut Ui, id: egui::Id, hovered: bool, current: &mut T, options: &[(T, &str)]) -> Vec<T> {
+ if hovered {
+ ui.input_mut(|i| i.smooth_scroll_delta = Vec2::ZERO);
+ }
+ let notches = wheel_notches_of(ui, id, hovered, 1.0);
+ let Some(mut index) = options.iter().position(|(v, _)| v == current) else { return Vec::new() };
+ let mut chosen = Vec::new();
+ // Down (negative) is the next option. No more steps than there are options.
+ for _ in 0..(notches.abs().min(options.len() as f32) as usize) {
+ let next = if notches < 0.0 { index.checked_add(1) } else { index.checked_sub(1) };
+ let Some((next, (v, _))) = next.and_then(|i| options.get(i).map(|o| (i, o))) else { break };
+ index = next;
+ chosen.push(v.clone());
+ }
+ if let Some(v) = chosen.last() {
+ *current = v.clone();
+ }
+ chosen
}
/// Give a dropdown keyboard focus when it opens, then use the arrow keys to move through its
@@ -1297,6 +1387,83 @@ mod tests {
h.run();
assert_eq!(*h.state(), 0);
}
+
+ const MODES: [(usize, &str); 4] = [(0, "Normal"), (1, "Dissolve"), (2, "Darken"), (3, "Multiply")];
+
+ /// A wheel dropdown (or a plain one) of [`MODES`], whose state is the chosen index.
+ fn mode_dropdown(wheel: bool) -> Harness<'static, usize> {
+ Harness::builder().with_size(egui::vec2(300.0, 100.0)).build_ui_state(
+ move |ui, selected: &mut usize| {
+ if wheel {
+ super::dropdown_wheel_hovered(ui, "blend-mode", selected, &MODES, 120.0);
+ } else {
+ super::dropdown(ui, "blend-mode", selected, &MODES, 120.0);
+ }
+ },
+ 0,
+ )
+ }
+
+ /// One wheel event over the dropdown: negative `delta.y` is down.
+ fn wheel<T>(h: &mut Harness<'_, T>, unit: egui::MouseWheelUnit, delta: egui::Vec2, modifiers: Modifiers) {
+ let at = h.get_by_role(egui::accesskit::Role::ComboBox).rect().center();
+ h.event(egui::Event::ModifiersChanged(modifiers));
+ h.hover_at(at);
+ h.run();
+ h.event(egui::Event::MouseWheel { unit, delta, phase: egui::TouchPhase::Move, modifiers });
+ h.run();
+ h.event(egui::Event::ModifiersChanged(Modifiers::NONE));
+ h.run();
+ }
+
+ #[test]
+ fn shift_wheel_steps_one_mode_per_notch() {
+ let mut h = mode_dropdown(true);
+ wheel(&mut h, egui::MouseWheelUnit::Line, egui::vec2(0.0, -1.0), Modifiers::SHIFT);
+ assert_eq!(*h.state(), 1, "not ten like a slider");
+ // Some systems turn Shift+wheel into a horizontal scroll.
+ wheel(&mut h, egui::MouseWheelUnit::Line, egui::vec2(-1.0, 0.0), Modifiers::SHIFT);
+ assert_eq!(*h.state(), 2);
+ }
+
+ #[test]
+ fn fractional_wheel_deltas_add_up_to_whole_mode_steps() {
+ let mut h = mode_dropdown(true);
+ wheel(&mut h, egui::MouseWheelUnit::Line, egui::vec2(0.0, -0.5), Modifiers::NONE);
+ assert_eq!(*h.state(), 0, "half a notch");
+ wheel(&mut h, egui::MouseWheelUnit::Line, egui::vec2(0.0, -0.5), Modifiers::NONE);
+ assert_eq!(*h.state(), 1);
+ let per_line = h.ctx.options(|o| o.input_options.line_scroll_speed);
+ wheel(&mut h, egui::MouseWheelUnit::Point, egui::vec2(0.0, -per_line), Modifiers::NONE);
+ assert_eq!(*h.state(), 2, "a line's worth of points is a notch");
+ }
+
+ #[test]
+ fn the_wheel_over_a_wheel_dropdown_does_not_scroll_its_container() {
+ let mut h = Harness::builder().with_size(egui::vec2(300.0, 100.0)).build_ui_state(
+ |ui, selected: &mut usize| {
+ egui::ScrollArea::vertical().max_height(80.0).show(ui, |ui| {
+ super::dropdown_wheel_hovered(ui, "blend-mode", selected, &MODES, 120.0);
+ ui.add_space(400.0);
+ });
+ },
+ 0,
+ );
+ let top = h.get_by_role(egui::accesskit::Role::ComboBox).rect().top();
+ wheel(&mut h, egui::MouseWheelUnit::Line, egui::vec2(0.0, -1.0), Modifiers::NONE);
+ for _ in 0..10 {
+ h.run();
+ }
+ assert_eq!(*h.state(), 1);
+ assert_eq!(h.get_by_role(egui::accesskit::Role::ComboBox).rect().top(), top, "the container didn't scroll");
+ }
+
+ #[test]
+ fn the_wheel_leaves_a_plain_dropdown_alone() {
+ let mut h = mode_dropdown(false);
+ wheel(&mut h, egui::MouseWheelUnit::Line, egui::vec2(0.0, -1.0), Modifiers::NONE);
+ assert_eq!(*h.state(), 0);
+ }
}
/// A compact colour popup with the shared desktop eyedropper. Keep egui's colour cache so hue
diff --git a/docs/scorecard.md b/docs/scorecard.md
index 1d65ce188..334a3b19c 100644
--- a/docs/scorecard.md
+++ b/docs/scorecard.md
@@ -9,7 +9,7 @@ Generated by `cargo xtask scorecard` from `perf/budgets.toml`, `perf/baseline.js
| [Performance](#performance) | 3 | 22 | 14 | 48 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 7 not run, 7 not measurable yet (baseline 2026-10-05) |
| [File compatibility](#file-compatibility) | 4 | 12 | 11 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 307/309; photoshop oracles: oracle ≥ 133/256, round trip ≥ 258/256 |
| [Tools](#tools) | 15 | 14 | 8 | |
-| [Workspace and UI](#workspace-and-ui) | 5 | 6 | 12 | settings that do nothing: 48 of 141 (target 0) |
+| [Workspace and UI](#workspace-and-ui) | 5 | 7 | 11 | settings that do nothing: 48 of 141 (target 0) |
| [Type](#type) | 0 | 3 | 6 | |
| [Automation](#automation) | 3 | 2 | 6 | 627 of 627 menu items live (100.0%) |
| [Reliability](#reliability) | 5 | 0 | 2 | never-crash lints on 28 of 28 crates; panic_hunt present |
@@ -181,7 +181,7 @@ Unread: `general.color_picker`, `general.beep_when_done`, `general.resize_image_
| UI-217-11 | Soft dark and soft light themes with picker previews; outlined knobs in light themes | missing | [#217](https://github.com/storytold/photocraft/issues/217) | theme.rs:28 five themes |
| UI-217-12 | Save custom New Document presets; a real Recent category | partial | [#217](https://github.com/storytold/photocraft/issues/217) | document_preset_cmds.rs and new_doc_ui.rs: named presets save/select/delete through preferences; Recent remains a static list plus Clipboard |
| UI-217-13 | Numeric fields accept arithmetic and units; scrubby labels; double-click resets a slider | partial | [#217](https://github.com/storytold/photocraft/issues/217) | widgets.rs:132 DragValue scrubs and takes + - * / arithmetic; no units in expressions, label scrub or reset |
-| UI-217-14 | Layers panel: wheel steps blend modes, drop on New/Trash duplicates/deletes, checker behind art | missing | [#217](https://github.com/storytold/photocraft/issues/217) | panels.rs:1108 plain dropdown; trash is click-only (panels.rs:1213) |
+| UI-217-14 | Layers panel: wheel steps blend modes, drop on New/Trash duplicates/deletes, checker behind art | partial | [#217](https://github.com/storytold/photocraft/issues/217) | panels.rs: the wheel steps the blend-mode dropdown (widgets::dropdown_wheel_hovered, #1747); trash is click-only, no drop on New/Trash, no checker behind art |
| UI-217-15 | Curves: smoothing / pencil mode, black/grey/white eyedroppers, tooltips | partial | [#217](https://github.com/storytold/photocraft/issues/217) | adjust_dialog.rs adds black/gray/white eyedroppers; smoothing and pencil modes remain missing |
| UI-217-16 | Hue/Saturation: Saturation and Lightness sliders get hue-following colour tracks | done | [#217](https://github.com/storytold/photocraft/issues/217) | saturation_track/lightness_track (adjust_editors.rs): grey -> the hue and black -> the hue -> white, recolouring as the Hue slider moves; saturation_and_lightness_tracks_follow_the_hue |
| UI-217-17 | Color panel: wheel plus RGB/HSB/CMYK/Lab/Gray/Web slider modes; resizes with its group | missing | [#217](https://github.com/storytold/photocraft/issues/217) | panels.rs:1837 single field + hex/RGB readout |
diff --git a/scorecard/ui.toml b/scorecard/ui.toml
index 8f9dbea0a..eca4a7d48 100644
--- a/scorecard/ui.toml
+++ b/scorecard/ui.toml
@@ -99,9 +99,9 @@ note = "widgets.rs:132 DragValue scrubs and takes + - * / arithmetic; no units i
[[item]]
id = "UI-217-14"
target = "Layers panel: wheel steps blend modes, drop on New/Trash duplicates/deletes, checker behind art"
-status = "missing"
+status = "partial"
issue = 217
-note = "panels.rs:1108 plain dropdown; trash is click-only (panels.rs:1213)"
+note = "panels.rs: the wheel steps the blend-mode dropdown (widgets::dropdown_wheel_hovered, #1747); trash is click-only, no drop on New/Trash, no checker behind art"
[[item]]
id = "UI-217-15"