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.
  • prefix_icon (in image): The image to show before the text.
  • suffix_icon (in image): The image to show after the text.
  • action (in ButtonAction): Defines if the button is displayed default, primary or destructive.
  • enabled (in bool): If set to false the button is disabled.
  • has_hover (out bool): Button sets this to true when the mouse is over it.
  • has_focus (out bool): Button sets this to true when the area has keyboard focus.
  • pressed (out bool): Set to true by the button when the mouse is pressed over it.
  • enter_pressed (out bool): Set to true by the button when the area has focus and enter key is pressed.
  • style (in ButtonStyle): Defines the style of the button.

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"; }
        }
    }
}