2021-09-10 12:45:15 +02:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Material
|
2019-06-09 12:21:03 +02:00
|
|
|
import QtQuick.Particles 2.12
|
|
|
|
import QtQuick.Shapes 1.12
|
2021-05-13 13:57:19 +02:00
|
|
|
import ScreenPlayWallpaper 1.0
|
2019-03-27 18:38:36 +01:00
|
|
|
|
|
|
|
Rectangle {
|
2019-06-09 12:21:03 +02:00
|
|
|
id: root
|
2021-04-21 18:13:47 +02:00
|
|
|
|
2019-06-09 12:26:11 +02:00
|
|
|
property int attStrength: 800000
|
2019-06-09 12:21:03 +02:00
|
|
|
//Emitter
|
|
|
|
property bool isEnabled: true
|
2019-06-09 12:26:11 +02:00
|
|
|
property int emitRate: 250
|
2019-06-09 12:21:03 +02:00
|
|
|
property int lifeSpan: 5000
|
|
|
|
property int size: 4
|
|
|
|
property int endSize: 8
|
|
|
|
property int sizeVariation: 4
|
|
|
|
//Image
|
2021-05-16 19:37:55 +02:00
|
|
|
property real imgOpacity: 0.75
|
|
|
|
|
2021-07-15 12:07:39 +02:00
|
|
|
signal requestFadeIn
|
2021-05-16 19:37:55 +02:00
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
color: Material.color(Material.Grey, Material.Shade800)
|
|
|
|
border.width: 10
|
|
|
|
border.color: "orange"
|
|
|
|
Component.onCompleted: root.requestFadeIn()
|
2019-06-09 12:21:03 +02:00
|
|
|
|
|
|
|
MouseArea {
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-07-15 12:07:39 +02:00
|
|
|
// setPosition()
|
2019-06-09 12:21:03 +02:00
|
|
|
id: ma
|
2021-05-16 19:37:55 +02:00
|
|
|
|
|
|
|
function setPosition() {
|
2021-07-15 12:07:39 +02:00
|
|
|
attractor.pointX = mouseX - 25
|
|
|
|
attractor.pointY = mouseY - 25
|
|
|
|
mouseDot.x = mouseX - mouseDot.center
|
|
|
|
mouseDot.y = mouseY - mouseDot.center
|
2021-05-16 19:37:55 +02:00
|
|
|
}
|
|
|
|
|
2019-06-09 12:21:03 +02:00
|
|
|
anchors.fill: parent
|
2020-03-06 13:25:20 +01:00
|
|
|
preventStealing: true
|
2021-04-08 13:35:58 +02:00
|
|
|
propagateComposedEvents: true
|
2019-06-09 12:21:03 +02:00
|
|
|
hoverEnabled: true
|
|
|
|
Component.onCompleted: {
|
2021-07-15 12:07:39 +02:00
|
|
|
attractor.pointX = parent.width * 0.5
|
|
|
|
attractor.pointY = parent.height * 0.5
|
2019-06-09 12:21:03 +02:00
|
|
|
}
|
|
|
|
onPositionChanged: {
|
2021-07-15 12:07:39 +02:00
|
|
|
setPosition()
|
2019-06-09 12:21:03 +02:00
|
|
|
}
|
|
|
|
onClicked: {
|
2021-07-15 12:07:39 +02:00
|
|
|
|
2019-06-09 12:21:03 +02:00
|
|
|
}
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2019-06-09 12:21:03 +02:00
|
|
|
Rectangle {
|
|
|
|
id: mouseDot
|
2021-05-16 19:37:55 +02:00
|
|
|
|
|
|
|
property int center: mouseDot.width * 0.5
|
|
|
|
|
2019-06-09 12:21:03 +02:00
|
|
|
width: 10
|
|
|
|
height: width
|
|
|
|
radius: width
|
2021-04-08 13:35:58 +02:00
|
|
|
z: 99
|
2019-06-09 12:21:03 +02:00
|
|
|
color: "orange"
|
|
|
|
}
|
|
|
|
|
|
|
|
Attractor {
|
|
|
|
id: attractor
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2019-06-09 12:21:03 +02:00
|
|
|
system: particleSystem
|
|
|
|
affectedParameter: Attractor.Acceleration
|
|
|
|
strength: root.attStrength
|
|
|
|
proportionalToDistance: Attractor.InverseQuadratic
|
|
|
|
}
|
|
|
|
|
|
|
|
ParticleSystem {
|
|
|
|
id: particleSystem
|
|
|
|
}
|
|
|
|
|
|
|
|
Emitter {
|
|
|
|
id: emitter
|
|
|
|
|
2021-05-16 19:37:55 +02:00
|
|
|
enabled: root.isEnabled
|
2019-06-09 12:21:03 +02:00
|
|
|
width: parent.width
|
2021-05-16 19:37:55 +02:00
|
|
|
height: parent.height * 0.5
|
2019-06-09 12:21:03 +02:00
|
|
|
system: particleSystem
|
|
|
|
emitRate: root.emitRate
|
|
|
|
lifeSpan: root.lifeSpan
|
|
|
|
lifeSpanVariation: 1000
|
|
|
|
size: root.size
|
|
|
|
endSize: root.endSize
|
|
|
|
sizeVariation: root.sizeVariation
|
2021-05-16 19:37:55 +02:00
|
|
|
|
|
|
|
anchors {
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
bottom: parent.bottom
|
|
|
|
}
|
|
|
|
|
2019-06-09 12:21:03 +02:00
|
|
|
velocity: AngleDirection {
|
|
|
|
angle: -90
|
|
|
|
magnitude: 50
|
|
|
|
magnitudeVariation: 25
|
|
|
|
angleVariation: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ImageParticle {
|
|
|
|
height: 16
|
|
|
|
width: 16
|
|
|
|
source: "dot.png"
|
|
|
|
system: particleSystem
|
|
|
|
opacity: root.imgOpacity
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-04-16 10:28:45 +02:00
|
|
|
Text {
|
|
|
|
id: txtMousePos
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-04-16 10:28:45 +02:00
|
|
|
property int counter: 0
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-05-13 13:57:19 +02:00
|
|
|
text: attractor.pointY + " - " + attractor.pointX
|
2021-04-16 10:28:45 +02:00
|
|
|
font.pointSize: 32
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
wrapMode: Text.WordWrap
|
2021-05-16 19:37:55 +02:00
|
|
|
color: "white"
|
|
|
|
|
2021-04-16 10:28:45 +02:00
|
|
|
anchors {
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
bottom: txtButtonConter.top
|
|
|
|
bottomMargin: 20
|
|
|
|
}
|
|
|
|
}
|
2019-06-09 12:21:03 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
Text {
|
|
|
|
id: txtButtonConter
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
property int counter: 0
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
text: txtButtonConter.counter
|
|
|
|
font.pointSize: 32
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
wrapMode: Text.WordWrap
|
2021-05-16 19:37:55 +02:00
|
|
|
color: "white"
|
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
anchors {
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
bottom: name.top
|
|
|
|
bottomMargin: 20
|
|
|
|
}
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2019-03-27 18:38:36 +01:00
|
|
|
Text {
|
|
|
|
id: name
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2019-03-27 18:38:36 +01:00
|
|
|
text: qsTr("This is a empty test window. You can change the source in test.qml")
|
|
|
|
font.pointSize: 32
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
wrapMode: Text.WordWrap
|
2021-04-08 13:35:58 +02:00
|
|
|
anchors.centerIn: parent
|
2019-03-27 18:38:36 +01:00
|
|
|
anchors.margins: 10
|
|
|
|
color: "white"
|
|
|
|
}
|
2020-03-06 13:25:20 +01:00
|
|
|
|
|
|
|
Row {
|
2021-05-16 19:37:55 +02:00
|
|
|
spacing: 20
|
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
anchors {
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
2021-04-08 13:35:58 +02:00
|
|
|
top: name.bottom
|
2020-03-06 13:25:20 +01:00
|
|
|
topMargin: 20
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
Button {
|
|
|
|
highlighted: true
|
2021-05-16 19:37:55 +02:00
|
|
|
text: qsTr("Click me! - 1")
|
2020-03-06 13:25:20 +01:00
|
|
|
onClicked: {
|
2021-07-15 12:07:39 +02:00
|
|
|
focus = false
|
|
|
|
focus = true
|
|
|
|
print("Button Clicked!")
|
|
|
|
txtButtonConter.counter = txtButtonConter.counter - 1
|
2020-03-06 13:25:20 +01:00
|
|
|
}
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
Button {
|
|
|
|
highlighted: true
|
2021-05-16 19:37:55 +02:00
|
|
|
text: qsTr("Exit Wallpaper")
|
2020-03-06 13:25:20 +01:00
|
|
|
onClicked: {
|
2021-07-15 12:07:39 +02:00
|
|
|
focus = false
|
|
|
|
focus = true
|
|
|
|
print("Exit Wallpaper")
|
|
|
|
Wallpaper.terminate()
|
2020-03-06 13:25:20 +01:00
|
|
|
}
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
Button {
|
|
|
|
highlighted: true
|
2021-04-08 13:35:58 +02:00
|
|
|
focusPolicy: Qt.ClickFocus
|
2021-05-16 19:37:55 +02:00
|
|
|
text: qsTr("Click me! +1")
|
2020-03-06 13:25:20 +01:00
|
|
|
onClicked: {
|
2021-07-15 12:07:39 +02:00
|
|
|
print("Button Clicked!")
|
|
|
|
txtButtonConter.counter = txtButtonConter.counter + 1
|
2020-03-06 13:25:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-15 12:07:39 +02:00
|
|
|
// WebView {
|
|
|
|
// width: 1000
|
|
|
|
// height: 400
|
|
|
|
// url: "https://screen-play.app"
|
|
|
|
|
|
|
|
// anchors {
|
|
|
|
// horizontalCenter: parent.horizontalCenter
|
|
|
|
// bottom: parent.bottom
|
|
|
|
// bottomMargin: 50
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
MultimediaView {
|
2020-03-06 13:25:20 +01:00
|
|
|
width: 1000
|
|
|
|
height: 400
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-03-06 13:25:20 +01:00
|
|
|
anchors {
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
bottom: parent.bottom
|
|
|
|
bottomMargin: 50
|
|
|
|
}
|
|
|
|
}
|
2019-03-27 18:38:36 +01:00
|
|
|
}
|