From ed4bd2dd5bb4ca4c85e645a846ee0edbf7887606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 23 Jan 2013 07:37:25 +0100 Subject: [PATCH] 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. --- clients/aurorae/src/qml/AuroraeButtonGroup.qml | 2 ++ clients/aurorae/src/qml/aurorae.qml | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/clients/aurorae/src/qml/AuroraeButtonGroup.qml b/clients/aurorae/src/qml/AuroraeButtonGroup.qml index 911d5c3171..c49975f7dd 100644 --- a/clients/aurorae/src/qml/AuroraeButtonGroup.qml +++ b/clients/aurorae/src/qml/AuroraeButtonGroup.qml @@ -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 } diff --git a/clients/aurorae/src/qml/aurorae.qml b/clients/aurorae/src/qml/aurorae.qml index 8b198f6134..6a4e3fb753 100644 --- a/clients/aurorae/src/qml/aurorae.qml +++ b/clients/aurorae/src/qml/aurorae.qml @@ -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 }