fluid.scroll_frame
ScrollFrame is a container node that can be "scrolled" to display content that
can't normally fit in view.
ScrollFrame can be created using either vscrollFrame to create a vertical frame (column)
or hscrollFrame to create a horizontal frame (row).
Contents can be scrolled using mouse wheel or the included scroll bar (see
ScrollFrame.scrollBar). Keyboard users may be able to tab into the scrollbar and use arrow,
page up, and page down keys to scroll.
You can use fluid.actions.scrollToTop or fluid.actions.scrollIntoView to move child nodes
into view by calculating the right offsets. The two functions work even if multiple scroll
frames (and other scrollable nodes) are nested.
-
aliasvscrollFrame= fluid.utils.nodeBuilder!(ScrollFrame, "a").nodeBuilder;Create a new verticalScrollFramenode. The frame will display its contents in a column. -
aliashscrollFrame= fluid.utils.nodeBuilder!(ScrollFrame, (a) { a.directionHorizontal = true; } ).nodeBuilder;Create a new horizontalScrollFramenode. The frame will display its contents in a row. -
classScrollFrame: fluid.frame.Frame, fluid.input.FluidScrollable, fluid.io.hover.HoverScrollable;Theis aScrollFrameFramethat can be scrolled to display content that would not normally fit into the frame.The frame features ascrollBaron the side that can be used to control the frame using a mouse or keyboard. The frame can also be scrolled using a mouse wheel through theHoverScrollableinterface. This node only supports scrolling in one axis.-
ScrollInputscrollBar;Scrollbar node used by the frame. The scrollbar shows how far the frame has been scrolled and can be used to control the frame.A scrollbar will be provided by default but can be replaced with anotherScrollInputnode.Bugs
The scrollbar is internally used by the frame to perform calculations. The frame will malfunction if the scrollbar is hidden. See https://git.samerion.com/Samerion/Fluid/issues/495 This can be worked around by settingtoscrollBar.width0. -
ref @safe inout(float)scroll() inout; @safe floatscroll() const;Return value
Distance in pixels the node is scrolled by. ForvscrollFrame, this is distance from the top of the frame, and from the left forhscrollFrame. The value of0means the frame is currently scrolled to the very top or the very left. -
@safe floatscroll(float value);Set the scroll offset for the frame.Parameters
float valueNew scroll offset to set. Return value
The distance as passed. -
@safe voidscrollToStart();Scroll to the beginning of the node, that is, setscrollto0. -
@safe voidscrollToEnd(); -
@safe floatmaxScroll() const;Return value
The maximum value this container can be scrolled to. The frame must have beenresizedat least once for this to return a correct value, otherwise it will return0.
-