fix: remove more uses of cliprect and finally fix workspace's layer texture

This commit is contained in:
2026-10-29 17:44:19 +01:00
parent 4252812e82
commit ed7e977eb5
14 changed files with 119 additions and 105 deletions
+4 -3
View File
@@ -18,7 +18,7 @@ orientation: Qt.Vertical
Layout.alignment: Qt.AlignHCenter
animate: true
color: Colors.palette.m3onSurfaceVariant
font: Tokens.font.title.large
font: Tokens.font.body.large
text: Weather.description
}
@@ -31,7 +31,7 @@ orientation: Qt.Vertical
animate: true
color: Colors.palette.m3primary
font: Tokens.font.body.large
font: Tokens.font.title.large
text: Weather.temp
}
@@ -39,6 +39,7 @@ orientation: Qt.Vertical
animate: true
color: Colors.palette.m3secondary
text: Weather.icon
fontStyle: Tokens.font.icon.large
}
}
@@ -55,7 +56,7 @@ orientation: Qt.Vertical
Layout.alignment: Qt.AlignHCenter
animate: true
color: Colors.palette.m3onSurfaceVariant
font: Tokens.font.body.normal
font: Tokens.font.body.medium
text: {
const today = Weather.forecast[0];
return qsTr("High %1 • Low %2").arg(Weather.formatTemp(today?.maxTempC)).arg(Weather.formatTemp(today?.minTempC));
+12 -5
View File
@@ -37,7 +37,7 @@ CustomRect {
}
}
VerticalFadeListView {
CustomListView {
id: layout
anchors.bottom: parent.bottom
@@ -46,7 +46,13 @@ CustomRect {
anchors.margins: Tokens.padding.large
anchors.right: parent.right
implicitHeight: contentItem.childrenRect.height
model: Weather.hourlyForecast
currentIndex: Weather.currentHourIndex
// highlightFollowsCurrentItem: true
// preferredHighlightEnd: currentItem.implicitWidth
// preferredHighlightBegin: 0
// highlightRangeMode: ListView.ApplyRange
clip: true
model: Weather.hourlyForecast.slice(Weather.currentHourIndex - 1)
orientation: VerticalFadeListView.Horizontal
spacing: Tokens.spacing.medium
@@ -54,6 +60,7 @@ CustomRect {
orientation: Qt.Vertical
id: hour
readonly property bool current: ListView.view.currentItem === this
readonly property var cond: modelData
required property int index
required property var modelData
@@ -62,7 +69,7 @@ orientation: Qt.Vertical
MaterialShape {
Layout.alignment: Qt.AlignHCenter
color: Qt.alpha(Colors.palette.m3primary, hour.index === Weather.currentHourIndex ? 1 : 0)
color: Qt.alpha(Colors.palette.m3primary, hour.current ? 1 : 0)
implicitSize: temp.implicitHeight + Tokens.padding.small * 2
shape: MaterialShape.Cookie4Sided
@@ -74,7 +81,7 @@ orientation: Qt.Vertical
id: temp
anchors.centerIn: parent
color: hour.index === Weather.currentHourIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
color: hour.current ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
font: Tokens.font.body.medium
text: Weather.formatTemp(hour.cond.tempC).slice(0, -1) // Remove C/F
}
@@ -98,7 +105,7 @@ orientation: Qt.Vertical
Layout.topMargin: Tokens.spacing.extraSmall
color: Colors.palette.m3onSurfaceVariant
font: Tokens.font.body.small
text: hour.index === 0 ? qsTr("Now") : Qt.formatDateTime(new Date(hour.cond.timestamp.replace("T", " ")), Config.services.useTwelveHourClock ? "ha" : "hh:00")
text: hour.current ? qsTr("Now") : Qt.formatDateTime(new Date(hour.cond.timestamp.replace("T", " ")), Config.services.useTwelveHourClock ? "ha" : "hh:00")
}
}
}