/
Options.qml
162 lines (141 loc) · 5.37 KB
/
Options.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2
ScrollView {
id: page
// implicitWidth: 640
// implicitHeight: 200
signal nobtn
signal switchMem(bool on)
signal switchCpu(bool on);
horizontalScrollBarPolicy: 0
property bool memWid
property color txtColor: mc.colorValue("user/textColor")
Image {
id: content
source: "image://ThemeProvider/bg"
width: Math.max(page.viewport.width, grid.implicitWidth + 2 * grid.rowSpacing)
height: Math.max(page.viewport.height, grid.implicitHeight + 2 * grid.columnSpacing)
GridLayout {
id: grid
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: grid.rowSpacing
anchors.rightMargin: grid.rowSpacing
anchors.topMargin: grid.columnSpacing
columns: page.width < page.height ? 1 : 2
GroupBox {
title: qsTr("Settings")
Layout.fillWidth: true
Layout.columnSpan: grid.columns
ColumnLayout {
anchors.fill: parent
RowLayout {
Label { text: "ROOT"; color: txtColor;Layout.fillWidth: true }
Switch {
id: rootSwitch;
checked: mc.hasRoot();
onClicked: {
mc.setBoolValue("user/root", checked);
mc.setShell(checked);
}
}
}
RowLayout {
Label { text: qsTr("show memory info"); color: txtColor;Layout.fillWidth: true }
Switch {
id: memSwitch;
checked: mc.boolValue("user/memInfo");
onClicked: {
page.switchMem(checked);
mc.setBoolValue("user/memInfo", checked)
}
}
}
RowLayout {
width: 100
height: 100
Label {
text: qsTr("show cpu info")
color: txtColor
Layout.fillWidth: true
}
Switch {
id:cpuSwitch;
checked: mc.boolValue("user/cpuInfo");
onClicked: {
page.switchCpu(checked);
mc.setBoolValue("user/cpuInfo", checked)
}
}
}
RowLayout {
width: 100
height: 100
Label {
text: qsTr("visible file items(7-25)")
color: txtColor
Layout.fillWidth: true
}
SpinBox { id: itemnum; value: mc.intValue("user/itemNum"); minimumValue: 7; maximumValue: 25; Layout.fillWidth: false }
}
RowLayout {
width: 100
height: 100
Layout.fillWidth: true
Label {
text: qsTr("text color")
color: txtColor
Layout.fillWidth: true
}
TextField { id: txtcolor; text: txtColor; Layout.fillWidth: false}
}
}
}
GroupBox {
ColumnLayout {
anchors.fill: parent
RowLayout {
Label {
color: txtColor
text: qsTr("show kernel thread")
Layout.fillWidth: true
}
Switch {
id: rootSwitch1
checked: mc.boolValue("process/showKthread")
onClicked: mc.setBoolValue("process/showKthread", checked)
}
}
}
Layout.fillWidth: true
title: qsTr("Process Manager")
Layout.columnSpan: grid.columns
}
RowLayout {
width: 100
height: 100
Button {
id: button1
text: qsTr("Back")
onClicked: page.nobtn()
}
Item {
id: item1
width: 200
height: 200
Layout.fillWidth: true
}
Button {
id: button2
text: qsTr("Save")
onClicked: {
mc.setIntValue("user/itemNum", itemnum.value);
mc.setColorValue("user/textColor", txtcolor.getText(0, txtcolor.length));
}
}
}
}
}
}