Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

IconButton

A button with an icon as visual representation. More...

Import Statement: import Felgo 3.0
Since: Felgo 2.7.0

Properties

Signals

Detailed Description

The IconButton is a special button type that shows an Icon as visual representation. It can be used with a default button behavior or as a toggle button (setting the toggle property to true).

You can use the IconButton as a toggle like this:

 IconButton {
   // Icon in default state
   icon: IconType.hearto
   // Icon in selected state
   selectedIcon: IconType.heart

   toggle: true

   onToggled: {
     console.debug("Button toggled")
   }
 }

Property Documentation

color : color

The color to use for this button in default state. The default value is Theme::tintColor.


disabledColor : color

The color to use for this button when the button is disabled. The default value is Theme::disabledColor.

This property was introduced in Felgo 2.12.0.


icon : string

The icon from IconType collection to use for this button in default state.


selected : bool

The current toggle state of the button is toggle property is set to true.

You can set this property from your own logic to set the initial state of the button.


selectedColor : color

The color to use for this button when the button is pressed or selected if toggle is set to true. The default value is Theme::tintLightColor.


selectedIcon : string

The icon from IconType collection to use for this button when the button is pressed or selected if toggle is set to true.


size : alias

The size of the button's icon.


toggle : bool

Whether the button acts as a toggle button or uses a default behavior. If set to true the button has an explicit selected state.

By default this property is false.


Signal Documentation

clicked()

This signal is emitted when the button is clicked.


pressed()

This signal is emitted when the button is pressed.


released()

This signal is emitted when the button is released.


toggled()

This signal is emitted when the button was toggled by user interaction if the toggle property is set to true.