import QtQuick import "../components" import "../theme" // Round icon toggle; filled with the accent while on. Item { id: root property string glyph property string fallback property bool checked: false property int size: 34 signal clicked implicitWidth: size implicitHeight: size opacity: enabled ? 1 : 0.45 Accessible.role: Accessible.CheckBox Accessible.checked: checked GlassIcon { anchors.fill: parent size: root.size radius: root.size / 2 glyph: root.glyph fallback: root.fallback active: root.checked color: root.checked ? Theme.accent : area.containsMouse ? Theme.hover : Theme.surfaceVariant border.width: root.checked ? 0 : 1 border.color: Theme.hairline scale: area.pressed ? 0.92 : 1 Behavior on scale { NumberAnimation { duration: Theme.duration / 2 easing.type: Easing.OutCubic } } } MouseArea { id: area anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: root.clicked() } }