class

AKeyCap

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

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
voidSetLabel
std::stringGetLabel
voidSetState
EKeyCapStateGetState
ArcVec2ComputeDesiredSize
int32_tOnPaint
boolCanCacheDesiredSizeThe cap is as wide as its label measures, and the label attribute owns this widget, so a new label invalidates before the next pass.
boolCanRetainPaintA leaf with no hover, no focus ring and no clock: the whole picture is the label and the state, and both attributes own this widget, so a write invalidates before the next pass.
const char*GetTypeName

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(AKeyCap) ARC_ATTR(std::string, Label) ARC_ATTR(EKeyCapState, State) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetLabel

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

GetLabel

C++
std::string GetLabel() const

SetState

C++
void SetState(EKeyCapState state)

GetState

C++
EKeyCapState GetState() const

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

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

The cap is as wide as its label measures, and the label attribute owns this widget, so a new label invalidates before the next pass.

CanRetainPaint

C++
bool CanRetainPaint() const override

A leaf with no hover, no focus ring and no clock: the whole picture is the label and the state, and both attributes own this widget, so a write invalidates before the next pass. Only a bound one can change with nothing to see.

GetTypeName

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