class

MChip

Module
Miri
Header
#include "Miri/Widgets/MChip.h"
Namespace
Miri

Properties

TypeNameDescription
MiriDelegate<void(bool)>OnToggledFires when a click toggles the chip.

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
voidConstruct
voidSetLabel
const std::string&GetLabel
voidSetIconA Lucide glyph for the toggle chip's icon slot.
voidSetSwatch
voidClearSwatch
voidSetVariant
EMiriChipVariantGetVariant
voidSetSelected
boolIsSelected
voidSetHasError
EVisualStateGetVisualStateThe state the paint resolves this frame (error wins, then disabled).
floatGetHeightThe spec height of the variant: 22 for a filter chip, 28 for a toggle chip.
floatGetFocusRadius
MiriVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
voidOnMouseEnter
voidOnMouseLeave
boolIsFocusable
boolOnActivate
boolCanCacheDesiredSize
boolCanRetainPaint
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_t

Construct

C++
void Construct(const CArguments& args)

SetLabel

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

GetLabel

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

SetIcon

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() const

SetSelected

C++
void SetSelected(bool selected)

IsSelected

C++
bool IsSelected() const

SetHasError

C++
void SetHasError(bool hasError)

GetVisualState

C++
EVisualState GetVisualState() const

The state the paint resolves this frame (error wins, then disabled).

GetHeight

C++
float GetHeight() const

The spec height of the variant: 22 for a filter chip, 28 for a toggle chip.

GetFocusRadius

C++
float GetFocusRadius() const override

ComputeDesiredSize

C++
MiriVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& 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

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

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

CanRetainPaint

C++
bool CanRetainPaint() const override

GetTypeName

C++
const char* GetTypeName() const override
Generated from Miri/Widgets/MChip.h via miri.json · Dec 5, 2026Version 1.1.0