-
Notifications
You must be signed in to change notification settings - Fork 15
/
StartButton.qml
48 lines (38 loc) · 1.13 KB
/
StartButton.qml
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.1
Rectangle {
id: root
property alias start_button_ma: root_ma
property alias start_button_text: button_text.text
property bool isActive: root_ma.containsMouse || root.focus == true
color: styl.button_back_color_ok // zielony
width: button_text.width + 20
height: 42
radius: 4
Keys.onEnterPressed: root_ma.clicked(true)
Keys.onReturnPressed: root_ma.clicked(true)
Behavior on width {NumberAnimation { duration: 100 }}
Text {
id: button_text
color: root.isActive ? styl.button_text_color_active : styl.button_text_color // Change text color on hover
anchors.centerIn: parent
text: qsTr("text")
font {
pixelSize: 20
bold: true
}
}
MouseArea {
id: root_ma
anchors.fill: parent
hoverEnabled: true
}
Rectangle {
id: shadow
color: styl.button_back_color_accent
z: root.z - 1
width: root.isActive ? root.width + 4 : root.width
height: root.isActive ? root.height + 4 : root.height
radius: 5
anchors.centerIn: root
}
}