extract PulseAnimation component from 3 modules
This commit is contained in:
parent
8d76df6ef5
commit
b5be146619
5 changed files with 29 additions and 60 deletions
|
|
@ -13,25 +13,9 @@ M.PinnableSection {
|
|||
|
||||
property real _blinkOpacity: 1
|
||||
|
||||
SequentialAnimation {
|
||||
M.PulseAnimation on _blinkOpacity {
|
||||
running: S.BatteryService.critical
|
||||
loops: Animation.Infinite
|
||||
NumberAnimation {
|
||||
target: root
|
||||
property: "_blinkOpacity"
|
||||
to: 0.45
|
||||
duration: 400
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
target: root
|
||||
property: "_blinkOpacity"
|
||||
to: 1
|
||||
duration: 400
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
onRunningChanged: if (!running)
|
||||
root._blinkOpacity = 1
|
||||
minOpacity: 0.45
|
||||
}
|
||||
|
||||
// Bar widgets
|
||||
|
|
|
|||
|
|
@ -55,19 +55,9 @@ Row {
|
|||
shadowHorizontalOffset: 0
|
||||
}
|
||||
|
||||
SequentialAnimation on opacity {
|
||||
M.PulseAnimation on opacity {
|
||||
running: root._videoCapture
|
||||
loops: Animation.Infinite
|
||||
NumberAnimation {
|
||||
to: 0.4
|
||||
duration: 600
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
to: 1
|
||||
duration: 600
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
halfDuration: 600
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -89,19 +79,9 @@ Row {
|
|||
shadowHorizontalOffset: 0
|
||||
}
|
||||
|
||||
SequentialAnimation on opacity {
|
||||
M.PulseAnimation on opacity {
|
||||
running: root._audioIn
|
||||
loops: Animation.Infinite
|
||||
NumberAnimation {
|
||||
to: 0.4
|
||||
duration: 600
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
to: 1
|
||||
duration: 600
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
halfDuration: 600
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
20
shell/modules/PulseAnimation.qml
Normal file
20
shell/modules/PulseAnimation.qml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import QtQuick
|
||||
|
||||
SequentialAnimation {
|
||||
id: root
|
||||
loops: Animation.Infinite
|
||||
|
||||
property real minOpacity: 0.4
|
||||
property int halfDuration: 400
|
||||
|
||||
NumberAnimation {
|
||||
to: root.minOpacity
|
||||
duration: root.halfDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
to: 1
|
||||
duration: root.halfDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
|
@ -29,25 +29,9 @@ RowLayout {
|
|||
implicitWidth: S.Theme.fontSize + 4
|
||||
implicitHeight: S.Theme.fontSize + 4
|
||||
|
||||
SequentialAnimation {
|
||||
M.PulseAnimation on _pulseOpacity {
|
||||
running: iconItem._needsAttention
|
||||
loops: Animation.Infinite
|
||||
NumberAnimation {
|
||||
target: iconItem
|
||||
property: "_pulseOpacity"
|
||||
to: 0.3
|
||||
duration: 400
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
target: iconItem
|
||||
property: "_pulseOpacity"
|
||||
to: 1
|
||||
duration: 400
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
onRunningChanged: if (!running)
|
||||
iconItem._pulseOpacity = 1
|
||||
minOpacity: 0.3
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ PowerModule 1.0 PowerModule.qml
|
|||
PowerProfileModule 1.0 PowerProfileModule.qml
|
||||
PrivacyModule 1.0 PrivacyModule.qml
|
||||
ProcessList 1.0 ProcessList.qml
|
||||
PulseAnimation 1.0 PulseAnimation.qml
|
||||
ScreenCapture 1.0 ScreenCapture.qml
|
||||
ScreenCorners 1.0 ScreenCorners.qml
|
||||
TemperatureModule 1.0 TemperatureModule.qml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue