IconButton

A button with only an icon as content.

Properties

  • icon (in image): The image to show in the button.
  • inline (in bool): If set to true the button can shrink to the size of the icon.
  • 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 { IconButton, MagicVerticalBox } from "@vivi/magic.slint";
export component Example inherits Window {
    MagicVerticalBox {
        IconButton {
            icon: @image-url("/path/to/my/icon.svg");
            clicked => { self.text = "Clicked"; }
        }
    }
}