2 * Copyright 2020 Robin Krens <robin@robinkrens.nl>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2 or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 import QtQuick.Layouts 1.0
22 import QtQuick.Window 2.2
24 //import org.kde.plasma.plasmoid 2.0 as Plasmoid
25 //import org.kde.plasma.core 2.0 as PlasmaCore
26 //import org.kde.plasma.components 2.0 as PlasmaComponents
29 import QtQuick.Controls 1.2
34 property var snow: [];
35 readonly property int snowCount: 100;
36 readonly property int screenWidth: Qt.application.screens[0].width;
37 readonly property int screenHeight: Qt.application.screens[0].height;
43 anchors.centerIn: parent;
48 //var screenWidth = Qt.application.screens[0].width;
49 //var screenHeight = Qt.application.screens[0].height;
51 for (var i = 0; i < snowCount; i++) {
53 var component = Qt.createComponent("snowWindow.qml");
55 snow[i] = component.createObject(root);
57 snow[i].x = Math.random() * screenWidth;
58 snow[i].y = Math.random() * screenHeight;
60 snow[i].showMaximized();
63 snowFalling.running = true;
74 interval: 50; running: false; repeat: true
78 for (var i = 0; i < snowCount; i++) {
79 if(snow[i].dir == 0) {
85 if (snow[i].disposition++ % snow[i].swirl == 0) {
86 snow[i].dir = !snow[i].dir;
89 if(snow[i].x > screenWidth) {
91 } else if (snow[i].x < 0) {
97 if (snow[i].y > screenHeight) {