class
MChip
- Module
- Miri
- Header
#include "Miri/Widgets/MChip.h"- Namespace
Miri
Properties
| Type | Name | Description |
|---|---|---|
MiriDelegate<void(bool)> | OnToggled | Fires when a click toggles the chip. |
Public functions
| Returns | Name | Description |
|---|---|---|
MIRI_WIDGET_ARGS | ||
void | Construct | |
void | SetLabel | |
const std::string& | GetLabel | |
void | SetIcon | A Lucide glyph for the toggle chip's icon slot. |
void | SetSwatch | |
void | ClearSwatch | |
void | SetVariant | |
EMiriChipVariant | GetVariant | |
void | SetSelected | |
bool | IsSelected | |
void | SetHasError | |
EVisualState | GetVisualState | The state the paint resolves this frame (error wins, then disabled). |
float | GetHeight | The spec height of the variant: 22 for a filter chip, 28 for a toggle chip. |
float | GetFocusRadius | |
MiriVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
void | OnMouseEnter | |
void | OnMouseLeave | |
bool | IsFocusable | |
bool | OnActivate | |
bool | CanCacheDesiredSize | |
bool | CanRetainPaint | |
const char* | GetTypeName |
Function details
MIRI_WIDGET_ARGS
C++
MIRI_WIDGET_ARGS(MChip) MIRI_ARG(EMiriChipVariant, Variant) MIRI_ARG(std::string, Label) MIRI_ARG(std::string, Icon) MIRI_WIDGET_ARGS_END() enum class EVisualState : uint8_tConstruct
C++
void Construct(const CArguments& args)SetLabel
C++
void SetLabel(const std::string& label)GetLabel
C++
const std::string& GetLabel() constSetIcon
C++
void SetIcon(const std::string& glyph)A Lucide glyph for the toggle chip's icon slot.
SetSwatch
C++
void SetSwatch(const MiriColor& color)ClearSwatch
C++
void ClearSwatch()SetVariant
C++
void SetVariant(EMiriChipVariant variant)GetVariant
C++
EMiriChipVariant GetVariant() constSetSelected
C++
void SetSelected(bool selected)IsSelected
C++
bool IsSelected() constSetHasError
C++
void SetHasError(bool hasError)GetVisualState
C++
EVisualState GetVisualState() constThe state the paint resolves this frame (error wins, then disabled).
GetHeight
C++
float GetHeight() constThe spec height of the variant: 22 for a filter chip, 28 for a toggle chip.
GetFocusRadius
C++
float GetFocusRadius() const overrideComputeDesiredSize
C++
MiriVec2 ComputeDesiredSize(float scale) const overrideOnPaint
C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& 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) overrideIsFocusable
C++
bool IsFocusable() const overrideOnActivate
C++
bool OnActivate() overrideCanCacheDesiredSize
C++
bool CanCacheDesiredSize() const overrideCanRetainPaint
C++
bool CanRetainPaint() const overrideGetTypeName
C++
const char* GetTypeName() const overrideGenerated from Miri/Widgets/MChip.h via miri.json · Dec 5, 2026Version 1.1.0