britzl / gooey

Defold GUI system
MIT License
150 stars 22 forks source link

Include handle bounds in calculation of max/min scroll length #30

Closed Jerakin closed 5 years ago

Jerakin commented 5 years ago

This would enable to user to have a dynamic scrollbar handle. Making it possible to have big handles that can been seen in for example web browser

britzl commented 5 years ago

Gooey 7.1.0 takes into account handle size when positioning the handle and calculating scroll: https://github.com/britzl/gooey/releases/tag/7.1.0

Allowing the handle to change in size depending upon amount of scrollable area needs to be added as well. Not sure how it should be done though? Should it be a function on the scrollbar instance? Should it be done manually using gui.set_size() in the theme?

Jerakin commented 5 years ago

Is there a standard for this functionality?

There are quite a lot of factors, how big is the list, what should the minimum scrollbar be, what should the maximum and so on. Because of that I think it should be done in by the user.

Increasing the size is super easy anyway.

  1. Set size of Scroll handle
  2. Call scrollbar.refresh()
britzl commented 5 years ago

Yes, you definitely got a point there. Better to let the user handle the specifics! Now that the handle bounds are taken into account I guess we can close this ticket right? Nothing else to add?

Jerakin commented 5 years ago

Yep! All done