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