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

Rewrite the gamebar #13768

Merged
merged 6 commits into from Sep 2, 2023
Merged

Rewrite the gamebar #13768

merged 6 commits into from Sep 2, 2023

Conversation

grorp
Copy link
Member

@grorp grorp commented Aug 29, 2023

#13761 unfortunately introduced a visual regression of the gamebar:
screenshot of bad gamebar
Notice the misaligned scroll buttons.

Originally I only wanted to fix the regression, but I ended up rewriting the gamebar / the FSTK "buttonbar" instead. Improvements:

  • Instead of using an arbitrary value, the spacing between buttons is now calculated like CSS Flexbox with justify-content: space-evenly; would calculate it (i.e. there's the same amount of space at the start of the container, between the buttons and at the end of the container).

  • The "previous" and "next" buttons now scroll by one page instead of one button. This fixes Improve main menu gamebar scrolling #11886. I'm aware that using a scroll_container has been proposed as an alternative solution, but I find it easier not to lose orientation with a pagination in this case.

  • Vertical buttonbars, an unused feature, have been removed.

  • Formspec concatenation is done using table.concat instead of ...

Here are three screenshots of the rewritten gamebar:

With multiple pages:
screenshot of new gamebar 1
screenshot of new gamebar 2

With one page:
screenshot of new gamebar 3

To do

This PR is a Ready for Review.

How to test

Look at the gamebar. Verify that it looks good, both when all games fit on one page and when there are multiple pages. Verify that the gamebar works as expected.

@rubenwardy rubenwardy added this to the 5.8.0 milestone Aug 29, 2023
@dax-er
Copy link

dax-er commented Aug 29, 2023

old multi-page (ignore font difference):
image
new multi-page:
image
The page scrolling also works.
old single page
image
new single page
image
As you can see the spacing on the left and (probably right) is slightly less than before, not sure if this was intended.

@grorp
Copy link
Member Author

grorp commented Aug 29, 2023

As you can see the spacing on the left and (probably right) is slightly less than before, not sure if this was intended.

If you mean the single-page version: Yes, that's intended.

@grorp grorp added the Feature ✨ PRs that add or enhance a feature label Aug 29, 2023
@grorp grorp requested a review from sfan5 August 30, 2023 17:37
@grorp grorp merged commit 83b85ba into minetest:master Sep 2, 2023
2 checks passed
@grorp grorp deleted the buttonbar-redo branch December 18, 2023 16:38
kawogi pushed a commit to kawogi/minetest that referenced this pull request Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug Feature ✨ PRs that add or enhance a feature Formspec @ Mainmenu One approval ✅ ◻️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve main menu gamebar scrolling
4 participants