mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Color Wheel: Show Out-of-Gamut Colors runs through the panel menu's command helper
The item called the command function directly, so it skipped the app's command entry point and an error went unreported. It now uses the same helper as the other panel menu items. The menu test checks that one command runs.
This commit is contained in:
1 parent
0cb9626d42
commit
ae34cc3e77
2 files changed
+3
-1
No files matched your search
@@ -318,7 +318,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
});
|
||||
ui.separator();
|
||||
if menu_item(ui, tl!("Show Out-of-Gamut Colors"), true, set.gamut) {
|
||||
command(app, &json!({ "gamut": !set.gamut })).ok();
|
||||
run(app, json!({ "gamut": !set.gamut }));
|
||||
}
|
||||
let on = set.sliders == Sliders::Hsl;
|
||||
if menu_item(ui, tl!("HSL Sliders"), true, on) {
|
||||
|
||||
@@ -214,9 +214,11 @@ fn the_panel_menu_switches_the_shading() {
|
||||
app,
|
||||
);
|
||||
h.run_steps(3);
|
||||
let commands = h.state().run_count;
|
||||
h.get_by_label(" Show Out-of-Gamut Colors").click();
|
||||
h.run_steps(2);
|
||||
assert!(h.state().ui.color_wheel.gamut);
|
||||
assert_eq!(h.state().run_count, commands.wrapping_add(1), "the item runs one ui.colorWheel command");
|
||||
assert!(h.query_by_label("✓ Show Out-of-Gamut Colors").is_some());
|
||||
h.get_by_label("✓ Show Out-of-Gamut Colors").click();
|
||||
h.run_steps(2);
|
||||
|
||||
Reference in new issue
Block a user