nosignal-shell/modules/dashboard/dash/Weather.qml
William (Liam) Snow IV b053130570
feat: fahrenheit option for weather (#189)
* Added Fahrenheit to Weather Service

* some fixes

Allow for hot reloading config opt
Add opt to example config

---------

Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
2025-07-03 14:08:25 +10:00

57 lines
1.5 KiB
QML

import "root:/widgets"
import "root:/services"
import "root:/config"
import "root:/utils"
import QtQuick
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 || "cloud_alert"
color: Colours.palette.m3secondary
font.pointSize: Appearance.font.size.extraLarge * 2
}
Column {
id: info
anchors.verticalCenter: parent.verticalCenter
anchors.left: icon.right
anchors.leftMargin: Appearance.spacing.large
spacing: Appearance.spacing.small
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
text: Config.dashboard.useFahrenheit ? Weather.tempF : Weather.tempC
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
text: Weather.description || qsTr("No weather")
elide: Text.ElideRight
width: Math.min(implicitWidth, root.parent.width - icon.implicitWidth - info.anchors.leftMargin - Appearance.padding.large * 2)
}
}
}