blob: aa220c36694d1f204acf9fb331c496a1eb95ba4e (
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
39
40
41
42
43
44
45
46
47
48
|
import QtQuick 1.0
import Qt3D 1.0
import ModelTweak 1.0
Rectangle {
anchors.topMargin: 15
anchors.leftMargin: 15
border.width: 1
border.color: "#191919"
radius: 8
height: 20
color: "#999999"
property alias buttonText: text.text
property alias imageSrc: img.source
property alias textColor: text.color
signal clicked
Image {
id: img
anchors.left: parent.left
anchors.leftMargin: 5
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: text
anchors.fill: parent
font.pixelSize: 12
anchors.left: img.left
anchors.leftMargin: 5
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
MouseArea {
anchors.fill: parent
onClicked: parent.clicked()
onPressed: parent.color = "#646464"
onReleased: parent.color = "#999999"
hoverEnabled: true
onEntered: parent.color = "#BEBEBE"
onExited: parent.color = "#999999"
}
}
|