1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

settings: fix network refresh button animation behavior

fixes #1258
This commit is contained in:
bbedward
2026-01-03 14:37:27 -05:00
parent 2bf85bc4dd
commit f3f720bb37
2 changed files with 80 additions and 24 deletions

View File

@@ -15,3 +15,4 @@ This file is more of a quick reference so I know what to account for before next
- new IPC targets - new IPC targets
- Initial RTL support/i18n - Initial RTL support/i18n
- Theme registry - Theme registry
- Notification persistence & history

View File

@@ -587,16 +587,30 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
DankIcon { DankIcon {
id: wiredLoadIcon
name: "sync" name: "sync"
size: 16 size: 16
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
RotationAnimation on rotation { SequentialAnimation {
running: NetworkService.networkWiredInfoLoading running: NetworkService.networkWiredInfoLoading
loops: Animation.Infinite loops: Animation.Infinite
from: 0 NumberAnimation {
to: 360 target: wiredLoadIcon
duration: 1000 property: "opacity"
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: wiredLoadIcon
property: "opacity"
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
wiredLoadIcon.opacity = 1.0
} }
} }
@@ -757,17 +771,8 @@ Item {
DankActionButton { DankActionButton {
iconName: "refresh" iconName: "refresh"
buttonSize: 32 buttonSize: 32
visible: NetworkService.wifiEnabled && !NetworkService.wifiToggling visible: NetworkService.wifiEnabled && !NetworkService.wifiToggling && !NetworkService.isScanning
enabled: !NetworkService.isScanning
onClicked: NetworkService.scanWifi() onClicked: NetworkService.scanWifi()
RotationAnimation on rotation {
running: NetworkService.isScanning
loops: Animation.Infinite
from: 0
to: 360
duration: 1000
}
} }
DankToggle { DankToggle {
@@ -956,17 +961,31 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
DankIcon { DankIcon {
name: "refresh" id: scanningIcon
name: "wifi_find"
size: 32 size: 32
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
RotationAnimation on rotation { SequentialAnimation {
running: true running: NetworkService.isScanning
loops: Animation.Infinite loops: Animation.Infinite
from: 0 NumberAnimation {
to: 360 target: scanningIcon
duration: 1000 property: "opacity"
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: scanningIcon
property: "opacity"
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
scanningIcon.opacity = 1.0
} }
} }
@@ -1241,16 +1260,30 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
DankIcon { DankIcon {
id: wifiInfoLoadIcon
name: "sync" name: "sync"
size: 16 size: 16
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
RotationAnimation on rotation { SequentialAnimation {
running: NetworkService.networkInfoLoading running: NetworkService.networkInfoLoading
loops: Animation.Infinite loops: Animation.Infinite
from: 0 NumberAnimation {
to: 360 target: wifiInfoLoadIcon
duration: 1000 property: "opacity"
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: wifiInfoLoadIcon
property: "opacity"
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
wifiInfoLoadIcon.opacity = 1.0
} }
} }
@@ -1707,9 +1740,31 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
DankIcon { DankIcon {
id: vpnLoadIcon
name: "sync" name: "sync"
size: 16 size: 16
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
SequentialAnimation {
running: VPNService.configLoading
loops: Animation.Infinite
NumberAnimation {
target: vpnLoadIcon
property: "opacity"
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: vpnLoadIcon
property: "opacity"
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
vpnLoadIcon.opacity = 1.0
}
} }
StyledText { StyledText {