-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainScreen.qml
116 lines (104 loc) · 2.85 KB
/
MainScreen.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
import QtQuick 2.9
import QtQml 2.2
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.3
/*!
\brief MainView with a Label and Button elements.
*/
import QtQuick.LocalStorage 2.0 as Sql
import "main.js" as Scripts
import "openseed.js" as OpenSeed
ListView {
id: ms
property string number: "0"
property string list: ""
property bool fromRequest: false
property string requestID: "0"
z: 0
snapMode: GridView.SnapOneRow
boundsBehavior: Flickable.DragAndOvershootBounds
orientation: Qt.Horizontal
onDraggingVerticallyChanged: if (draggingVertically == true) {
enabled = false
}
visible: true
clip: true
onStateChanged: if (state == "Active") {
} else {
gc()
}
states: [
State {
name: "Active"
PropertyChanges {
target: ms
// visible:true
x: 0
}
},
State {
name: "InActive"
PropertyChanges {
target: ms
// visible:false
x: -1 * width
}
}
]
transitions: [
Transition {
from: "InActive"
to: "Active"
reversible: true
NumberAnimation {
target: ms
property: "x"
duration: 200
easing.type: Easing.InOutQuad
}
}
]
delegate: Pages {
pindex: index
}
Rectangle {
anchors.centerIn: pagedots
width: pagedots.width * 1.2
height: pagedots.height * 1.6
radius: parent.height * 0.1
color: Qt.rgba(0.1, 0.1, 0.1, 0.4)
visible: pagedots.visible
}
Row {
id: pagedots
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: parent.width * 0.02
spacing: parent.width * 0.02
visible: if (ms.count > 1) {
true
} else {
false
}
Repeater {
model: ms.count
id: pageIndicator
Rectangle {
width: mainView.width * 0.044
height: mainView.width * 0.044
border.width: 1
border.color: barColor
color: if (index === ms.indexAt(ms.contentX, 0)) {
highLightColor1
} else {
Qt.rgba(9, 9, 9, 0)
}
radius: width / 2
MouseArea {
anchors.fill: parent
onClicked: ms.positionViewAtIndex(index, GridView.Center)
}
}
}
}
}