FXMisc / Flowless

Efficient VirtualFlow for JavaFX
BSD 2-Clause "Simplified" License
185 stars 38 forks source link

Stack items from bottom #2

Closed raniejade closed 9 years ago

raniejade commented 9 years ago

If I'm not mistaken items laid out starting from top, it would be great if we can change to behavior to start stacking from the bottom this is useful for creating a widget for displaying chat messages.

TomasMikula commented 9 years ago

Yes, items are laid out starting from top (or left for horizontal flow). There is no reason why this should not be configurable. Although it makes a difference only when the viewport is not full, in your case, only when the chat starts. Once the viewport is filled, there would be no difference.

raniejade commented 9 years ago

True, was planning to play around with it but I still have a long way to understand the source.

TomasMikula commented 9 years ago

You can now additionally specify "gravity" when creating the VirtualFlow. FRONT is the default and means top for vertical flow and left for horizontal flow. You can specify REAR to get bottom for vertical flow and right for horizontal flow. You can have a look at the commit to see what it took to implement it. Basically a bunch of helper methods whose behavior depends on gravity, and then use these new gravity aware methods in Navigator#fillViewportFrom().

raniejade commented 9 years ago

:+1: Is this included in 0.4.3?

TomasMikula commented 9 years ago

It is currently only in the 0.4.4-SNAPSHOT https://oss.sonatype.org/content/repositories/snapshots/org/fxmisc/flowless/flowless/0.4.4-SNAPSHOT/