Skip to content
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

Merged
merged 8 commits into from
Jan 6, 2022

Conversation

peppy
Copy link
Member

@peppy peppy commented Jan 6, 2022

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

@bdach
Copy link
Collaborator

bdach commented Jan 6, 2022

The contracted headings don't look super great:

2022-01-06-134745_120x386_scrot

Maybe they should be hidden entirely, or show only the hotkeys in contracted mode (as in, say 1-9 / Q~P respectively), and only show the full text when expanded?

@peppy
Copy link
Member Author

peppy commented Jan 6, 2022

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);
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

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).

Copy link
Member Author

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.

Copy link
Collaborator

@bdach bdach left a 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.

@bdach bdach enabled auto-merge January 6, 2022 18:01
@bdach bdach merged commit 32b6bf6 into ppy:master Jan 6, 2022
@peppy peppy deleted the editor-toolbox-expand branch January 7, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants