class
AButton
- Module
- Arc
- Header
#include "Arc/Widgets/AButton.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | icon, 8 px sides and a 4 px gap. | |
bool | CanCacheDesiredSize | |
bool | CanSkipArrange | |
bool | CanRetainPaint | The hover fade is a clock: while it runs, every frame's background is a different colour with nothing to invalidate on. |
ArcVec2 | ComputeDesiredSize | |
void | ArrangeChildren | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
void | OnMouseEnter | |
void | OnMouseLeave | |
const char* | GetTypeName | |
EAccessibleRole | GetAccessibleRole | |
bool | IsFocusable | |
float | GetFocusRadius | |
bool | OnActivate | |
void | SetOnClicked | |
EArcButtonVariant | GetVariant | |
void | SetLabel | |
const std::string& | GetLabel | |
void | SetIcon | A Lucide glyph (ARC_ICON_* or CArcLucideIcons::Find). |
void | SetSelected | The latched state of an icon button (a snap toggle that is on). |
bool | IsSelected | |
float | GetHoverAmount | 0..1 progress of the hover and press transitions, timed by the MowoMotion Hover and Press tokens. |
float | GetPressAmount | |
FVariantMetrics | GetVariantMetrics |
Function details
ARC_WIDGET_ARGS
C++
ARC_WIDGET_ARGS(AButton) ARC_EVENT(COnClicked, OnClicked) ARC_ATTR(ArcColor, ButtonColor) ARC_ATTR(ArcColor, HoverColor) ARC_ATTR(ArcColor, PressColor) ARC_ATTR(float, CornerRadius) ARC_ATTR(ArcMargin, ContentPadding) ARC_ARG(EArcButtonVariant, Variant) ARC_ARG(std::string, Label) ARC_ARG(std::string, Icon) ARC_ARG(bool, IsSelected) ARC_ARG(float, Height) ARC_ARG(bool, Dense) ARC_CONTENT(AButton, Content) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)icon, 8 px sides and a 4 px gap.
CanCacheDesiredSize
C++
bool CanCacheDesiredSize() const overrideCanSkipArrange
C++
bool CanSkipArrange() const overrideCanRetainPaint
C++
bool CanRetainPaint() const overrideThe hover fade is a clock: while it runs, every frame's background is a different colour with nothing to invalidate on. Settled, the tint is a pure function of the press flag and the style set, both of which announce themselves. The enter/leave handlers drop the slice so the pre-hover picture cannot come back once the fade lands.
ComputeDesiredSize
C++
ArcVec2 ComputeDesiredSize(float scale) const overrideArrangeChildren
C++
void ArrangeChildren(const CGeometry& geo) overrideOnPaint
C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseButtonDown
C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseEnter
C++
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseLeave
C++
void OnMouseLeave(const CPointerEvent& event) overrideGetTypeName
C++
const char* GetTypeName() const overrideGetAccessibleRole
C++
EAccessibleRole GetAccessibleRole() const overrideIsFocusable
C++
bool IsFocusable() const overrideGetFocusRadius
C++
float GetFocusRadius() const overrideOnActivate
C++
bool OnActivate() overrideSetOnClicked
C++
void SetOnClicked(std::function<void()> func)GetVariant
C++
EArcButtonVariant GetVariant() constSetLabel
C++
void SetLabel(const std::string& label)GetLabel
C++
const std::string& GetLabel() constSetIcon
C++
void SetIcon(const std::string& glyph)A Lucide glyph (ARC_ICON_* or CArcLucideIcons::Find).
SetSelected
C++
void SetSelected(bool selected)The latched state of an icon button (a snap toggle that is on).
IsSelected
C++
bool IsSelected() constGetHoverAmount
C++
float GetHoverAmount() const0..1 progress of the hover and press transitions, timed by the MowoMotion Hover and Press tokens.
GetPressAmount
C++
float GetPressAmount() constGetVariantMetrics
C++
static FVariantMetrics GetVariantMetrics(EArcButtonVariant variant)Generated from Arc/Widgets/AButton.h via arc.json · Nov 5, 2026Version 1.0.0