Warning, /utilities/kclock/src/plasmoid/KClock_KWeather_3x3/package/contents/ui/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2020 HanY <hanyoung@protonmail.com>
0003     SPDX-License-Identifier: LGPL-2.1-or-later
0004 */
0005 
0006 import QtQuick
0007 import QtQuick.Layouts
0008 import org.kde.plasma.core 2.0 as PlasmaCore
0009 import org.kde.plasma.plasmoid 2.0
0010 import org.kde.plasma.components 2.0 as PlasmaComponents
0011 import org.kde.kirigami as Kirigami
0012 
0013 PlamoidItem {
0014     Plasmoid.backgroundHints: "ShadowBackground";
0015 
0016     fullRepresentation: Item {
0017         property int fontSize: mainItem.height / 4
0018         id: mainItem
0019         Layout.preferredHeight: Kirigami.Units.gridUnit * 12
0020         Layout.preferredWidth: fontSize * 24
0021         ColumnLayout {
0022             id: mainLayout
0023             Layout.fillWidth: true
0024             spacing: 0
0025             PlasmaComponents.Label {
0026                 text: plasmoid.nativeInterface.time
0027                 font.pointSize: fontSize
0028                 color: "white"
0029                 font.bold: true
0030                 Layout.alignment: Qt.AlignHCenter
0031             }
0032             RowLayout {
0033                 Layout.fillWidth: true
0034                 Layout.alignment: Qt.AlignHCenter
0035                 PlasmaComponents.Label {
0036                     text: plasmoid.nativeInterface.date
0037                     font.pointSize: fontSize / 3
0038                     color: "white"
0039                     Layout.rightMargin: Kirigami.Units.gridUnit
0040                 }
0041                 RowLayout {
0042                     id: alarmLabel
0043                     Layout.fillWidth: true
0044                     visible: plasmoid.nativeInterface.hasAlarm
0045                     Kirigami.Icon {
0046                         source: "notifications"
0047                         Layout.preferredHeight: alarmTime.height
0048                         Layout.preferredWidth: alarmTime.height
0049                     }
0050                     PlasmaComponents.Label {
0051                         id: alarmTime
0052                         Layout.alignment: Qt.AlignCenter
0053                         text: plasmoid.nativeInterface.alarmTime
0054                         color: "white"
0055                         font.pointSize: fontSize / 3
0056                     }
0057                 }
0058                 MouseArea {
0059                     anchors.fill: parent
0060                     onClicked: plasmoid.nativeInterface.openKClock()
0061                 }
0062             }
0063             RowLayout {
0064                 id: weatherLayout
0065                 Layout.fillWidth: true
0066                 // left city name and weather description
0067                 ColumnLayout {
0068                     Layout.fillWidth: true
0069                     PlasmaComponents.Label {
0070                         id: cityName
0071                         text: plasmoid.nativeInterface.cityName
0072                         font.pointSize: fontSize / 2
0073                         font.bold: true
0074                         color: "white"
0075                     }
0076                     PlasmaComponents.Label {
0077                         text: plasmoid.nativeInterface.description
0078                         font.pointSize: fontSize / 3
0079                         color: "white"
0080                     }
0081                 }
0082                 // center weather icon
0083                 Kirigami.Icon {
0084                     source: plasmoid.nativeInterface.weatherIcon
0085                     Layout.preferredHeight: fontSize
0086                     Layout.preferredWidth: fontSize
0087                 }
0088                 // right temperature
0089                 ColumnLayout {
0090                     Layout.fillWidth: true
0091                     PlasmaComponents.Label {
0092                         id: tempNow
0093                         text: plasmoid.nativeInterface.tempNow
0094                         font.pointSize: fontSize / 2
0095                         font.bold: true
0096                         color: "white"
0097                     }
0098                     RowLayout {
0099                         PlasmaComponents.Label {
0100                             text: plasmoid.nativeInterface.maxTemp
0101                             font.pointSize: fontSize / 3
0102                             font.bold: true
0103                             color: "white"
0104                         }
0105                         PlasmaComponents.Label {
0106                             Layout.alignment: Qt.AlignBottom
0107                             text: plasmoid.nativeInterface.minTemp
0108                             font.pointSize: fontSize / 4
0109                             font.bold: true
0110                             color: "white"
0111                         }
0112                     }
0113                 }
0114             }
0115         }
0116     }
0117 //    Plasmoid.compactRepresentation: Kirigami.Icon {
0118 //        source: "notifications"
0119 //        height: Kirigami.Units.gridUnit
0120 //        width: Kirigami.Units.gridUnit
0121 //    }
0122 }