mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 01:02:18 -04:00
weather: light redesign for dash card
This commit is contained in:
@@ -68,7 +68,8 @@ Rectangle {
|
|||||||
|
|
||||||
readonly property var values: daily ? [] : [
|
readonly property var values: daily ? [] : [
|
||||||
{
|
{
|
||||||
// 'name': "Temperature",
|
"name"// 'name': "Temperature",
|
||||||
|
:
|
||||||
// 'text': root.tempText,
|
// 'text': root.tempText,
|
||||||
// 'icon': "thermometer"
|
// 'icon': "thermometer"
|
||||||
// }, {
|
// }, {
|
||||||
@@ -76,34 +77,34 @@ Rectangle {
|
|||||||
// 'text': root.feelsLikeText,
|
// 'text': root.feelsLikeText,
|
||||||
// 'icon': "thermostat"
|
// 'icon': "thermostat"
|
||||||
// }, {
|
// }, {
|
||||||
'name': I18n.tr("Humidity"),
|
I18n.tr("Humidity"),
|
||||||
'text': root.humidityText,
|
"text": root.humidityText,
|
||||||
'icon': "humidity_low"
|
"icon": "humidity_low"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': I18n.tr("Wind Speed"),
|
"name": I18n.tr("Wind Speed"),
|
||||||
'text': root.windText,
|
"text": root.windText,
|
||||||
'icon': "air"
|
"icon": "air"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': I18n.tr("Pressure"),
|
"name": I18n.tr("Pressure"),
|
||||||
'text': root.pressureText,
|
"text": root.pressureText,
|
||||||
'icon': "speed"
|
"icon": "speed"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': I18n.tr("Precipitation Chance"),
|
"name": I18n.tr("Precipitation Chance"),
|
||||||
'text': root.precipitationText,
|
"text": root.precipitationText,
|
||||||
'icon': "rainy"
|
"icon": "rainy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': I18n.tr("Visibility"),
|
"name": I18n.tr("Visibility"),
|
||||||
'text': root.visibilityText,
|
"text": root.visibilityText,
|
||||||
'icon': "wb_sunny"
|
"icon": "wb_sunny"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
color: isCurrent ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
color: isCurrent ? Theme.withAlpha(Theme.primary, 0.1) : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||||
border.color: isCurrent ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : "transparent"
|
border.color: isCurrent ? Theme.withAlpha(Theme.primary, 0.3) : "transparent"
|
||||||
border.width: isCurrent ? 1 : 0
|
border.width: isCurrent ? 1 : 0
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -129,7 +130,7 @@ Rectangle {
|
|||||||
DankIcon {
|
DankIcon {
|
||||||
name: root.forecastData ? WeatherService.getWeatherIcon(root.forecastData.wCode || 0, root.forecastData.isDay ?? true) : "cloud"
|
name: root.forecastData ? WeatherService.getWeatherIcon(root.forecastData.wCode || 0, root.forecastData.isDay ?? true) : "cloud"
|
||||||
size: Theme.iconSize
|
size: Theme.iconSize
|
||||||
color: root.isCurrent ? Theme.primary : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.8)
|
color: root.isCurrent ? Theme.primary : Theme.withAlpha(Theme.primary, 0.8)
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,14 +188,14 @@ Rectangle {
|
|||||||
DankIcon {
|
DankIcon {
|
||||||
name: root.values[index].icon
|
name: root.values[index].icon
|
||||||
size: 8
|
size: 8
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
color: Theme.withAlpha(Theme.surfaceText, 0.6)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: root.values[index].text
|
text: root.values[index].text
|
||||||
font.pixelSize: Theme.fontSizeSmall - 2
|
font.pixelSize: Theme.fontSizeSmall - 2
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
color: Theme.withAlpha(Theme.surfaceText, 0.6)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -64,6 +64,12 @@ Flow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankRipple {
|
||||||
|
id: chipRipple
|
||||||
|
cornerRadius: chip.radius
|
||||||
|
rippleColor: chip.selected ? Theme.primaryText : Theme.surfaceVariantText
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: contentRow
|
id: contentRow
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -91,6 +97,7 @@ Flow {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onPressed: mouse => chipRipple.trigger(mouse.x, mouse.y)
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.currentIndex = chip.index;
|
root.currentIndex = chip.index;
|
||||||
root.selectionChanged(chip.index);
|
root.selectionChanged(chip.index);
|
||||||
|
|||||||
Reference in New Issue
Block a user