3 * Copyright 2020 Robin Krens <robin@robinkrens.nl>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2 or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 import QtQuick.Controls 1.2
23 import QtQuick.Window 2.2
25 import org.kde.plasma.plasmoid 2.0
27 import "../code/utils.js" as Utils
33 property int dir: getRandomIntInclusive(0,1); /* could go either left or right */
34 property int radius: Utils.getSnowSize(plasmoid.configuration.userSize); /* size of snowflake */
35 property int swirl: getRandomIntInclusive(35,200); /* random falling 'swirl' */
36 property int disposition: 0;
37 property alias snowFlakeRotation: snowFlake.rotation;
38 property int rotationSpeed: getRandomIntInclusive(1,4);
39 property int rotationDirection: getRandomIntInclusive(0,1);
40 property int fallingSpeed: Utils.getFallingSpeed(plasmoid.configuration.userSpeed);
45 flags: Qt.WindowStaysOnTopHint
46 | Qt.FramelessWindowHint
47 | Qt.WA_TransparentForMouseEvents
48 | Qt.WA_TranslucentBackground
49 | Qt.X11BypassWindowManagerHint;
51 /* Basic functions (fro, developer.mozilla.org) */
52 function getRandomIntInclusive(min, max) {
54 max = Math.floor(max);
55 return Math.floor(Math.random() * (max - min + 1) + min);
63 radius: plasmoid.configuration.userStyle == "Plain" ? 50 : 0;
64 color: plasmoid.configuration.userStyle == "Plain" ? "white" : "transparent";
72 switch(plasmoid.configuration.userStyle) {
74 imgSrc = "../images/classic.png";
79 imgSrc = "../images/romantic.png";