mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 22:56:49 +00:00
feat(CaterpillarAnimation): add style file
This commit is contained in:
parent
3fdaa51c01
commit
debef9a9bc
4 changed files with 51 additions and 29 deletions
|
|
@ -55,6 +55,7 @@
|
||||||
<file>ui/modules/Common/Popup/PopupShadow.qml</file>
|
<file>ui/modules/Common/Popup/PopupShadow.qml</file>
|
||||||
<file>ui/modules/Common/qmldir</file>
|
<file>ui/modules/Common/qmldir</file>
|
||||||
<file>ui/modules/Common/SearchBox.qml</file>
|
<file>ui/modules/Common/SearchBox.qml</file>
|
||||||
|
<file>ui/modules/Common/Styles/Animations/CaterpillarAnimationStyle.qml</file>
|
||||||
<file>ui/modules/Common/Styles/CollapseStyle.qml</file>
|
<file>ui/modules/Common/Styles/CollapseStyle.qml</file>
|
||||||
<file>ui/modules/Common/Styles/DialogStyle.qml</file>
|
<file>ui/modules/Common/Styles/DialogStyle.qml</file>
|
||||||
<file>ui/modules/Common/Styles/DroppableTextAreaStyle.qml</file>
|
<file>ui/modules/Common/Styles/DroppableTextAreaStyle.qml</file>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
|
|
||||||
|
import Common.Styles 1.0
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: container
|
id: container
|
||||||
|
|
||||||
property int duration: 200
|
property color sphereColor: CaterpillarAnimationStyle.sphere.color
|
||||||
property int nSpheres: 3
|
property int animationDuration: CaterpillarAnimationStyle.animation.duration
|
||||||
property color sphereColor: '#8F8F8F'
|
property int nSpheres: CaterpillarAnimationStyle.nSpheres
|
||||||
property int sphereSize: 10
|
property int sphereSize: CaterpillarAnimationStyle.sphere.size
|
||||||
property int sphereSpaceSize: 10
|
property int animationSpace: CaterpillarAnimationStyle.animation.space
|
||||||
|
|
||||||
spacing: 6
|
spacing: 6
|
||||||
|
|
||||||
|
|
@ -41,7 +43,7 @@ Row {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y === (sphereSpaceSize / 2) && previousY === 0) {
|
if (y === (animationSpace / 2) && previousY === 0) {
|
||||||
repeater.itemAt(index + 1).startAnimation()
|
repeater.itemAt(index + 1).startAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,19 +58,19 @@ Row {
|
||||||
}
|
}
|
||||||
|
|
||||||
YAnimator on y {
|
YAnimator on y {
|
||||||
duration: container.duration
|
duration: container.animationDuration
|
||||||
from: 0
|
from: 0
|
||||||
id: animator
|
id: animator
|
||||||
running: false
|
running: false
|
||||||
to: sphereSpaceSize / 2
|
to: animationSpace / 2
|
||||||
|
|
||||||
onRunningChanged: {
|
onRunningChanged: {
|
||||||
if (running) {
|
if (running) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var mid = sphereSpaceSize / 2
|
var mid = animationSpace / 2
|
||||||
if (from === sphereSpaceSize && to === mid) {
|
if (from === animationSpace && to === mid) {
|
||||||
from = mid
|
from = mid
|
||||||
to = 0
|
to = 0
|
||||||
} else if (from === mid && to === 0) {
|
} else if (from === mid && to === 0) {
|
||||||
|
|
@ -80,9 +82,9 @@ Row {
|
||||||
}
|
}
|
||||||
} else if (from === 0 && to === mid) {
|
} else if (from === 0 && to === mid) {
|
||||||
from = mid
|
from = mid
|
||||||
to = sphereSpaceSize
|
to = animationSpace
|
||||||
} else {
|
} else {
|
||||||
from = sphereSpaceSize
|
from = animationSpace
|
||||||
to = mid
|
to = mid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
pragma Singleton
|
||||||
|
import QtQuick 2.7
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
property int nSpheres: 3
|
||||||
|
|
||||||
|
property QtObject animation: QtObject {
|
||||||
|
property int duration: 200
|
||||||
|
property int space: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
property QtObject sphere: QtObject {
|
||||||
|
property color color: '#8F8F8F'
|
||||||
|
|
||||||
|
property int size: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,22 +3,24 @@
|
||||||
module Common.Styles
|
module Common.Styles
|
||||||
|
|
||||||
# Components styles.
|
# Components styles.
|
||||||
singleton CollapseStyle 1.0 CollapseStyle.qml
|
singleton CaterpillarAnimationStyle 1.0 Animations/CaterpillarAnimationStyle.qml
|
||||||
singleton DialogStyle 1.0 DialogStyle.qml
|
|
||||||
singleton DroppableTextAreaStyle 1.0 DroppableTextAreaStyle.qml
|
|
||||||
|
|
||||||
singleton ForceScrollBarStyle 1.0 ForceScrollBarStyle.qml
|
singleton CollapseStyle 1.0 CollapseStyle.qml
|
||||||
singleton MenuStyle 1.0 MenuStyle.qml
|
singleton DialogStyle 1.0 DialogStyle.qml
|
||||||
singleton PanedStyle 1.0 PanedStyle.qml
|
singleton DroppableTextAreaStyle 1.0 DroppableTextAreaStyle.qml
|
||||||
singleton PopupStyle 1.0 PopupStyle.qml
|
|
||||||
singleton SearchBoxStyle 1.0 SearchBoxStyle.qml
|
|
||||||
|
|
||||||
singleton AbstractTextButtonStyle 1.0 Form/AbstractTextButtonStyle.qml
|
singleton ForceScrollBarStyle 1.0 ForceScrollBarStyle.qml
|
||||||
singleton ActionBarStyle 1.0 Form/ActionBarStyle.qml
|
singleton MenuStyle 1.0 MenuStyle.qml
|
||||||
singleton CheckBoxTextStyle 1.0 Form/CheckBoxTextStyle.qml
|
singleton PanedStyle 1.0 PanedStyle.qml
|
||||||
singleton ExclusiveButtonsStyle 1.0 Form/ExclusiveButtonsStyle.qml
|
singleton PopupStyle 1.0 PopupStyle.qml
|
||||||
singleton ListFormStyle 1.0 Form/ListFormStyle.qml
|
singleton SearchBoxStyle 1.0 SearchBoxStyle.qml
|
||||||
singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml
|
|
||||||
singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml
|
singleton AbstractTextButtonStyle 1.0 Form/AbstractTextButtonStyle.qml
|
||||||
singleton TextButtonBStyle 1.0 Form/TextButtonBStyle.qml
|
singleton ActionBarStyle 1.0 Form/ActionBarStyle.qml
|
||||||
singleton TransparentComboBoxStyle 1.0 Form/TransparentComboBoxStyle.qml
|
singleton CheckBoxTextStyle 1.0 Form/CheckBoxTextStyle.qml
|
||||||
|
singleton ExclusiveButtonsStyle 1.0 Form/ExclusiveButtonsStyle.qml
|
||||||
|
singleton ListFormStyle 1.0 Form/ListFormStyle.qml
|
||||||
|
singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml
|
||||||
|
singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml
|
||||||
|
singleton TextButtonBStyle 1.0 Form/TextButtonBStyle.qml
|
||||||
|
singleton TransparentComboBoxStyle 1.0 Form/TransparentComboBoxStyle.qml
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue