class
AKeyCap
- Module
- Arc
- Header
#include "Arc/Widgets/AKeyCap.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
void | SetLabel | |
std::string | GetLabel | |
void | SetState | |
EKeyCapState | GetState | |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
bool | CanCacheDesiredSize | 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. |
bool | CanRetainPaint | 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. |
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() constSetState
C++
void SetState(EKeyCapState state)GetState
C++
EKeyCapState GetState() constComputeDesiredSize
C++
ArcVec2 ComputeDesiredSize(float scale) const overrideOnPaint
C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideCanCacheDesiredSize
C++
bool CanCacheDesiredSize() const overrideThe 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 overrideA 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 overrideGenerated from Arc/Widgets/AKeyCap.h via arc.json · Nov 5, 2026Version 1.0.0