GaldurTabs
classclient uniquementdepuis 0.1.0com.galdurstudio.galdurui.api.widget.GaldurTabs
Pas encore traduit : texte d’origine en anglais.
Themed row of tabs, usable in vanilla layouts. The player switches tab with a click, or with the left and right arrows.
Like GaldurScrollList, the widget does not keep the active tab: it reads it
every frame from a supplier and reports the tab the player picks. Showing the matching
content is up to the caller; in a GaldurWindow, addTabs() does it.
List<Component> titles = List.of(Component.literal("Storage"), Component.literal("Crafting"));int[] active = {0};column.addChild(GaldurTabs.of(titles, () -> active[0], index -> active[0] = index));- Active tab:
tab_selectedsprite tintedaccent, joined to the bottom line of the same colour. - Other tabs: lower,
tabsprite tintedsurface,text_mutedtext; the tint moves towards the accent on hover. - Keyboard: left and right arrows while the row has focus; the active tab
is then outlined in
accent_hover. - Disabled (
active = false): muted colours, no click or arrows.
Sizes from the theme: spacing.tab_height and spacing.tab_padding_x. The
width can exceed the tabs' (see of()): the bottom
line then runs the full width and the tabs stay on the left.
Constructeurs 1
GaldurTabs
protectedPrefer of().
PARAMÈTRES
Méthodes 4
of
static2 surchargesPARAMÈTRES
RENVOIEGaldurTabs — a tab row just wide enough for its titles, at (0, 0) for a layout to place
preferredWidth
staticPARAMÈTRES
RENVOIEint — the width that shows all tabs side by side, gaps included
getTitles
RENVOIEList<Component> — the tab titles, read-only
clicked
protectedOnly a click on a tab counts: no sound or focus on the line or the empty space.
PARAMÈTRES