-
Notifications
You must be signed in to change notification settings - Fork 28
/
ContentPane.qml
64 lines (60 loc) · 1.58 KB
/
ContentPane.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
import QtQuick 2.1
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import "jsutils.js" as JSUtils
import "sesssave.js" as StateSave
ColumnLayout {
id: cLayout
spacing: 12
ToolbarStyle {
Layout.fillWidth: true
Layout.minimumWidth: parent.Layout.minimumWidth
Layout.maximumWidth: parent.Layout.maximumWidth
height: toolbarHeight
}
TextArea {
id: outField
readOnly: true
Layout.fillWidth: true
Layout.minimumWidth: parent.Layout.minimumWidth
Layout.maximumWidth: parent.Layout.maximumWidth
Layout.fillHeight: true
selectByKeyboard: true
selectByMouse: true
backgroundVisible: false
text: "Built: " + versions.build_date + " " + "Version: " + versions.git_version + JSUtils.checkLatest(outField);
style: TextAreaStyle {
textColor: "#fff"
selectionColor: "steelblue"
selectedTextColor: "#eee"
backgroundColor: "#eee"
}
}
TextInput {
id: inField
Layout.fillWidth: true
Layout.minimumWidth: parent.Layout.minimumWidth
Layout.maximumWidth: parent.Layout.maximumWidth
cursorVisible: true
text: "type here."
color: "#FFF"
onAccepted: {
// wow, javascript.
var out;
try {
out = JSUtils.toJSON(eval(text), 5, 10, " ");
outField.textColor = "#fff";
} catch (e) {
out = e.message;
outField.textColor = "#f77";
};
outField.text = out;
}
selectByMouse: true
}
MouseArea {
anchors.fill: inField
onPressed: { mouse.accepted = false; if (inField.text == "type here.") {inField.text = "" }}
}
}