Files
z-bar-qt/Modules/Lock/WeatherInfo.qml
T
zach 118b8f482a
C++ / fmt (pull_request) Failing after 7s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 11s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Failing after 31s
Rust / build (pull_request) Successful in 49s
Python / verify (pull_request) Failing after 1m28s
Rust / fmt (pull_request) Successful in 30s
Rust / clippy (pull_request) Successful in 54s
fix: fix sub-pixel layout arrangement for normalized resolutions
2026-10-27 23:00:26 +01:00

55 lines
1.1 KiB
QML

import QtQuick
import qs.Modules.Lock.Weather
import ZShell.Config
import qs.Components
import qs.Helpers
import qs.Services
CustomRect {
id: root
required property int rootHeight
readonly property bool showForecast: rootHeight >= 700
color: Colors.tPalette.m3surfaceContainer
implicitHeight: {
const base = brief.implicitHeight + brief.anchors.topMargin;
if (showForecast)
return base + Tokens.spacing.largeIncreased + forecast.implicitHeight + forecast.anchors.margins;
return base + brief.anchors.topMargin;
}
radius: Tokens.rounding.small
topLeftRadius: Tokens.rounding.largeIncreased
Timer {
interval: 900000 // 15 minutes
repeat: true
running: true
triggeredOnStart: true
onTriggered: Weather.reload()
}
BriefInfo {
id: brief
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Tokens.padding.extraLarge
rootHeight: root.rootHeight
}
Loader {
id: forecast
active: root.showForecast
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.margins: Tokens.padding.large
anchors.right: parent.right
asynchronous: true
sourceComponent: Forecast {}
}
}