-
Notifications
You must be signed in to change notification settings - Fork 23
/
SttSetup.qml
123 lines (109 loc) · 3.5 KB
/
SttSetup.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import QtQuick 2.0
import QtQuick.Controls 2.5
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.2
import QtQuick.Controls.Universal 2.12
import QtGraphicalEffects 1.12
import AndroidNative 1.0 as AN
Dialog {
id: dialog
anchors.centerIn: Overlay.overlay
height: 240
width: 260
padding: dialog.innerSpacing
focus: true
modal: true
dim: false
closePolicy: Popup.NoAutoClose
property var fontSize
property int innerSpacing
enter: Transition {
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}
exit: Transition {
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
background: Item {
anchors.fill: parent
ShaderEffectSource {
id: effectSource
sourceItem: mainView
anchors.fill: parent
sourceRect: Qt.rect(dialog.x,dialog.y,dialog.width,dialog.height)
}
FastBlur{
id: blur
anchors.fill: effectSource
source: effectSource
radius: 32
}
Rectangle {
anchors.fill: parent
color: "#2e2e2e"
border.color: "transparent"
opacity: 0.6
}
}
contentItem: Column {
//anchors.fill: parent
width: dialog.width
height: dialog.height
spacing: dialog.innerSpacing
Text {
width: parent.width
height: parent.height - buttonRow.height - dialog.innerSpacing
text: qsTr("Now set up voice recognition for text input, which you can then activate using the microphone icon on the keyboard.")
color: Universal.foreground
wrapMode: Text.WordWrap
font.pointSize: dialog.fontSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
Row {
id: buttonRow
width: parent.width
spacing: dialog.innerSpacing
Button {
id: cancelButton
flat: true
padding: dialog.innerSpacing / 2
width: parent.width / 2 - dialog.innerSpacing / 2
text: qsTr("Cancel")
contentItem: Text {
text: cancelButton.text
color: Universal.foreground
font.pointSize: dialog.fontSize
horizontalAlignment: Text.AlignHCenter
}
background: Rectangle {
color: "transparent"
border.color: "gray"
}
onClicked: {
dialog.close()
}
}
Button {
id: okButton
width: parent.width / 2 - mainView.innerSpacing / 2
padding: dialog.innerSpacing / 2
flat: true
text: qsTr("Ok")
contentItem: Text {
text: okButton.text
color: Universal.foreground
font.pointSize: dialog.fontSize
horizontalAlignment: Text.AlignHCenter
}
background: Rectangle {
color: "transparent"
border.color: "gray"
}
onClicked: {
AN.SystemDispatcher.dispatch("volla.launcher.runAppAction", {"appId": "com.volla.vollaboard"})
dialog.close()
}
}
}
}
}