-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Contract editor toolboxes when not in use #16342
Conversation
That's what I meant by the weird truncation. I'm not too annoyed by it, but can try hiding if required. |
@@ -121,15 +115,13 @@ public ExpandedState State | |||
|
|||
private Drawable lastHoveredButton; | |||
|
|||
private Drawable hoveredButton => content.Children.FirstOrDefault(c => c.IsHovered); | |||
private Drawable hoveredButton => FillFlow.ChildrenOfType<OsuButton>().FirstOrDefault(c => c.IsHovered); |
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.
Not sure on the ChildrenOfType<OsuButton>()
usage here. Was generally agreed that it shouldn't be used in non-test contexts.
I'm not even too sure it needs to exist - you could generalise this to any child drawable - and even if it does need to exist, I'd prefer that it didn't perform recursive lookups.
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.
Unfortunately for the editor case, the buttons are quite deep inside the usage. Not sure there's a better way to do this.
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.
I suppose so. I guess I could look away and treat this as an exception (like the skin editor, which also uses ChildrenOfType<>()
upon double checking).
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.
I've reduced the invocations of this anyway, and added an inline comment explaining why it's there.
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.
Let's give it a go and see how users react.
Follow up to #16327. Reusing existing UX which seems like a good idea until we have something better. Truncation is a bit weird but I think it's fine for now.
20220106.211113.osu.Game.Tests.mp4