forked from nallath/PostProcessingPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PostProcessingPlugin.qml
194 lines (184 loc) · 7.1 KB
/
PostProcessingPlugin.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// Copyright (c) 2015 Jaime van Kessel, Ultimaker B.V.
// The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import UM 1.0 as UM
UM.Dialog
{
width: 500 * Screen.devicePixelRatio;
height: 500 * Screen.devicePixelRatio;
Item
{
id: base
anchors.fill: parent
ExclusiveGroup
{
id: selected_loaded_script_group
}
Row
{
Column
{
Rectangle
{
color: "white"
border.width: 1
border.color: "black"
width: 250
height: 100
ScrollView
{
anchors.fill: parent
ListView
{
anchors.top: parent.top
anchors.topMargin: 2
anchors.left: parent.left
anchors.leftMargin: 2
anchors.right: parent.right
anchors.rightMargin: 2
anchors.bottom: parent.bottom
anchors.bottomMargin: 2
model: manager.loadedScriptList
delegate: Rectangle
{
color:"transparent"
width:parent.width
height:20
Button
{
id: loaded_script_button
text: manager.getScriptLabelByKey(modelData.toString())
exclusiveGroup: selected_loaded_script_group
checkable: true
width: parent.width
style: ButtonStyle
{
background:Rectangle
{
color: loaded_script_button.checked ? "blue":"white"
implicitWidth: parent.width
implicitHeight: parent.height
}
}
Button
{
text: "+"
anchors.right: parent.right
width: 20
height: 20
onClicked:
{
manager.addScriptToList(modelData.toString())
}
}
}
}
}
}
}
Item //Spacer
{
width: UM.Theme.sizes.default_margin.width
height: UM.Theme.sizes.default_margin.height
}
SingleCategorySettingPanel
{
setting_model: manager.selectedScriptSettingsModel
width: 250
height: 320
}
Item //Spacer
{
width: UM.Theme.sizes.default_margin.width
height: UM.Theme.sizes.default_margin.height
}
/*Button
{
text:"Execute"
width: 250
height: 30
onClicked:manager.execute()
}*/
}
Item
{
width: UM.Theme.sizes.default_margin.width
height: UM.Theme.sizes.default_margin.height
}
ExclusiveGroup
{
id: selected_script_group
}
Rectangle
{
width: 0.5 * parent.width - 2 * UM.Theme.sizes.default_margin.width
height: parent.height - 0.5 * UM.Theme.sizes.default_margin.height
ListView
{
anchors.fill:parent
model: manager.scriptList
delegate: Rectangle
{
width: parent.width
height: 30
Button
{
id: loaded_script_button
text: manager.getScriptLabelByKey(modelData.toString())
exclusiveGroup: selected_script_group
checkable: true
checked: manager.selectedScriptIndex == index ? true : false
onClicked: manager.setSelectedScriptIndex(index)
width: parent.width
style: ButtonStyle
{
background: Rectangle
{
color: loaded_script_button.checked ? "blue":"white"
implicitWidth: parent.width
implicitHeight: parent.height
}
}
}
Button
{
id: remove_button
text: "x"
width: 20
height:20
anchors.right:parent.right
onClicked: manager.removeScriptByIndex(index)
}
Button
{
id: down_button
text: "-"
anchors.right: remove_button.left
width: 20
height:20
onClicked: manager.moveScript(index,index+1)
}
Button
{
id: up_button
text:"+"
width: 20
height: 20
anchors.right: down_button.left
onClicked: manager.moveScript(index,index-1)
}
}
}
}
}
Tooltip
{
id:tooltip
}
}
}