Skip to content

GaldurProgressBar

classclient onlysince 0.1.0

com.galdurstudio.galdurui.api.widget.GaldurProgressBar

Themed progress bar, with an optional text centred on it, usable in vanilla layouts.

Like GaldurScrollList, the widget keeps neither the progress nor the text: it reads them every frame from suppliers, so the bar can move every tick without being rebuilt.

Example.java
double[] progress = {0.25};column.addChild(GaldurProgressBar.of(120, () -> progress[0],        () -> Component.literal("16 / 64")));
  • Fill: left to right, a gradient from accent (redstone) to ember over the full width, so the head warms up as it moves. Sunken track (field sprite tinted background); the head column is lightened to mark the front.
  • Animation: the bar slides to its new value instead of jumping (it goes back at once, so a reset is clean), and a shine runs along the filled part while it is not full.
  • Text: centred, in text with shadow; cut with "…" when too long. Without text (null) the bar is alone.
  • Disabled (active = false): flat fill and text_muted text, no animation.

The bar is not interactive: it takes neither focus nor clicks. Height from the theme: spacing.progress_height.

public class GaldurProgressBar extends AbstractWidget
PACKAGEapi.widget
SIDEclient only
EXTENDSAbstractWidget

Constructors 1

GaldurProgressBar

protected
protected GaldurProgressBar(int width, DoubleSupplier progress, Supplier<Component> label)

Prefer of().

PARAMETERS

widthinttotal width, frame included, in pixels
progressDoubleSuppliersupplier of the progress, from 0 (empty) to 1 (full), called every frame; values outside are clamped
labelSupplier<Component>supplier of the text shown on the bar, or of null for none

Methods 4

of

static2 overloads
public static GaldurProgressBar of(int width, DoubleSupplier progress)
public static GaldurProgressBar of(int width, DoubleSupplier progress, Supplier<Component> label)

PARAMETERS

widthinttotal width, frame included, in pixels
progressDoubleSuppliersupplier of the progress, from 0 to 1, called every frame
labelSupplier<Component>supplier of the text, called every frame; null for none

RETURNSGaldurProgressBar — a progress bar without text, at (0, 0) for a layout to place

preferredWidth

static
public static int preferredWidth(Component label, int minWidth)

PARAMETERS

labelComponentthe expected text, or null for none
minWidthintminimum width, in pixels

RETURNSint — the width that shows label in full on the bar, or minWidth if larger

clicked

protected
protected boolean clicked(double mouseX, double mouseY)

A progress bar is not clickable: no sound, no mouse focus.

PARAMETERS

mouseXdouble—
mouseYdouble—

nextFocusPath

public ComponentPath nextFocusPath(FocusNavigationEvent event)

A progress bar is skipped by keyboard navigation (Tab, arrows).

PARAMETERS

eventFocusNavigationEvent—
© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyNot an official Minecraft product. Not approved by or associated with Mojang or Microsoft.