Fixes from code review
This commit is contained in:
parent
425f02b800
commit
8871f7e9d8
@ -50,12 +50,6 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// BusyIndicator {
|
||||
// Layout.alignment: Qt.AlignHCenter
|
||||
// running: roomSettings.isLoading
|
||||
// visible: roomSettings.isLoading
|
||||
// }
|
||||
|
||||
Spinner {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: roomSettings.isLoading
|
||||
|
@ -5,6 +5,8 @@
|
||||
import QtQuick 2.12
|
||||
import QtGraphicalEffects 1.12
|
||||
|
||||
import "./animations"
|
||||
|
||||
Item {
|
||||
id: spinner
|
||||
|
||||
@ -15,6 +17,8 @@ Item {
|
||||
readonly property real a: Math.PI / 6
|
||||
readonly property var colors: ["#c0def5", "#87aade", "white"]
|
||||
readonly property var anims: [anim1, anim2, anim3, anim4, anim5, anim6]
|
||||
readonly property int pauseDuration: barCount * 150
|
||||
readonly property int glowDuration: 300
|
||||
|
||||
height: 40
|
||||
width: barCount * (height * 0.375)
|
||||
@ -70,118 +74,50 @@ Item {
|
||||
color: "white"
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
BlinkAnimation {
|
||||
id: anim1
|
||||
target: rect1
|
||||
pauseDuration: spinner.pauseDuration
|
||||
glowDuration: spinner.glowDuration
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
target: rect1
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
duration: spinner.barCount * 150
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
BlinkAnimation {
|
||||
id: anim2
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
target: rect2
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
duration: spinner.barCount * 150
|
||||
}
|
||||
|
||||
target: rect2
|
||||
pauseDuration: spinner.pauseDuration
|
||||
glowDuration: spinner.glowDuration
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
BlinkAnimation {
|
||||
id: anim3
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
target: rect3
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
duration: spinner.barCount * 150
|
||||
}
|
||||
target: rect3
|
||||
pauseDuration: spinner.pauseDuration
|
||||
glowDuration: spinner.glowDuration
|
||||
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
BlinkAnimation {
|
||||
id: anim4
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
target: rect4
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
duration: spinner.barCount * 150
|
||||
}
|
||||
target: rect4
|
||||
pauseDuration: spinner.pauseDuration
|
||||
glowDuration: spinner.glowDuration
|
||||
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
BlinkAnimation {
|
||||
id: anim5
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
target: rect5
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
duration: spinner.barCount * 150
|
||||
}
|
||||
|
||||
target: rect5
|
||||
pauseDuration: spinner.pauseDuration
|
||||
glowDuration: spinner.glowDuration
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
BlinkAnimation {
|
||||
id: anim6
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
target: rect6
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
duration: spinner.barCount * 150
|
||||
}
|
||||
|
||||
target: rect6
|
||||
pauseDuration: spinner.pauseDuration
|
||||
glowDuration: spinner.glowDuration
|
||||
}
|
||||
|
||||
transform: Matrix4x4 {
|
||||
|
28
resources/qml/ui/animations/BlinkAnimation.qml
Normal file
28
resources/qml/ui/animations/BlinkAnimation.qml
Normal file
@ -0,0 +1,28 @@
|
||||
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtGraphicalEffects 1.12
|
||||
|
||||
SequentialAnimation {
|
||||
property alias target: numberAnimation.target
|
||||
property alias glowDuration: numberAnimation.duration
|
||||
property alias pauseDuration: pauseAnimation.duration
|
||||
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation {
|
||||
id: numberAnimation
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
// /duration: 300
|
||||
}
|
||||
|
||||
PauseAnimation {
|
||||
id: pauseAnimation
|
||||
// duration: spinner.barCount * 150
|
||||
}
|
||||
|
||||
}
|
2
resources/qml/ui/animations/qmldir
Normal file
2
resources/qml/ui/animations/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
module im.nheko.UI.Animations
|
||||
BlinkAnimation 1.0 BlinkAnimation.qml
|
@ -1,2 +1,3 @@
|
||||
module im.nheko.UI
|
||||
Ripple 1.0 Ripple.qml
|
||||
Ripple 1.0 Ripple.qml
|
||||
Spinner 1.0 Spinner.qml
|
@ -172,6 +172,7 @@
|
||||
<file>qml/dialogs/InputDialog.qml</file>
|
||||
<file>qml/ui/Ripple.qml</file>
|
||||
<file>qml/ui/Spinner.qml</file>
|
||||
<file>qml/ui/animations/BlinkAnimation.qml</file>
|
||||
<file>qml/voip/ActiveCallBar.qml</file>
|
||||
<file>qml/voip/CallDevices.qml</file>
|
||||
<file>qml/voip/CallInvite.qml</file>
|
||||
|
Loading…
Reference in New Issue
Block a user