Skip to content

Commit

Permalink
Merge pull request 'Abandon focus stealing in FieldSlot' (#267) from …
Browse files Browse the repository at this point in the history
…field-slot-abandon into main

Reviewed-on: https://git.samerion.com/Samerion/Fluid/pulls/267
  • Loading branch information
ArthaTi authored and Gitea committed Dec 26, 2024
2 parents 925917e + 2411374 commit 9d19e62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 53 deletions.
2 changes: 2 additions & 0 deletions tests/legacy/field_slot.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Migrated
module legacy.field_slot;

import fluid;
Expand Down Expand Up @@ -45,6 +46,7 @@ unittest {
}

@("FieldSlot can take hover from non-hoverable child nodes")
@Abandoned
unittest {

import fluid.space;
Expand Down
53 changes: 0 additions & 53 deletions tests/nodes/field_slot.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,56 +38,3 @@ unittest {
.runWhileDrawing(root);

}

@("FieldSlot can \"steal\" hover from non-hoverable child nodes")
version (none) // TODO
unittest {

Label theLabel;
TextInput input;

// This time around use a vspace, so it won't trigger hover events when pressed outside
auto slot = fieldSlot!vspace(
layout!(1, "fill"),
nullTheme,
theLabel = label("Hello, World!"),
input = textInput(),
);
auto hover = hoverChain();
auto focus = focusChain();
auto root = chain(hover, focus, slot);
root.draw();

// Hover outside
hover.point(Vector2(500, 500))
.then((a) {

assert(hover.hoverOf(a.pointer) is null);
assert(!hover.isHovered(slot));

// Cannot press anything
a.press;

assert(!hover.isHovered(slot));

// Hover the label
return a.move(Vector2(5, 5));

})
.then((a) {

// Press
a.press;

return root.nextFrame;

})
.then({

// Focus should be transferred once actions have been processed
assert(focus.isFocused(input));

})
.runWhileDrawing(root);

}

0 comments on commit 9d19e62

Please sign in to comment.