Package me.hackware.api.gui.studio
Class StudioRowList
java.lang.Object
me.hackware.api.gui.studio.StudioRowList
The scrolling row list every Studio surface uses: full-bleed hover fills, the
row that reaches a card's bottom rounding its corners with it, and snapped
scrolling so item icons glide a pixel at a time instead of jumping by the
panel scale.
This is the chrome only — the caller draws each row's own content through a
StudioRowList.RowRenderer, and keeps its own ScrollList so the scroll
position survives between frames.
Two details are easy to get wrong and are handled here. The list's padding is baked into the scrolled content at both ends rather than insetting the viewport: insetting only moves where rows start, so the list still bottoms out flush against the card edge. And hover is tested against a row's visible slice, so a row poking above the viewport can't light up from the cursor resting on the header above it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich bottom corners the last row rounds off — whatever the surrounding card rounds.static interfaceDraws one row's content. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intdraw(UiContext ui, ScrollList scroll, int x, int y, int w, int h, int count, int rowH, StudioRowList.BottomCorners corners, StudioRowList.RowRenderer rows) Drawscountrows into the viewport, scrolled and clipped.static intThe vertical centre for a line of text in a row ofrowH.
-
Field Details
-
ROW_H
public static final int ROW_HRow stride shared by the Statistics rail, its table and the kit contents.- See Also:
-
LIST_PAD
public static final int LIST_PADPadding carried inside the scrolled content, at both ends.- See Also:
-
-
Method Details
-
draw
public static int draw(UiContext ui, ScrollList scroll, int x, int y, int w, int h, int count, int rowH, StudioRowList.BottomCorners corners, StudioRowList.RowRenderer rows) Drawscountrows into the viewport, scrolled and clipped.- Parameters:
x- /y/w/h the viewport — rows bleed to its full width- Returns:
- the hovered row index, or -1
-
textY
The vertical centre for a line of text in a row ofrowH.
-