CheckBoxStyle
Defines the visual settings of a checkbox.
Fields
box_background
(brush): Defines background of the check box. (default value: black)box_background_checked
(brush): Defines background of the check box ifchecked
istrue
. (default value: black)box_border_brush
(brush): Defines the brush of the check box. (default value: black)box_border_radius
(length): The size of the radius of the check box. (default value: 0)box_border_width
(length): Defines the width of the border of the check box. (default value: 0)box_icon_style
(IconStyle
): Defines the style of the check box icon.text_style
(TextStyle
): Defines the style of the text. (default value: 0)spacing
(length): Defines the distance between elements in the checkbox layout. (default value: 0)
CheckBoxBase
The CheckBoxBase
represents the base for checkbox elements that can be styled by usign CheckBoxStyle
.
Properties
enabled
(in bool): If set tofalse
the checkbox is disabled.checked
(in-out bool): Whether the checkbox is checked or not (default: false).style
(in ButtonStyle): Defines the style of the checkbox.box_icon_style
(outIconStyle
): Gets the style of the check box icon..text_style
(outTextStyle
): Gets the style of the text of the checkbox.
Callbacks
toggled(/* checked */ bool)
: Thechecked
value changed.
Example
import { CheckBoxBase } from "@coop/foundation.slint";
export component MyCheckBox inherits CheckBoxBase {
width: 20px;
height: 20px;
style: {
background: black,
border_radius: 8px,
};
}
export component Example inherits Window {
width: 200px;
height: 100px;
MyCheckBox {
toggled(checked) => {
debug(checked);
}
}
}