forked from Avdan-OS/Desktop-Environment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nadva.qml
213 lines (212 loc) · 7.33 KB
/
Nadva.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import QtQuick 2.7
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0
//import QtApplicationManager.SystemUI 2.0
Window {
id: main
visible: true
width: 1920
height: 1080
flags: Qt.Window | Qt.FramelessWindowHint
title: qsTr("Nadva Desktop")
Rectangle {
id: container
width: parent.width; height: parent.height
AnimatedImage {
id: boot
width: parent.width
height:parent.height
source: "Assets/boot.gif"
paused: if(currentFrame == 140)
true
else
false
}
/*
Rectangle {
id: topL_resize
width: 2
height: 2
color: "transparent"
}
Rectangle {
id: topR_resize
width: 2
height: 2
color: "transparent"
anchors.right: parent.right
}
Rectangle {
id: botL_resize
width: 2
height: 2
color: "transparent"
anchors.bottom: parent.bottom
}
Rectangle {
id: botR_resize
width: 10
height: 10
x: 300
y: 210
color: "red"
//anchors.bottom: parent.bottom
//anchors.right: parent.right
MouseArea {
anchors.fill: parent
drag.target: parent
drag.minimumX: 10
drag.maximumX: container.width
drag.minimumY: 10
drag.maximumY: container.height
}
//Component.onCompleted: {
// appwindow.w = x - parent.x
// appwindow.h = y - parent.y
//}
}
*/
Rectangle {
id: appwindow
visible: boot.paused
/*
property bool fullscreen: if(move.drag.active == false) and (y<=0)
true
else
false
*/
property string colorKey
width: 1280
height: 800
color: "transparent"
radius: 10
//opacity: 1 - x/1000
property bool rounded: true
property bool adapt: true
property int toolbar_size: 50
clip: true
/*
layer.enabled: rounded
layer.effect: OpacityMask {
maskSource: Item {
width: appwindow.width
height: appwindow.height
Rectangle {
id: roundwin
anchors.centerIn: parent
width: appwindow.adapt ? appwindow.width : Math.min(appwindow.width, appwindow.height)
height: appwindow.adapt ? appwindow.height : width
radius: appwindow.radius
}
}
}
*/
Rectangle {
id: toolbar
radius: parent.radius
width: parent.width
height: parent.toolbar_size*2
property int spacing: 10
color: "#000000"
opacity: 0.8
//Drag.keys: [ parent.colorKey ]
Rectangle{
id: window_actions
width: parent.height *(9/8)
height: parent.height / 3
anchors.horizontalCenter: parent.right
anchors.horizontalCenterOffset: -width/2- parent.spacing
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -height * (5/7)
radius: 5
color: "#1AFFFFFF"
//opacity: 0.2
Image{
id: close
source: "Assets/Avdan OS Icons/PNG/close.png"
width: parent.height* (2/3)
height: parent.height* (2/3)
anchors.horizontalCenter: parent.right
anchors.horizontalCenterOffset: -width
anchors.verticalCenter: parent.verticalCenter
//Component.onCompleted: console.log(parent.right)
Image{
id: minimize
source: "Assets/Avdan OS Icons/PNG/minimize.png"
width: parent.height
height: parent.height
anchors.horizontalCenter: parent.left
anchors.horizontalCenterOffset: -width
anchors.verticalCenter: parent.verticalCenter
Image{
id: expand
source: "Assets/Avdan OS Icons/PNG/expand.png"
width: parent.height
height: parent.height
anchors.horizontalCenter: parent.left
anchors.horizontalCenterOffset: -width
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
MouseArea {
id: move
anchors.fill: parent
drag.target: appwindow
drag.minimumX: -parent.width+2
drag.maximumX: container.width - 2
drag.minimumY: -parent.height+parent.radius+2
drag.maximumY: container.height - 2
}
}
Rectangle {
id: app
width: parent.width
height: parent.height-parent.toolbar_size
//color: "#00FF00"
radius: parent.radius
anchors.bottom: parent.bottom
gradient: Gradient { //replace this with the app (this is some kind of demo)
GradientStop { position: 1.0; color: "lightgreen" }
GradientStop { position: 0.0; color: "green" }
}
}
}
Rectangle {
id: taskbar
visible: boot.paused
property int taskbarOffx: 400
width: parent.width-taskbarOffx
height: 64
color: "#000000"
opacity: 0.8
radius: 10
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.bottom
anchors.verticalCenterOffset: -40
}
DropArea {
id: dragTarget
property string colorKey
property alias dropProxy: dragTarget
width: 64; height: 64
//keys: [ colorKey ]
Rectangle {
id: dropRectangle
anchors.fill: parent
color: dragTarget.colorKey
states: [
State {
when: dragTarget.containsDrag
PropertyChanges {
target: dropRectangle
color: "grey"
}
}
]
}
}
}
}