blob: 50dd3fa81c1b9750d1304d9b379a694b96496862 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import QtQuick 2.0
Item {
id: root
height: parent.height * 0.8
width: image.width * image.scale
property alias enabled: mouseArea.enabled
property alias imageSource: image.source
property bool checkable: false
property bool checked: false
property alias hover: mouseArea.containsMouse
property alias pressed: mouseArea.pressed
property double imageSize: 0.9*root.height
opacity: enabled ? 1.0 : 0.3
signal clicked
Image {
id: image
anchors.centerIn: parent
scale: root.height / height
visible: true
opacity: pressed ? 0.6 : 1
smooth: true
}
MouseArea {
id: mouseArea
hoverEnabled: true
anchors.fill: root
onPositionChanged: applicationWindow.resetTimer()
onClicked: root.clicked();
}
}
|