mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-27 16:59:56 +01:00
Correct the trial's comment on the recorded press
The pass records the press outside the zone it begins with, which the second menu still set in the pass it closed; the menu need not stand when the press is made. Says that, and that the record is judged against the menus the pass before showed.
This commit is contained in:
1 parent
9fc3f4ec2f
commit
7842ca5574
1 file changed
+5
-4
@@ -128,8 +128,8 @@ fn a_new_right_click_moves_an_open_context_menu_to_the_pointer() {
|
||||
|
||||
/// A right-click on a second opener while a menu is open closes that menu and opens the second one, as it does on the
|
||||
/// opener of a closed one: the press lay outside the menu it closed, not outside the menu it opened. A press is judged
|
||||
/// against the menus open when it was recorded, so a menu that appears in that same pass, after the record, is not
|
||||
/// dismissed by it.
|
||||
/// against the menus the pass before it showed: one that appears in the press's own pass comes after that record, and
|
||||
/// the press is not outside it.
|
||||
#[trial]
|
||||
fn a_right_click_on_a_second_opener_closes_the_open_menu_and_opens_its_own() {
|
||||
const FIRST: Rect = Rect { min: Pos2::new(8.0, 8.0), max: Pos2::new(200.0, 32.0) };
|
||||
@@ -156,8 +156,9 @@ fn a_right_click_on_a_second_opener_closes_the_open_menu_and_opens_its_own() {
|
||||
assert!(fixture.by_label("Second action").is_some(), "the right-click on the second target opens its menu");
|
||||
assert!(fixture.by_label("First action").is_none(), "the first menu closed");
|
||||
// A press in the pass a menu appears in: a double right-click on the first target, its second press in the frame of
|
||||
// the release that opens the first menu. That press is the frame's one press, recorded while the second menu stands;
|
||||
// the first menu appears in that same pass, after the record was made, and the press is not outside it.
|
||||
// the release that opens the first menu. That press is the frame's one press, and it lands outside the zone the
|
||||
// frame begins with, which the second menu still set in the pass it closed, so the pass records it. The first menu
|
||||
// appears in that same pass, after the record was made, and the record is not for it.
|
||||
fixture.frame(vec![pointer::moved(first)]).frame(vec![pointer::secondary(first, true)]);
|
||||
fixture.frame(vec![pointer::secondary(first, false), pointer::secondary(first, true)]).settle();
|
||||
assert!(fixture.by_label("First action").is_some(), "the press recorded in the pass the first menu appears in does not close it");
|
||||
|
||||
Reference in new issue
Block a user