Button¶
A standard themed, clickable button.
Renders the themed texture state (TextureStates.DEFAULT/TextureStates.FOCUSED/ TextureStates.CLICKED/TextureStates.DISABLED) behind content, animating a 1px press offset while held. For fully custom visuals, use ButtonCore directly instead.
Parameters¶
-
onClick: Invoked with the receiving
UINodewhen the button is pressed. -
modifier: Additional modifiers applied to the outer clickable container.
-
enabled: When
false, the disabled state is drawn and pointer events are ignored. -
texture: The themed texture key to look up via
LocalTheme. -
variant: The theme variant of
textureto use. SeeThemeVariants. -
ignoreMinSize: Lets a
modifiersize this button below what its theme declares as a minimum - seeintrinsicSizeModifier. Without it the theme's floor and the caller's size become amin > maxconstraint and the button does not lay out at all, which reads as it simply not drawing. The theme's own content padding is dropped along with the minimum: a theme sizes that padding for a button of its intended size, and four pixels either side of an eight-pixel one leaves the content none at all. A button this small is expected to hold a scaled glyph rather than a label, so it is the caller's business how tightly it sits. -
content: The button's foreground content (e.g. a
net.kernelpanicsoft.archie.gui.composables.basic.Text).