Skip to main content

ScrollBar class

Namespace: Arlecchino.Widgets.Lists · Assembly: Arlecchino

The bar down the side of a list that shows how much of it is in view and where. Drawn only when there is more than fits, so a short list keeps its full width.

public static class ScrollBar

Methods

MemberSummary
Draw(SurfaceRegion, int, int, IArlecchinoColor)Draws the bar down the last column of a region. The thumb is at least one cell tall and touches an end only when the list does.
IsNeeded(int, int)Whether a list of this length needs a bar at all, which is also whether a column has to be kept free for it.

Methods in detail

Draw(SurfaceRegion, int, int, IArlecchinoColor)

public static void Draw(SurfaceRegion region, int first, int total, IArlecchinoColor? style = null);

Draws the bar down the last column of a region. The thumb is at least one cell tall and touches an end only when the list does.

Parameters

NameTypeDescription
regionSurfaceRegionWhere the rows were drawn; the last column is used.
firstintIndex of the first item on screen.
totalintHow many items there are.
styleIArlecchinoColorColor of the thumb. Defaults to the theme's active color.

IsNeeded(int, int)

public static bool IsNeeded(int total, int rows);

Whether a list of this length needs a bar at all, which is also whether a column has to be kept free for it.

Parameters

NameTypeDescription
totalintHow many items there are.
rowsintHow many rows they are drawn into.

Returns booltrue when some of the list is out of view.