-
Notifications
You must be signed in to change notification settings - Fork 2
/
MainPage.qml
140 lines (130 loc) · 3.49 KB
/
MainPage.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
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.12
import QtQuick.Dialogs 1.2
Page{
width: mainwindow.width
height: mainwindow.height
Rectangle {
anchors.fill: parent
color: "#FAFAFA"
}
Image {
id: dropimage
source: "pic/drop.png"
anchors.horizontalCenter: parent.horizontalCenter
property real staticY: parent.width / 2 - parent.height / 1.3
y: staticY
width: parent.width / 2.4
height: parent.width / 2.4
MouseArea {
anchors.fill: parent
onClicked: filedialog.open()
}
}
Label {
id: droptext1
y: parent.width / 2.4
anchors.horizontalCenter: dropimage.horizontalCenter
color: "#039BE5"
font.bold: Font.ExtraBold
font.pixelSize: 40
text: "COMPRESSOR"
}
Label {
id: droptext2
anchors.top: droptext1.bottom
anchors.topMargin: 3
// y: parent.width / 2
anchors.horizontalCenter: dropimage.horizontalCenter
text: "Drop your file here or click to choose one"
color: "#424242"
font.bold: Font.Bold
font.pixelSize: 15
}
Row {
anchors.bottom: parent.bottom
anchors.bottomMargin: 2
anchors.horizontalCenter: parent.horizontalCenter
Label {
text: "Made With"
font.bold: Font.Medium
color: "#616161"
}
Label {
text: " \ue806 "
font.family: "fontello"
color: "#D32F2F"
font.bold: Font.Medium
}
Label {
text: "By SeedPuller & Max Base"
font.bold: Font.Medium
color: "#616161"
}
}
FileDialog {
id: filedialog
folder: shortcuts.home + "/Pictures"
onAccepted: {
var url = String(filedialog.fileUrl).split("/")
mainmodel.prepareAndInsert(filedialog.fileUrl)
// mainwindow.filePaths.push(filedialog.fileUrl)
stackView.push(secondpage)
}
}
DropArea {
id: droparea1
anchors.fill: parent
onDropped: {
state = "normal"
var url = String(drop.urls[0]).split("/")
mainmodel.prepareAndInsert(drop.urls[0])
stackView.push(secondpage)
}
onEntered: {
state = "up"
}
onExited: {
state = "normal"
}
states: [
State {
name: "up"
PropertyChanges {
target: dropimage
y: dropimage.staticY - 35
}
},
State {
name: "normal"
PropertyChanges {
target: dropimage
y: dropimage.staticY
}
}
]
transitions: [
Transition {
from: "normal"
to: "up"
NumberAnimation {
target: dropimage
property: "y"
duration: 300
easing.type: Easing.OutExpo
}
},
Transition {
from: "up"
to: "normal"
NumberAnimation {
target: dropimage
property: "y"
duration: 1000
easing.type: Easing.OutBounce
}
}
]
}
}