Suppress animation in Aurorae on creation

Introducing a global animate flag which will be set to enabled once the
Component completed and all border values, etc. are set.
This commit is contained in:
Martin Gräßlin 2013-01-23 07:37:25 +01:00
parent 99e39c8654
commit ed4bd2dd5b
2 changed files with 16 additions and 0 deletions

View file

@ -40,6 +40,7 @@ Item {
}
id: group
property string buttons
property bool animate: false
Row {
id: groupRow
@ -56,6 +57,7 @@ Item {
topMargin: (decoration.maximized ? auroraeTheme.titleEdgeTopMaximized : auroraeTheme.titleEdgeTop + root.padding.top) + auroraeTheme.buttonMarginTop
}
Behavior on anchors.topMargin {
enabled: group.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}

View file

@ -20,6 +20,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Decoration {
id: root
property bool animate: false
Component.onCompleted: {
borders.left = Math.max(0, auroraeTheme.borderLeft);
borders.right = Math.max(0, auroraeTheme.borderRight);
@ -33,6 +34,7 @@ Decoration {
padding.right = auroraeTheme.paddingRight;
padding.bottom = auroraeTheme.paddingBottom;
padding.top = auroraeTheme.paddingTop;
root.animate = true;
}
DecorationOptions {
id: options
@ -56,6 +58,7 @@ Decoration {
opacity: shown ? 1 : 0
enabledBorders: decoration.maximized ? PlasmaCore.FrameSvg.NoBorder : PlasmaCore.FrameSvg.TopBorder | PlasmaCore.FrameSvg.BottomBorder | PlasmaCore.FrameSvg.LeftBorder | PlasmaCore.FrameSvg.RightBorder
Behavior on opacity {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -69,6 +72,7 @@ Decoration {
opacity: (!decoration.active && backgroundSvg.supportsInactive) ? 1 : 0
enabledBorders: decoration.maximized ? PlasmaCore.FrameSvg.NoBorder : PlasmaCore.FrameSvg.TopBorder | PlasmaCore.FrameSvg.BottomBorder | PlasmaCore.FrameSvg.LeftBorder | PlasmaCore.FrameSvg.RightBorder
Behavior on opacity {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -91,6 +95,7 @@ Decoration {
opacity: shown ? 1 : 0
enabledBorders: PlasmaCore.FrameSvg.NoBorder
Behavior on opacity {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -112,6 +117,7 @@ Decoration {
opacity: (!decoration.active && decoration.maximized && backgroundSvg.supportsMaximizedInactive) ? 1 : 0
enabledBorders: PlasmaCore.FrameSvg.NoBorder
Behavior on opacity {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -121,11 +127,13 @@ Decoration {
id: leftButtonGroup
buttons: options.titleButtonsLeft
width: childrenRect.width
animate: root.animate
anchors {
left: parent.left
leftMargin: decoration.maximized ? auroraeTheme.titleEdgeLeftMaximized : (auroraeTheme.titleEdgeLeft + root.padding.left)
}
Behavior on anchors.leftMargin {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -135,11 +143,13 @@ Decoration {
id: rightButtonGroup
buttons: options.titleButtonsRight
width: childrenRect.width
animate: root.animate
anchors {
right: parent.right
rightMargin: decoration.maximized ? auroraeTheme.titleEdgeRightMaximized : (auroraeTheme.titleEdgeRight + root.padding.right)
}
Behavior on anchors.rightMargin {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -177,11 +187,13 @@ Decoration {
onReleased: decoration.titleReleased(mouse.button, mouse.buttons)
}
Behavior on color {
enabled: root.animate
ColorAnimation {
duration: auroraeTheme.animationTime
}
}
Behavior on anchors.topMargin {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -200,6 +212,7 @@ Decoration {
prefix: "innerborder"
opacity: (decoration.active && !decoration.maximized && backgroundSvg.supportsInnerBorder) ? 1 : 0
Behavior on opacity {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}
@ -218,6 +231,7 @@ Decoration {
prefix: "innerborder-inactive"
opacity: (!decoration.active && !decoration.maximized && backgroundSvg.supportsInnerBorderInactive) ? 1 : 0
Behavior on opacity {
enabled: root.animate
NumberAnimation {
duration: auroraeTheme.animationTime
}