Warning, /utilities/kweather/src/qml/backgrounds/components/Sun.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * SPDX-FileCopyrightText: 2020 Han Young <hanyoung@protonmail.com> 0003 * SPDX-FileCopyrightText: 2020-2021 Devin Lin <espidev@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 import QtQuick 0008 import QtQuick.Controls 0009 import QtQuick.Layouts 0010 import QtQuick.Shapes 0011 import org.kde.kirigami as Kirigami 0012 0013 Rectangle { 0014 id: rootBackground 0015 color: "transparent" 0016 anchors.fill: parent 0017 0018 property double unitSize: width / 100 // 100 is full width of screen 0019 property double innerRotation: 0 0020 property double outerRotation: 0 0021 property double outerOuterRotation: 0 0022 0023 NumberAnimation on innerRotation { 0024 to: 360 0025 duration: 20000 0026 running: true 0027 onFinished: { 0028 innerRotation = 0 0029 restart(); 0030 } 0031 } 0032 0033 NumberAnimation on outerRotation { 0034 to: 360 0035 duration: 15000 0036 running: true 0037 onFinished: { 0038 outerRotation = 0 0039 restart(); 0040 } 0041 } 0042 0043 NumberAnimation on outerOuterRotation { 0044 to: 360 0045 duration: 12000 0046 running: true 0047 onFinished: { 0048 outerOuterRotation = 0 0049 restart(); 0050 } 0051 } 0052 // outer outer sun 0053 Repeater { 0054 model: 6 0055 Rectangle { 0056 width: unitSize * 120 0057 height: width 0058 color: "#ffa000" 0059 opacity: 0.4 0060 border.width: 0 0061 rotation: outerOuterRotation + index * (90/6) 0062 x: rootBackground.width - unitSize * 10 - width / 2 0063 y: unitSize * 10 - height / 2 0064 antialiasing: true 0065 } 0066 } 0067 0068 // outer sun 0069 Repeater { 0070 model: 5 0071 Rectangle { 0072 width: unitSize * 60 0073 height: width 0074 color: "#ff8f00" 0075 opacity: 0.5 0076 border.width: 0 0077 rotation: outerRotation + index * (90/5) 0078 x: rootBackground.width - unitSize * 10 - width / 2 0079 y: unitSize * 10 - height / 2 0080 antialiasing: true 0081 } 0082 } 0083 0084 // inner sun 0085 Repeater { 0086 model: 3 0087 Rectangle { 0088 width: unitSize * 30 0089 height: width 0090 color: "#ff6f00" 0091 opacity: 0.5 0092 border.width: 0 0093 rotation: innerRotation + index * (90/3) 0094 x: rootBackground.width - unitSize * 10 - width / 2 0095 y: unitSize * 10 - height / 2 0096 antialiasing: true 0097 } 0098 } 0099 } 0100