-
Notifications
You must be signed in to change notification settings - Fork 44
/
Viewport.qml
91 lines (77 loc) · 2.49 KB
/
Viewport.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
import QtQuick 2.3
import Pyblish 0.1
import "../Delegates.js" as Delegates
Item {
property QtObject item
property alias scrollbar: scrollbar
Flickable {
id: body
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: scrollbar.left
anchors.leftMargin: 7
anchors.rightMargin: 7
clip: true
contentHeight: _body.height
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
Column {
id: _body
Repeater {
model: [
{
type: "spacer",
load: true,
},
{
type: "documentation",
name: "Documentation",
opened: true,
item: root.item,
load: item.itemType == "plugin"
},
{
type: "results",
name: "Errors (" + app.errorProxy.rowCount() + ")",
opened: app.errorProxy.rowCount() ? true : false,
model: app.errorProxy,
load: true
},
{
type: "results",
name: "Records (" + app.recordProxy.rowCount() + ")",
opened: app.recordProxy.rowCount() ? true : false,
model: app.recordProxy,
load: true,
},
{
type: "path",
name: "Path",
opened: false,
item: root.item,
load: item.itemType == "plugin"
},
{
type: "spacer",
load: true,
},
]
Loader {
width: body.width
sourceComponent: modelData.load ? Delegates.components[modelData.type] : null
}
}
}
}
Scrollbar {
id: scrollbar
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.margins: 2
anchors.rightMargin: 1
width: visible ? 15 : 0
flickable: body
}
}