-
Notifications
You must be signed in to change notification settings - Fork 1
/
ButtonDemo.qml
89 lines (72 loc) · 2.27 KB
/
ButtonDemo.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import QtQuick 2.4
import Material 0.2
import QtQuick.Controls 1.3 as Controls
Item {
Column {
anchors.centerIn: parent
spacing: dp(20)
Button {
text: "Simple Button"
anchors.horizontalCenter: parent.horizontalCenter
onClicked: snackbar.open("Simple, isn't it?")
}
Button {
text: "Raised Button"
elevation: 1
anchors.horizontalCenter: parent.horizontalCenter
onClicked: snackbar.open("This is a snackbar")
}
Button {
text: "Disabled Raised Button"
elevation: 1
enabled: false
anchors.horizontalCenter: parent.horizontalCenter
}
Button {
text: "Wide Button"
width: dp(200)
elevation: 1
anchors.horizontalCenter: parent.horizontalCenter
onClicked: snackbar.open("That button is wide, and so is this snackbar!")
}
Button {
id: focusableButton
text: "Focusable with really long text"
elevation: 1
activeFocusOnPress: true
anchors.horizontalCenter: parent.horizontalCenter
onClicked: snackbar.open("The text is really very very very very very long and now it needs to wrap, so this should show as two lines!")
}
Button {
text: "Colored button"
textColor: Theme.accentColor
anchors.horizontalCenter: parent.horizontalCenter
onClicked: snackbar.open("That button is colored!")
}
Button {
text: "Focusable button #2"
elevation: 1
activeFocusOnPress: true
backgroundColor: Theme.primaryColor
anchors.horizontalCenter: parent.horizontalCenter
onClicked: snackbar.open("That button is colored!")
}
}
ActionButton {
anchors {
right: parent.right
bottom: snackbar.top
margins: dp(32)
}
action: Action {
id: addContent
text: "&Copy"
shortcut: "Ctrl+C"
onTriggered: snackbar.open("We do actions too!")
}
iconName: "content/add"
}
Snackbar {
id: snackbar
}
}