Class StudioRowList

java.lang.Object
me.hackware.api.gui.studio.StudioRowList

public final class StudioRowList extends Object
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.

  • Field Details

    • ROW_H

      public static final int ROW_H
      Row stride shared by the Statistics rail, its table and the kit contents.
      See Also:
    • LIST_PAD

      public static final int LIST_PAD
      Padding 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)
      Draws count rows 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

      public static int textY(UiContext ui, int rowY, int rowH)
      The vertical centre for a line of text in a row of rowH.