Something went wrong. Try again.
my over complex system configurations
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142import QtQuickimport qs.data
Item { id: root
property string icon: "" property int size: 18 property int padding: 6 property color color: Theme.colors.text property color hoverColor: Theme.colors.surfaceRaised property bool enabled: true
signal clicked
implicitWidth: size + padding * 2 implicitHeight: size + padding * 2 opacity: enabled ? 1 : 0.4
Rectangle { anchors.fill: parent radius: Theme.radiusSm color: mouseArea.pressed ? Theme.colors.overlay : root.hoverColor opacity: mouseArea.containsMouse && root.enabled ? 1 : 0
Behavior on opacity { Anim { duration: Theme.animFast } } }
MyIcon { anchors.centerIn: parent; icon: root.icon; size: root.size; color: root.color }
MouseArea { id: mouseArea anchors.fill: parent hoverEnabled: true cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor onClicked: if (root.enabled) root.clicked() }
scale: mouseArea.pressed ? 0.92 : 1.0 Behavior on scale { NumberAnimation { duration: 90 } }}