diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 23:58:39 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 23:58:39 +1000 |
| commit | da1d96f5e8df96a66c0897f103d3824efa0e26c5 (patch) | |
| tree | c24da4213be5347eb0c214ea5fc5b6ef7cd0aa70 /modules/lock/WeatherInfo.qml | |
| parent | lock: static border (diff) | |
| download | caelestia-shell-da1d96f5e8df96a66c0897f103d3824efa0e26c5.tar.gz caelestia-shell-da1d96f5e8df96a66c0897f103d3824efa0e26c5.tar.bz2 caelestia-shell-da1d96f5e8df96a66c0897f103d3824efa0e26c5.zip | |
lock: add weather
Diffstat (limited to '')
| -rw-r--r-- | modules/lock/WeatherInfo.qml | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/modules/lock/WeatherInfo.qml b/modules/lock/WeatherInfo.qml new file mode 100644 index 0000000..3d627a9 --- /dev/null +++ b/modules/lock/WeatherInfo.qml @@ -0,0 +1,64 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import QtQuick +import QtQuick.Layouts + +RowLayout { + id: root + + Timer { + running: true + triggeredOnStart: true + repeat: true + interval: 900000 // 15 minutes + onTriggered: Weather.reload() + } + + spacing: Appearance.spacing.large + + MaterialIcon { + id: icon + + Layout.alignment: Qt.AlignVCenter + Layout.topMargin: Config.lock.sizes.border / 4 + + animate: true + text: Weather.icon || "cloud_alert" + color: Colours.palette.m3secondary + font.pointSize: Appearance.font.size.extraLarge * 2.5 + font.variableAxes: ({ + opsz: Appearance.font.size.extraLarge * 1.2 + }) + } + + ColumnLayout { + Layout.alignment: Qt.AlignVCenter + Layout.topMargin: Config.lock.sizes.border / 4 + Layout.rightMargin: Config.lock.sizes.border / 2 + + spacing: Appearance.spacing.small + + StyledText { + Layout.fillWidth: true + + animate: true + text: `${Weather.temperature}°C` + color: Colours.palette.m3primary + horizontalAlignment: Text.AlignHCenter + font.pointSize: Appearance.font.size.extraLarge + font.weight: 500 + } + + StyledText { + Layout.fillWidth: true + Layout.maximumWidth: Config.lock.sizes.weatherWidth - icon.implicitWidth + + animate: true + text: Weather.description || qsTr("No weather") + horizontalAlignment: Text.AlignHCenter + font.pointSize: Appearance.font.size.large + elide: Text.ElideRight + } + } +} |