-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove overrides of PopIn/PopOut in FocusedOverlayContainer #5834
Conversation
public abstract partial class Popover : OverlayContainer | ||
{ | ||
protected override bool BlockPositionalInput => true; | ||
|
||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Body.ReceivePositionalInputAt(screenSpacePos) || Arrow.ReceivePositionalInputAt(screenSpacePos); | ||
|
||
public override bool HandleNonPositionalInput => State.Value == Visibility.Visible; | ||
|
||
public override bool RequestsFocus => State.Value == Visibility.Visible; | ||
|
||
public override bool AcceptsFocus => State.Value == Visibility.Visible; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of an odd change.
Since PopOver
was overriding PopIn
/PopOut
and FocusedOverlayContainer
used those methods for automatic getting focus, it meant that PopOver
would never automatically gain focus when shown.
Since moving the focus gain to UpdateState
in FocusedOverlayContainer
, this changed the focus behaviour of PopOver
and broke tests.
The solution here is to not inherit from FocusedOverlayContainer
and allow PopOver
to manage it's own focus state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks logical
…`abstract` change See ppy/osu-framework#5834
osu! side changes: ppy/osu#23882 Will wait for one more review on this one. |
…`abstract` change See ppy/osu-framework#5834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sane
…`abstract` change See ppy/osu-framework#5834
…`abstract` change See ppy/osu-framework#5834
…`abstract` change See ppy/osu-framework#5834
…`abstract` change See ppy/osu-framework#5834
Resolves #5621
Moves focus logic outside of
PopIn
/PopOut
methods inFocusedOverlayContainer
Forces non-abstract inheritors of
FocusedOverlayContainer
to correctly implement these methods.Breaking changes
Subclasses of
FocusedOverlayContainer
must now implementPop{In,Out}()
Previously, subclasses of
FocusedOverlayContainer
were not forced to implementPop{In,Out}
themselves, despite actually needing to do so for the overlay to actually play transitions out correctly. This has now been changed and inheritors of the class must always implementPop{In,Out}
.In practice this should not break any reasonable consumers of the class, except for the need to remove any
base.Pop{In,Out}()
calls in classes that directly inheritFocusedOverlayContainer
and call base inPop{In,Out}()
.