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
| Member | Summary |
|---|---|
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
| Name | Type | Description |
|---|---|---|
region | SurfaceRegion | Where the rows were drawn; the last column is used. |
first | int | Index of the first item on screen. |
total | int | How many items there are. |
style | IArlecchinoColor | Color 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
| Name | Type | Description |
|---|---|---|
total | int | How many items there are. |
rows | int | How many rows they are drawn into. |
Returns bool — true when some of the list is out of view.