me like nix
1import QtQuick
2import "../../../config" as Config
3import "../../../components"
4
5Item {
6 id: root
7 signal clicked()
8
9 width: 24
10 height: 24
11
12 Rectangle {
13 anchors.centerIn: parent
14 width: parent.width + 8
15 height: parent.height + 8
16 radius: Config.Appearance.rounding.full
17 color: powerMouse.containsMouse
18 ? Qt.rgba(Config.Colours.red.r, Config.Colours.red.g, Config.Colours.red.b, 0.2)
19 : "transparent"
20 Behavior on color { CAnim {} }
21 }
22
23 Text {
24 anchors.centerIn: parent
25 color: Config.Colours.red
26 font.family: Config.Appearance.font.family
27 font.pixelSize: 18
28 text: "\u23fb"
29 }
30
31 MouseArea {
32 id: powerMouse
33 anchors.fill: parent
34 anchors.margins: -4
35 hoverEnabled: true
36 cursorShape: Qt.PointingHandCursor
37 onClicked: root.clicked()
38 }
39}