osu icon indicating copy to clipboard operation
osu copied to clipboard

Improve animation of new song select footer buttons (and fix "options" button behaviour)

Open frenzibyte opened this issue 1 year ago • 7 comments

  • Part of #22204
  • [x] Depends on #28141 (since FooterButtonV2 is touched in there)

Changed to match animations of ShearedButton. Not a good idea to inherit from it since the footer button designs differ from ShearedButton slightly + we don't want the scale-in effect in footer buttons.

I have also fixed the "options" button not actually hiding when pressing on it while in open state. I'm not entirely sure about my approach but, well...it works™.

Preview:

https://github.com/ppy/osu/assets/22781491/f302043f-aefa-479e-994d-b54ab5dc8ccc

frenzibyte avatar May 10 '24 05:05 frenzibyte

I have also fixed the "options" button not actually hiding when pressing on it while in open state.

When I was implementing that, I mostly was following other popovers triggered by a button (e.g. add preset button). Pressing the button while the popover is open triggers the DismissOnMouseDownContainer on PopoverContainer first then the button action which opens the popover again. I've found that behavior weird and expected toggling like done locally with options button.

Joehuu avatar May 10 '24 06:05 Joehuu

Well, yeah, that's what I'm achieving in this PR, having it not open the popover again when clicking on the button while it's already in an open state.

frenzibyte avatar May 10 '24 06:05 frenzibyte

I dunno, I didn't mind it reopening each click personally.

peppy avatar May 10 '24 15:05 peppy

Hmm, to me it's an established behaviour that clicking on anything that opens something should close it if it's already open (e.g. dropdowns, toolbar toggle buttons). In addition, keeping the behaviour as-is will already introduce an inconsistency against the "mods" button, since that also acts like a toggle (closes when clicking if open...or at least that's how it's supposed to behave).

I guess you could make the "options" button not behave like a toggle altogether, but still, it feels off to me.

frenzibyte avatar May 10 '24 16:05 frenzibyte

It's fine to change it. All the places in operating systems which had behaviour similar to how this used to behave (prior to this PR) have disappeared over the last decade so it does seem like the correct direction.

peppy avatar May 10 '24 16:05 peppy

Well, yeah, that's what I'm achieving in this PR, having it not open the popover again when clicking on the button while it's already in an open state.

What I was trying to convey is other popovers opened with buttons should also be changed to this new behavior for consistency.

keeping the behaviour as-is will already introduce an inconsistency against the "mods" button, since that also acts like a toggle (closes when clicking if open...or at least that's how it's supposed to behave

As you said here, the same applies to the add preset button and presets:

https://github.com/ppy/osu/assets/35318437/0f20da05-af2f-412e-9db6-ff38dbbeaed0

Joehuu avatar May 10 '24 18:05 Joehuu

I see. For other cases facing the same issue, I would open an issue and/or solve them separately, as long as we agree that the behaviour proposed by this PR is more correct.

frenzibyte avatar May 10 '24 18:05 frenzibyte