mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 21:48:30 -04:00
dash: fix color tokens for placeholder in calendar, and weather failed
fixes #2891
port 1.5
(cherry picked from commit eb330f62e1)
This commit is contained in:
@@ -1079,7 +1079,7 @@ Rectangle {
|
|||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: I18n.tr("Add a task...", "placeholder in the new-task input field")
|
text: I18n.tr("Add a task...", "placeholder in the new-task input field")
|
||||||
color: Theme.onSurface_38
|
color: Theme.outlineButton
|
||||||
visible: taskInput.text.length === 0
|
visible: taskInput.text.length === 0
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
@@ -19,6 +18,7 @@ Card {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
visible: !WeatherService.weather.available
|
visible: !WeatherService.weather.available
|
||||||
|
z: 1
|
||||||
|
|
||||||
DankSpinner {
|
DankSpinner {
|
||||||
size: 24
|
size: 24
|
||||||
@@ -42,9 +42,9 @@ Card {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
DankButton {
|
||||||
text: I18n.tr("Refresh")
|
text: I18n.tr("Refresh")
|
||||||
flat: true
|
buttonHeight: 32
|
||||||
visible: !WeatherService.weather.loading
|
visible: !WeatherService.weather.loading
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
onClicked: WeatherService.forceRefresh()
|
onClicked: WeatherService.forceRefresh()
|
||||||
|
|||||||
@@ -141,52 +141,27 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankActionButton {
|
||||||
id: refreshButtonTwo
|
id: refreshButtonTwo
|
||||||
name: "refresh"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.withAlpha(Theme.surfaceText, 0.4)
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
smoothTransform: isRefreshing
|
iconName: isRefreshing ? "" : "refresh"
|
||||||
|
iconColor: Theme.withAlpha(Theme.surfaceText, 0.4)
|
||||||
property bool isRefreshing: false
|
tooltipText: I18n.tr("Refresh Weather")
|
||||||
|
tooltipSide: "left"
|
||||||
enabled: !isRefreshing
|
enabled: !isRefreshing
|
||||||
|
|
||||||
MouseArea {
|
property bool isRefreshing: false
|
||||||
id: refreshButtonMouseAreaTwo
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: parent.enabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
|
|
||||||
enabled: parent.enabled
|
|
||||||
|
|
||||||
Timer {
|
onClicked: {
|
||||||
id: hoverDelayTwo
|
isRefreshing = true;
|
||||||
interval: 300
|
WeatherService.forceRefresh();
|
||||||
repeat: false
|
refreshTimerTwo.restart();
|
||||||
onTriggered: {
|
|
||||||
refreshButtonTooltipTwo.show(I18n.tr("Refresh Weather"), refreshButtonTwo, 0, 0, "left");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onEntered: {
|
|
||||||
hoverDelayTwo.restart();
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: {
|
|
||||||
hoverDelayTwo.stop();
|
|
||||||
refreshButtonTooltipTwo.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
refreshButtonTwo.isRefreshing = true;
|
|
||||||
WeatherService.forceRefresh();
|
|
||||||
refreshTimerTwo.restart();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DankTooltipV2 {
|
DankSpinner {
|
||||||
id: refreshButtonTooltipTwo
|
anchors.centerIn: parent
|
||||||
|
size: refreshButtonTwo.iconSize
|
||||||
|
visible: refreshButtonTwo.isRefreshing
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
@@ -194,14 +169,6 @@ Item {
|
|||||||
interval: 2000
|
interval: 2000
|
||||||
onTriggered: refreshButtonTwo.isRefreshing = false
|
onTriggered: refreshButtonTwo.isRefreshing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
RotationAnimator on rotation {
|
|
||||||
running: refreshButtonTwo.isRefreshing
|
|
||||||
from: 0
|
|
||||||
to: 360
|
|
||||||
duration: 1000
|
|
||||||
loops: Animation.Infinite
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -864,52 +831,28 @@ Item {
|
|||||||
onClicked: SessionData.setWeatherHourlyDetailed(!SessionData.weatherHourlyDetailed)
|
onClicked: SessionData.setWeatherHourlyDetailed(!SessionData.weatherHourlyDetailed)
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankActionButton {
|
||||||
id: refreshButton
|
id: refreshButton
|
||||||
name: "refresh"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.withAlpha(Theme.surfaceText, 0.4)
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
smoothTransform: isRefreshing
|
iconName: isRefreshing ? "" : "refresh"
|
||||||
|
iconColor: Theme.withAlpha(Theme.surfaceText, 0.4)
|
||||||
property bool isRefreshing: false
|
tooltipText: I18n.tr("Refresh Weather")
|
||||||
|
tooltipSide: "left"
|
||||||
enabled: !isRefreshing
|
enabled: !isRefreshing
|
||||||
|
|
||||||
MouseArea {
|
property bool isRefreshing: false
|
||||||
id: refreshButtonMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: parent.enabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
|
|
||||||
enabled: parent.enabled
|
|
||||||
|
|
||||||
Timer {
|
onClicked: {
|
||||||
id: hoverDelay
|
isRefreshing = true;
|
||||||
interval: 300
|
WeatherService.forceRefresh();
|
||||||
repeat: false
|
refreshTimer.restart();
|
||||||
onTriggered: {
|
|
||||||
refreshButtonTooltip.show(I18n.tr("Refresh Weather"), refreshButton, 0, 0, "left");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onEntered: {
|
|
||||||
hoverDelay.restart();
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: {
|
|
||||||
hoverDelay.stop();
|
|
||||||
refreshButtonTooltip.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
refreshButton.isRefreshing = true;
|
|
||||||
WeatherService.forceRefresh();
|
|
||||||
refreshTimer.restart();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DankTooltipV2 {
|
DankSpinner {
|
||||||
id: refreshButtonTooltip
|
anchors.centerIn: parent
|
||||||
|
size: refreshButton.iconSize
|
||||||
|
visible: refreshButton.isRefreshing
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
@@ -917,14 +860,6 @@ Item {
|
|||||||
interval: 2000
|
interval: 2000
|
||||||
onTriggered: refreshButton.isRefreshing = false
|
onTriggered: refreshButton.isRefreshing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
RotationAnimator on rotation {
|
|
||||||
running: refreshButton.isRefreshing
|
|
||||||
from: 0
|
|
||||||
to: 360
|
|
||||||
duration: 1000
|
|
||||||
loops: Animation.Infinite
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user