forked from Tencent/libpag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.qml
More file actions
154 lines (135 loc) · 4.13 KB
/
MainForm.qml
File metadata and controls
154 lines (135 loc) · 4.13 KB
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
import PAG
import QtQuick
import QtQuick.Controls
import "components"
SplitView {
id: splitView
required property int resizeHandleSize
property bool hasPAGFile: pagView.filePath !== ""
property bool isBackgroundOn: false
property bool isEditPanelOpen: false
property int minPlayerWidth: 360
property int minPanelWidth: 300
property int splitHandleWidth: 0
property int splitHandleHeight: 0
property int controlFormHeight: 76
property alias pagView: pagView
property alias dropArea: dropArea
property alias centerItem: centerItem
property alias rightItem: rightItem
property alias controlForm: controlForm
anchors.fill: parent
orientation: Qt.Horizontal
handle: Rectangle {
id: splitHandle
implicitWidth: splitHandleWidth
implicitHeight: splitHandleHeight
color: "#000000"
}
PAGRectangle {
id: centerItem
SplitView.minimumWidth: minPlayerWidth
SplitView.fillWidth: true
color: "#000000"
radius: 5
leftTopRadius: false
rightTopRadius: false
rightBottomRadius: !controlForm.panelsButton.checked
Image {
id: backgroundTiles
visible: hasPAGFile && !isBackgroundOn
smooth: false
source: "qrc:/images/tiles.png"
fillMode: Image.Tile
anchors.fill: parent
anchors.bottom: parent.bottom
anchors.bottomMargin: controlFormHeight
sourceSize.width: 32
sourceSize.height: 32
}
PAGView {
id: pagView
height: splitView.height - controlFormHeight
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
objectName: "pagView"
}
ControlForm {
id: controlForm
pagView: pagView
height: controlFormHeight
z: 1
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
}
MouseArea {
id: mouseArea
z: 2
anchors.fill: parent
anchors.leftMargin: resizeHandleSize
anchors.rightMargin: resizeHandleSize
anchors.bottom: parent.bottom
anchors.bottomMargin: controlFormHeight + 9
onClicked: {
pagView.isPlaying = !pagView.isPlaying;
}
}
DropArea {
id: dropArea
z: 3
anchors.fill: parent
}
Rectangle {
visible: !hasPAGFile
color: "#16161d"
anchors.fill: parent
anchors.bottomMargin: controlFormHeight
Text {
color: "#80ffffff"
text: qsTr("Click the menu or drag-drop here to open a PAG file")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.fill: parent
font.pixelSize: 20
wrapMode: Text.WordWrap
}
}
}
PAGRectangle {
id: rightItem
visible: isEditPanelOpen
SplitView.minimumWidth: minPanelWidth
SplitView.preferredWidth: minPanelWidth
color: "#16161d"
radius: 5
leftTopRadius: false
rightTopRadius: false
rightBottomRadius: false
PAGRectangle {
id: performance
color: "#16161D"
clip: true
anchors.top: parent.top
anchors.topMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
radius: 5
leftTopRadius: false
rightTopRadius: false
leftBottomRadius: false
Profiler {
id: profilerForm
anchors.fill: parent
}
}
}
}