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

Freeze select box buttons position on press #29950

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

minetoblend
Copy link
Contributor

Will freeze the position of the SelectBox buttons in place when one of the buttons was clicked until the clicked button is no longer hovered. This ensures that buttons can be pressed repeatedly without having to reposition the mouse on every click.

Especially when rotating the selection by 90 degrees, the buttons moving around on each press was a major pain point for me since I often wanna rotate by 180 degrees and just wanna double click the button for that.

After:

2024-09-21.14-57-25.mp4

Before:

2024-09-21.14-58-39.mp4

@bdach
Copy link
Collaborator

bdach commented Sep 24, 2024

I can see the issue and I see some merit to this solution but I'm not 100% on the end result. The buttons moving away on hover loss feels particularly awkward.

At this point I have to wonder if these buttons have to / should be attached to the selection box. Maybe they should be somewhere off the playfield to stop visually obstructing things...?

@peppy curious to hear your thoughts on this

@bdach bdach requested a review from peppy September 24, 2024 09:05
@minetoblend
Copy link
Contributor Author

I agree that the jump back looks a bit jarring the way it suddenly teleports back right now. Do you think animating the position change would be a way to address this?

@bdach
Copy link
Collaborator

bdach commented Sep 24, 2024

I was going to suggest that but figured it'd be (a) probably rather annoying to do and (b) not even sure it'd look good. You could try, though.

@peppy
Copy link
Member

peppy commented Sep 24, 2024

I think animating them (if it's not too much effort) with a 300 ms OutQuint should look quite good. Otherwise, as-is is fine. I agree with the UX.

@minetoblend
Copy link
Contributor Author

The anchor/origin changes make it a bit tricky, but I think it should be doable. At the very least it'll be a good test for how much I learned about o!f layout internals from porting it to js. Do you want the transition to happen on every reposition or only after you stop hovering?

@peppy
Copy link
Member

peppy commented Sep 24, 2024

Do you want the transition to happen on every reposition or only after you stop hovering?

Only in the special case. But if it's more than a few lines I'd not bother.

@minetoblend
Copy link
Contributor Author

I managed to get it working, not sure if this is a good way of doing it though.

2024-09-24.16-37-40.mp4

@bdach bdach self-requested a review September 27, 2024 07:44
@bdach
Copy link
Collaborator

bdach commented Sep 27, 2024

@peppy gonna wait for your cross-check of the animation here, unless you decide you don't want to do one

@peppy
Copy link
Member

peppy commented Sep 27, 2024

I think it looks fine. Maybe it could also animate when anchor changes, but not too fussed.

@bdach bdach merged commit 766d2d2 into ppy:master Sep 27, 2024
9 of 13 checks passed
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