Indicators
Three GTK widgets answer one question — how is it going? The progress bar for work with a measurable amount left, the level bar for a quantity that sits in a range rather than heading for 100 %, and the spinner for work whose size nobody knows. Libadwaita styles all three and adds one of its own, Spinner, which is the one to reach for in an app of your own.
Progress Bar
Section titled “Progress Bar”A bar that fills as a long operation advances. fraction is 0…1 and is clamped
there. Set pulsing instead when the work is real but its size is not — that is
GTK’s “activity mode”, where a block bounces across the trough. show-text adds a
label, which is the percentage unless you set text, and the .osd style class
turns the whole thing into the 2 px hairline that belongs under a header bar.
Level Bar
Section titled “Level Bar”How full a bounded range is — a password strength meter, a battery. The difference
from a progress bar is that the value can go down, and it is drawn in proportion
to an interval you set with min-value and max-value, not to 0…1: value 15
over 10…20 is the same bar as 0.5 over 0…1.
mode decides the shape. continuous is one filled level; discrete draws one
block per unit of the interval, which is the battery look. inverted fills from
the far end, and orientation turns the bar on its side.
The colour is not a property either. GTK keeps a sorted list of offsets — low
at 0.25, high at 0.75 and full at 1 before your code runs — and the filled block
takes a class named after the nearest one, so block.filled.low is what libadwaita
paints as a warning. Add your own offset and your own colour follows the same road.
Spinner
Section titled “Spinner”GTK’s own busy indicator: a faint ring with a quarter arc turning around it. It has exactly one property, spinning, and takes its size from its allocation, so a size request is how you make it bigger.
libadwaita replaced it with Adw.Spinner,
which breathes a variable-length arc and deliberately keeps animating when the system
asks for less motion. Gtk.Spinner does the opposite — under reduced motion it swaps
the arc for a static hourglass — so the two are not interchangeable when motion is a
concern.
Related
Section titled “Related”- Controls: the entry, the drop down, the checkbox and the switch.
- Adwaita Presentation:
Adw.Spinner, the spinner to write in a new app. - Adwaita Storybook: the same widgets in a live component browser you can poke at.