-
Notifications
You must be signed in to change notification settings - Fork 479
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
Scrolling TabBar
#5022
base: develop
Are you sure you want to change the base?
Scrolling TabBar
#5022
Conversation
pre-commit.ci autofix |
|
3ad14dd
to
9a29562
Compare
:scroll_left_text: The text to display on the left scroll label. | ||
Defaults to "<<<". | ||
:scroll_right_text: The text to display on the right scroll label. | ||
Defaults to ">>>". |
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.
As a matter of style consistency, I don't think this should be configurable. I think players would expect this to be constant in all situations where it appears.
I also suggest making the horizontal scroll icon look more like this:
perhaps with only one left/right triangle if two triangles stacked vertically doesn't fit well. The code for that example screen is here:
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.
Ah yeah that's a much nicer symbol. Will fix!
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.
This looks awesome! Thank you!
Scrolling is very important to get right. Could you add some unit tests in test/library/gui/widgets.TabBar.lua
(need to create a new file, but can be based on test/library/gui/widgets.Scrollbar.lua
)
5e4f428
to
476cad7
Compare
476cad7
to
bc7ad5f
Compare
@myk002 Added a bunch of tests for the new scroll behavior as well as some tests for existing behavior. I think I covered pretty much everything? But let me know if you see something I missed and I'm happy to add it 😄 |
b7ef982
to
78d6a2f
Compare
TabBar
to allow tabs to be scrolled instead of wrapping by settingwrap=false
in theTabBar
attributes.wrap
defaults to true so any existing instances ofTabBar
should be unaffected (tested with launcher and control-panel and they're looking good).I made a little demo script with a scrolling TabBar alongside a wrapping one with a resizable window so the behavior can be easily tested (requires this branch). Testers should try changing
autoarrange_subviews
in the script and ensure it doesn't break things, play around with the options, and double check that existing consumers of this widget like launcher and control-panel doesn't get messed up in some way that I missed.Some notes on the expected behavior:
TabBar
with a small width, so I made it possible to customize it.