FilledButton
A button with a filled shape that can be displayed also as primary or destructive button.
Properties
text(in string): The text written in the button.icon(in image): The image to show in the button.action(in ButtonAction): Defines if the button is displayeddefault,primaryordestructive.enabled(in bool): If set tofalsethe button is disabled.has_hover(out bool): Button sets this totruewhen the mouse is over it.has_focus(out bool): Button sets this totruewhen the area has keyboard focus.pressed(out bool): Set totrueby the button when the mouse is pressed over it.enter_pressed(out bool): Set totrueby the button when the area has focus and enter key is pressed.style(in ButtonStyle): Defines the style of the button.icon_style(out IconStyle): Gets the style of the icon of the button.border_style(out BorderStyle): Gets the style of the background border.text_style(out TextStyle): Gets the style of the text of the button.layout_style(out LayoutStyle): Gets the style of the layout.
Callbacks
clicked(): Invoked when clicked: A finger or the left mouse button is pressed, then released on this element.
Example
import { FilledButton, MagicVerticalBox } from "@vivi/magic.slint";
export component Example inherits Window {
MagicVerticalBox {
FilledButton {
text: "Click Me";
clicked => { self.text = "Clicked"; }
}
}
}