nosignal-shell/modules/dashboard/dash/SmallWeather.qml
2026-04-22 22:47:18 +10:00

55 lines
1.4 KiB
QML

import QtQuick
import Caelestia.Config
import qs.components
import qs.services
Item {
id: root
anchors.centerIn: parent
implicitWidth: icon.implicitWidth + info.implicitWidth + info.anchors.leftMargin
Component.onCompleted: Weather.reload()
MaterialIcon {
id: icon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
animate: true
text: Weather.icon
color: Colours.palette.m3secondary
fontStyle: Tokens.font.icon.builder.size(Tokens.font.icon.extraLarge.pointSize * 2).build()
}
Column {
id: info
anchors.verticalCenter: parent.verticalCenter
anchors.left: icon.right
anchors.leftMargin: Tokens.spacing.largeIncreased
spacing: Tokens.spacing.small
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
text: Weather.temp
color: Colours.palette.m3primary
font: Tokens.font.body.builders.large.size(28).weight(500).build()
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
text: Weather.description
elide: Text.ElideRight
width: Math.min(implicitWidth, root.parent.width - icon.implicitWidth - info.anchors.leftMargin - Tokens.padding.extraLargeIncreased)
}
}
}