steeffeen-zz / FancyManiaLinks

ManiaLink Framework for Object-Based XML Generation
http://steeffeen.github.io/FancyManiaLinks/
GNU General Public License v3.0
6 stars 4 forks source link

Scrollbars would be cool :) #39

Open kremsy opened 7 years ago

kremsy commented 7 years ago

Scrollbars in FML as ScriptFeature would be quite handy.

PRGfx commented 7 years ago

Out of curiosity: how would you imagine an API for that in FML? I could think of something like this, but again I don't even know how you would use this project.

$vScrollbar = new Scrollbar()
  ->setSize(4, 100)
  ->setDirection(Scrollbar::ScollDirectionVertical)
  ->setMinHandleSize(10)
  ->setValue(0.2)
  ->setDisplayAlways(true) // hide scrollbar if the content doesn't fill the container?
  ->setPosition(Scrollbar::PositionLeft); // next to container or custom coordinates

$scrollbarFeature = new ScrollbarFeature()
  ->setSize(100, 100) // containerSize
  ->setPosition(0, 0)
  ->addScrollbar($vScrollbar)
  ->addScrollbar($hScrollbar)
  ->setContent($contentFrame);

Maybe using a default vertical scrollbar if no specific one is set as this would probably be the primary usecase.

(a different approach would be to cycle through a set of records and fill them into existing controls when "scrolling" rather than sliding a frame through a clipped one)

steeffeen-zz commented 7 years ago

Well I could imagine that it could be possible to create a Frame that has a bigger "content size" than actual size, maybe by putting another bigger frame in it. The outer Frame would then display some scrollbars that make it possible to scroll through the content.

steeffeen-zz commented 7 years ago

The clipping mechanism of manialink version 3 makes this possible, without it the bigger inner Frame would still be visible completely instead of begin cut off at the edges like we need it.