class

AToolbarButton

Module
Arc
Header
#include "Arc/Widgets/AToolbar.h"
Namespace
Arcf

Properties

TypeNameDescription
std::function<void()>OnClickedThe body of the button (or of a split one) was clicked.
std::function<void(const ArcRect&)>OnMenuThe chevron of a split (or chevron-only) button asks for its menu; the rect is the button's, for anchoring the menu under it.

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
voidSetSelected
boolIsSelected
voidSetLabel
const std::string&GetLabel
voidSetIcon
floatGetHeightHeight of the button: 28, or 24 for the viewport-overlay variant.
floatGetIconSizeIcon size: 16, or 14 for the viewport-overlay variant.
voidSetMinWidthA floor under the measured width (the viewport options button is as wide as its labelled neighbours' padding makes it in the design).
FArcToolbarButtonPaintPaintFrameFrames rect as a toolbar button in the given state and answers the colours its content takes — the paint the editor's own custom toolbar shares, so both look the same.
ArcVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
voidOnMouseEnter
voidOnMouseLeave
boolIsFocusable
boolOnActivate
floatGetFocusRadius
boolCanCacheDesiredSize
EAccessibleRoleGetAccessibleRole
const char*GetTypeName

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(AToolbarButton) ARC_ARG(std::string, Icon) ARC_ARG(std::string, Label) ARC_ARG(bool, NumericLabel) ARC_ARG(bool, Chevron) ARC_ARG(bool, Split) ARC_ARG(bool, IsSelected) ARC_ARG(bool, Overlay) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetSelected

C++
void SetSelected(bool selected)

IsSelected

C++
bool IsSelected() const

SetLabel

C++
void SetLabel(const std::string& label)

GetLabel

C++
const std::string& GetLabel() const

SetIcon

C++
void SetIcon(const std::string& glyph)

GetHeight

C++
float GetHeight() const

Height of the button: 28, or 24 for the viewport-overlay variant.

GetIconSize

C++
float GetIconSize() const

Icon size: 16, or 14 for the viewport-overlay variant.

SetMinWidth

C++
void SetMinWidth(float width)

A floor under the measured width (the viewport options button is as wide as its labelled neighbours' padding makes it in the design).

PaintFrame

C++
static FArcToolbarButtonPaint PaintFrame(CArcUIRenderer& renderer, const ArcRect& rect, bool enabled, bool hovered, bool pressed, bool selected, float opacity)

Frames rect as a toolbar button in the given state and answers the colours its content takes — the paint the editor's own custom toolbar shares, so both look the same.

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseEnter

C++
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) override

OnMouseLeave

C++
void OnMouseLeave(const CPointerEvent& event) override

IsFocusable

C++
bool IsFocusable() const override

OnActivate

C++
bool OnActivate() override

GetFocusRadius

C++
float GetFocusRadius() const override

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

GetAccessibleRole

C++
EAccessibleRole GetAccessibleRole() const override

GetTypeName

C++
const char* GetTypeName() const override
Generated from Arc/Widgets/AToolbar.h via arc.json · Nov 5, 2026Version 1.0.0