diff --git a/examples/applets/testtheme/contents/ui/UnitsPage.qml b/examples/applets/testtheme/contents/ui/UnitsPage.qml index 74aba62c6..8865bbedc 100644 --- a/examples/applets/testtheme/contents/ui/UnitsPage.qml +++ b/examples/applets/testtheme/contents/ui/UnitsPage.qml @@ -84,30 +84,6 @@ Item { } } - Row { - PlasmaComponents.Label { - text: "units.dp: " - width: cwidth - } - PlasmaComponents.Label { - width: cheight - height: cheight / 2 - text: units.dp(1) - } - } - - Row { - PlasmaComponents.Label { - text: "units.gu: " - width: cwidth - } - PlasmaComponents.Label { - width: cheight - height: cheight / 2 - text: units.gu(1) - } - } - Row { PlasmaComponents.Label { text: "units.largeSpacing: " diff --git a/examples/containments/testcontainment/contents/ui/main.qml b/examples/containments/testcontainment/contents/ui/main.qml index c60e88040..889afa3fd 100644 --- a/examples/containments/testcontainment/contents/ui/main.qml +++ b/examples/containments/testcontainment/contents/ui/main.qml @@ -157,7 +157,7 @@ Item { target: frame properties: "scale" to: 0 - duration: 250 + duration: units.longDuration } ScriptAction { script: frame.destroy()} } @@ -177,8 +177,8 @@ Item { property real startX: mouseArea.startX/mouseArea.width property real startY: mouseArea.startY/mouseArea.height - NumberAnimation on dx { id: dxAnim; to: 0; duration: 350; easing.type: Easing.OutElastic } - NumberAnimation on dy { id: dyAnim; to: 0; duration: 350; easing.type: Easing.OutElastic } + NumberAnimation on dx { id: dxAnim; to: 0; duration: units.longDuration; easing.type: Easing.OutElastic } + NumberAnimation on dy { id: dyAnim; to: 0; duration: units.longDuration; easing.type: Easing.OutElastic } //! [fragment] fragmentShader: { "uniform lowp float qt_Opacity;" + diff --git a/src/declarativeimports/core/units.cpp b/src/declarativeimports/core/units.cpp index bb4090197..bccb435c0 100644 --- a/src/declarativeimports/core/units.cpp +++ b/src/declarativeimports/core/units.cpp @@ -33,7 +33,8 @@ Units::Units (QObject *parent) : QObject(parent), m_gridUnit(-1), - m_devicePixelRatio(-1) + m_devicePixelRatio(-1), + m_longDuration(250) // default base value for animations { m_iconSizes = new QQmlPropertyMap(this); updateDevicePixelRatio(); @@ -130,7 +131,6 @@ void Units::updateDevicePixelRatio() int Units::gridUnit() const { - const int gridUnit = QFontMetrics(QApplication::font()).boundingRect("M").width(); return m_gridUnit; } @@ -163,6 +163,17 @@ void Units::updateSpacing() } } + +int Units::longDuration() const +{ + return m_longDuration; +} + +int Units::shortDuration() const +{ + return m_longDuration / 5; +} + bool Units::eventFilter(QObject *watched, QEvent *event) { if (watched == QCoreApplication::instance()) { @@ -173,5 +184,3 @@ bool Units::eventFilter(QObject *watched, QEvent *event) return QObject::eventFilter(watched, event); } -#include "units.moc" - diff --git a/src/declarativeimports/core/units.h b/src/declarativeimports/core/units.h index 5885a874c..135525a5d 100644 --- a/src/declarativeimports/core/units.h +++ b/src/declarativeimports/core/units.h @@ -36,7 +36,7 @@ class Units : public QObject * The fundamental unit of space that should be used for sizes, expressed in pixels. * Given the screen has an accurate DPI settings, it corresponds to a millimeter */ - Q_PROPERTY(int gridUnit READ gridUnit NOTIFY gridUnitChanged()) + Q_PROPERTY(int gridUnit READ gridUnit NOTIFY gridUnitChanged) /** * units.iconSizes provides access to platform-dependent icon sizing @@ -83,6 +83,18 @@ class Units : public QObject */ Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged) + /** + * units.longDuration should be used for longer, screen-covering animations, for opening and + * closing of dialogs and other "not too small" animations + */ + Q_PROPERTY(int longDuration READ longDuration NOTIFY durationChanged) + + /** + * units.longDuration should be used for short animations, such as accentuating a UI event, + * hover events, etc.. + */ + Q_PROPERTY(int shortDuration READ shortDuration NOTIFY durationChanged) + public: Units(QObject *parent = 0); ~Units(); @@ -116,11 +128,24 @@ public: */ int largeSpacing() const; + /** + * @return Duration for long animations, in milliseconds. + * @since 5.0 + */ + int longDuration() const; + + /** + * @return Duration for short animations, in milliseconds. + * @since 5.0 + */ + int shortDuration() const; + Q_SIGNALS: void devicePixelRatioChanged(); void gridUnitChanged(); void iconSizesChanged(); void spacingChanged(); + void durationChanged(); private Q_SLOTS: void themeChanged(); @@ -144,6 +169,8 @@ private: int m_smallSpacing; int m_largeSpacing; + + int m_longDuration; }; #endif //UNITS_H diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/EditBubble.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/EditBubble.qml index cf443b0a0..2e9fedd9b 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/EditBubble.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/EditBubble.qml @@ -55,10 +55,10 @@ PlasmaCore.FrameSvgItem { onClicked: { textField.copy(); editBubble.state = "collapsed"; } onPressed: PropertyAnimation { target: copyIcon; properties: "scale"; from: 1.0; to: 0.9; - duration: 175; easing.type: Easing.OutExpo; } + duration: units.shortDuration * 3; easing.type: Easing.OutExpo; } onReleased: PropertyAnimation { target: copyIcon; properties: "scale"; from: 0.9; to: 1.0; - duration: 175; easing.type: Easing.OutExpo; } + duration: units.shortDuration * 3; easing.type: Easing.OutExpo; } } } PlasmaCore.IconItem { @@ -74,10 +74,10 @@ PlasmaCore.FrameSvgItem { onClicked: { textField.paste(); editBubble.state = "collapsed"; } onPressed: PropertyAnimation { target: pasteIcon; properties: "scale"; from: 1.0; to: 0.9; - duration: 175; easing.type: Easing.OutExpo; } + duration: units.shortDuration * 3; easing.type: Easing.OutExpo; } onReleased: PropertyAnimation { target: pasteIcon; properties: "scale"; from: 0.9; to: 1.0; - duration: 175; easing.type: Easing.OutExpo; } + duration: units.shortDuration * 3; easing.type: Easing.OutExpo; } } } } @@ -98,15 +98,15 @@ PlasmaCore.FrameSvgItem { Transition { from: "collapsed"; to: "expanded" ParallelAnimation { - PropertyAnimation { properties: "opacity"; duration: 175; easing.type: Easing.InExpo; } - PropertyAnimation { properties: "scale"; duration: 175; easing.type: Easing.InExpo; } + PropertyAnimation { properties: "opacity"; duration: units.shortDuration * 3; easing.type: Easing.InExpo; } + PropertyAnimation { properties: "scale"; duration: units.shortDuration * 3; easing.type: Easing.InExpo; } } }, Transition { from: "expanded"; to: "collapsed" ParallelAnimation { - PropertyAnimation { properties: "opacity"; duration: 175; easing.type: Easing.OutExpo; } - PropertyAnimation { properties: "scale"; duration: 100; easing.type: Easing.OutExpo; } + PropertyAnimation { properties: "opacity"; duration: units.shortDuration * 3; easing.type: Easing.OutExpo; } + PropertyAnimation { properties: "scale"; duration: units.shortDuration * 2; easing.type: Easing.OutExpo; } } } ] diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/SectionScroller.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/SectionScroller.qml index f1a621564..900c55e54 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/SectionScroller.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/SectionScroller.qml @@ -85,7 +85,7 @@ Item { opacity: 0 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration } } @@ -172,7 +172,7 @@ Item { opacity: dragArea.pressed?1:0 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration } } } diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml index d61a63d76..6f93e7110 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml @@ -50,7 +50,7 @@ Private.DualStateButton { opacity: checked ? 1 : 0 Behavior on opacity { - PropertyAnimation { duration: 100 } + PropertyAnimation { duration: units.shortDuration * 2 } } } @@ -77,7 +77,7 @@ Private.DualStateButton { width: height x: checked ? width : 0 Behavior on x { - PropertyAnimation { duration: 100 } + PropertyAnimation { duration: units.shortDuration * 2 } } } } diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextField.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextField.qml index c0baa4b4f..bdad67b2c 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextField.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextField.qml @@ -178,7 +178,7 @@ Item { opacity: (textInput.text != "" && clearButtonShown) ? 1 : 0 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextFieldFocus.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextFieldFocus.qml index 237893319..f550e6609 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextFieldFocus.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/TextFieldFocus.qml @@ -63,7 +63,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/ButtonShadow.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/ButtonShadow.qml index 440add43c..e49655632 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/ButtonShadow.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/ButtonShadow.qml @@ -61,7 +61,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/RoundShadow.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/RoundShadow.qml index e8ca2e684..fb928583d 100644 --- a/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/RoundShadow.qml +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/private/RoundShadow.qml @@ -96,7 +96,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/Button.qml b/src/declarativeimports/plasmacomponents/qml/Button.qml index c27a6a57f..03fa42c65 100644 --- a/src/declarativeimports/plasmacomponents/qml/Button.qml +++ b/src/declarativeimports/plasmacomponents/qml/Button.qml @@ -29,7 +29,6 @@ * theme. */ import QtQuick 2.0 - import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private @@ -215,8 +214,8 @@ Item { to: "normal" // Cross fade from pressed to normal ParallelAnimation { - NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: 100 } - NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: 100 } + NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: units.shortDuration * 2 } + NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: units.shortDuration * 2 } } } ] diff --git a/src/declarativeimports/plasmacomponents/qml/CheckBox.qml b/src/declarativeimports/plasmacomponents/qml/CheckBox.qml index af3455d0c..7d9413e5c 100644 --- a/src/declarativeimports/plasmacomponents/qml/CheckBox.qml +++ b/src/declarativeimports/plasmacomponents/qml/CheckBox.qml @@ -55,7 +55,7 @@ Private.DualStateButton { } Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/Highlight.qml b/src/declarativeimports/plasmacomponents/qml/Highlight.qml index 86626c932..9fce7eb44 100644 --- a/src/declarativeimports/plasmacomponents/qml/Highlight.qml +++ b/src/declarativeimports/plasmacomponents/qml/Highlight.qml @@ -26,7 +26,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore * derivates) * * Provides built-in animation of Behavior on opacity Easing.OutQuad for a - * duration of 250. + * duration of 250 (defined in units.longDuration). * * (TODO, make optional? e.g. animate: false) */ @@ -55,7 +55,7 @@ Item { Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } @@ -75,7 +75,7 @@ Item { Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/ListItem.qml b/src/declarativeimports/plasmacomponents/qml/ListItem.qml index 4dcc2d71e..a0e9ff2ff 100644 --- a/src/declarativeimports/plasmacomponents/qml/ListItem.qml +++ b/src/declarativeimports/plasmacomponents/qml/ListItem.qml @@ -94,7 +94,7 @@ Item { Component.onCompleted: { prefix = (listItem.sectionDelegate ? "section" : (listItem.checked ? "pressed" : "normal")) } - Behavior on opacity { NumberAnimation { duration: 200 } } + Behavior on opacity { NumberAnimation { duration: units.longDuration } } } PlasmaCore.SvgItem { svg: PlasmaCore.Svg {imagePath: "widgets/listitem"} diff --git a/src/declarativeimports/plasmacomponents/qml/PageStack.qml b/src/declarativeimports/plasmacomponents/qml/PageStack.qml index d669701ac..f61f4e574 100644 --- a/src/declarativeimports/plasmacomponents/qml/PageStack.qml +++ b/src/declarativeimports/plasmacomponents/qml/PageStack.qml @@ -44,6 +44,8 @@ // navigation model. Pages can be defined as QML items or components. import QtQuick 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore + import "." 2.0 as PlasmaComponents import "private/PageStack.js" as Engine @@ -81,7 +83,7 @@ Item { /** * Should page transitions be animated? Default is true. */ - property bool animate: true + property bool animate: units.longDuration > 0 /** * The page to be automatically loaded when this PageStack component gets @@ -264,7 +266,7 @@ Item { property int stackWidth: Math.max(root.width, root.height) // Duration of transition animation (in ms) - property int transitionDuration: root.animate ? 150 : 0 + property int transitionDuration: root.animate ? units.longAnimation / 2 : 0 // Flag that indicates the container should be cleaned up after the transition has ended. property bool cleanupAfterTransition: false diff --git a/src/declarativeimports/plasmacomponents/qml/RadioButton.qml b/src/declarativeimports/plasmacomponents/qml/RadioButton.qml index c93ec8dc1..9e340b959 100644 --- a/src/declarativeimports/plasmacomponents/qml/RadioButton.qml +++ b/src/declarativeimports/plasmacomponents/qml/RadioButton.qml @@ -54,7 +54,7 @@ Private.DualStateButton { } Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/SectionScroller.qml b/src/declarativeimports/plasmacomponents/qml/SectionScroller.qml index 2e73835a1..e7c80d53c 100644 --- a/src/declarativeimports/plasmacomponents/qml/SectionScroller.qml +++ b/src/declarativeimports/plasmacomponents/qml/SectionScroller.qml @@ -80,7 +80,7 @@ Item { implicitWidth: scrollBar.implicitWidth Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration } } @@ -129,7 +129,7 @@ Item { opacity: sectionLabel.text && scrollBar.pressed ? 1 : 0 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration } } } diff --git a/src/declarativeimports/plasmacomponents/qml/Slider.qml b/src/declarativeimports/plasmacomponents/qml/Slider.qml index b7b612af2..512e0bde4 100644 --- a/src/declarativeimports/plasmacomponents/qml/Slider.qml +++ b/src/declarativeimports/plasmacomponents/qml/Slider.qml @@ -157,7 +157,7 @@ Item { id: contents // Plasma API - property bool animated: true + property bool animated: units.longDuration > 0 property real handleWidth: contents.isVertical ? grooveSvg.elementSize("vertical-slider-handle").width : grooveSvg.elementSize("horizontal-slider-handle").width property real handleHeight: contents.isVertical ? grooveSvg.elementSize("vertical-slider-handle").height : grooveSvg.elementSize("horizontal-slider-handle").height diff --git a/src/declarativeimports/plasmacomponents/qml/Switch.qml b/src/declarativeimports/plasmacomponents/qml/Switch.qml index af3455d0c..7d9413e5c 100644 --- a/src/declarativeimports/plasmacomponents/qml/Switch.qml +++ b/src/declarativeimports/plasmacomponents/qml/Switch.qml @@ -55,7 +55,7 @@ Private.DualStateButton { } Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/TabBar.qml b/src/declarativeimports/plasmacomponents/qml/TabBar.qml index 44469bbd1..4578cce37 100644 --- a/src/declarativeimports/plasmacomponents/qml/TabBar.qml +++ b/src/declarativeimports/plasmacomponents/qml/TabBar.qml @@ -100,7 +100,7 @@ FocusScope { Behavior on x { PropertyAnimation { easing.type: Easing.InQuad - duration: 250 + duration: units.longDuration } } } @@ -168,7 +168,7 @@ FocusScope { } Behavior on x { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/TabGroup.qml b/src/declarativeimports/plasmacomponents/qml/TabGroup.qml index 9da387c88..c2e733dcb 100644 --- a/src/declarativeimports/plasmacomponents/qml/TabGroup.qml +++ b/src/declarativeimports/plasmacomponents/qml/TabGroup.qml @@ -207,14 +207,14 @@ Item { to: "Incoming" SequentialAnimation { ScriptAction { script: root.clip = true } - PropertyAnimation { properties: "opacity,x"; easing.type: Easing.InQuad; duration: 250 } + PropertyAnimation { properties: "opacity,x"; easing.type: Easing.InQuad; duration: units.longDuration } ScriptAction { script: {incomingDone(); root.clip = false} } } }, Transition { to: "OutgoingLeft,OutgoingRight" SequentialAnimation { - PropertyAnimation { properties: "opacity,x"; easing.type: Easing.InQuad; duration: 250 } + PropertyAnimation { properties: "opacity,x"; easing.type: Easing.InQuad; duration: units.longDuration } ScriptAction { script: outgoingDone() } } } diff --git a/src/declarativeimports/plasmacomponents/qml/TextField.qml b/src/declarativeimports/plasmacomponents/qml/TextField.qml index b1f5a4d93..0301b7b1e 100644 --- a/src/declarativeimports/plasmacomponents/qml/TextField.qml +++ b/src/declarativeimports/plasmacomponents/qml/TextField.qml @@ -363,7 +363,7 @@ FocusScope { opacity: (textInput.text != "" && clearButtonShown && textField.enabled) ? 1 : 0 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/ToolBar.qml b/src/declarativeimports/plasmacomponents/qml/ToolBar.qml index be4fd9ba0..edb3042b9 100644 --- a/src/declarativeimports/plasmacomponents/qml/ToolBar.qml +++ b/src/declarativeimports/plasmacomponents/qml/ToolBar.qml @@ -39,7 +39,7 @@ Item{ Behavior on height { PropertyAnimation { id: heightAnimation - duration: 250 + duration: units.longDuration } } z: 1000 @@ -201,19 +201,19 @@ Item{ Behavior on opacity { PropertyAnimation { id: containerAOpacityAnimation - duration: 250 + duration: units.longDuration } } Behavior on x { enabled: containerA.animationsEnabled PropertyAnimation { - duration: 250 + duration: units.longDuration } } Behavior on y { enabled: containerA.animationsEnabled PropertyAnimation { - duration: 250 + duration: units.longDuration } } } @@ -223,18 +223,18 @@ Item{ height: parent.height opacity: 0 Behavior on opacity { - PropertyAnimation { duration: 250 } + PropertyAnimation { duration: units.longDuration } } Behavior on x { enabled: containerA.animationsEnabled PropertyAnimation { - duration: 250 + duration: units.longDuration } } Behavior on y { enabled: containerA.animationsEnabled PropertyAnimation { - duration: 250 + duration: units.longDuration } } } diff --git a/src/declarativeimports/plasmacomponents/qml/ToolButton.qml b/src/declarativeimports/plasmacomponents/qml/ToolButton.qml index 3f7a91cbd..6721dcfb0 100644 --- a/src/declarativeimports/plasmacomponents/qml/ToolButton.qml +++ b/src/declarativeimports/plasmacomponents/qml/ToolButton.qml @@ -227,7 +227,7 @@ Item { //internal: if there is no hover status, don't paint on mouse over in touchscreens opacity: (internal.userPressed || checked || !flat || (shadow.hasOverState && mouse.containsMouse && button.enabled)) ? 1 : 0 Behavior on opacity { - PropertyAnimation { duration: 250 } + PropertyAnimation { duration: units.longDuration } } PlasmaCore.Svg { @@ -333,7 +333,7 @@ Item { //internal: if there is no hover status, don't paint on mouse over in touchscreens opacity: (internal.userPressed || checked || !flat || (roundShadow.hasOverState && mouse.containsMouse)) ? 1 : 0 Behavior on opacity { - PropertyAnimation { duration: 250 } + PropertyAnimation { duration: units.longDuration } } } } @@ -365,7 +365,7 @@ Item { height: parent.height color: mouse.containsMouse ? theme.buttonTextColor : theme.textColor - Behavior on color { ColorAnimation { duration: 100 } } + Behavior on color { ColorAnimation { duration: units.shortDuration * 2 } } elide: Text.ElideRight horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter diff --git a/src/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml b/src/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml index e90c0938e..f01747857 100644 --- a/src/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml +++ b/src/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml @@ -126,7 +126,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/private/InlineDialog.qml b/src/declarativeimports/plasmacomponents/qml/private/InlineDialog.qml index 32ba3e9fc..4c6c157b3 100644 --- a/src/declarativeimports/plasmacomponents/qml/private/InlineDialog.qml +++ b/src/declarativeimports/plasmacomponents/qml/private/InlineDialog.qml @@ -47,7 +47,7 @@ Item { SequentialAnimation { id: appearAnimation NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad target: dismissArea properties: "opacity" diff --git a/src/declarativeimports/plasmacomponents/qml/private/RoundShadow.qml b/src/declarativeimports/plasmacomponents/qml/private/RoundShadow.qml index 045d381a1..a3e6f4fbc 100644 --- a/src/declarativeimports/plasmacomponents/qml/private/RoundShadow.qml +++ b/src/declarativeimports/plasmacomponents/qml/private/RoundShadow.qml @@ -126,7 +126,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/private/ScrollDecoratorDelegate.qml b/src/declarativeimports/plasmacomponents/qml/private/ScrollDecoratorDelegate.qml index 6e226da3c..b25359b8a 100644 --- a/src/declarativeimports/plasmacomponents/qml/private/ScrollDecoratorDelegate.qml +++ b/src/declarativeimports/plasmacomponents/qml/private/ScrollDecoratorDelegate.qml @@ -34,7 +34,7 @@ PlasmaCore.FrameSvgItem { opacity: 0 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmacomponents/qml/private/TextFieldFocus.qml b/src/declarativeimports/plasmacomponents/qml/private/TextFieldFocus.qml index 88dfafc3c..a2093de62 100644 --- a/src/declarativeimports/plasmacomponents/qml/private/TextFieldFocus.qml +++ b/src/declarativeimports/plasmacomponents/qml/private/TextFieldFocus.qml @@ -90,7 +90,7 @@ Item { Transition { PropertyAnimation { properties: "opacity" - duration: 250 + duration: units.longDuration easing.type: Easing.OutQuad } } diff --git a/src/declarativeimports/plasmaextracomponents/qml/App.qml b/src/declarativeimports/plasmaextracomponents/qml/App.qml index 7719a9282..5424bbd21 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/App.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/App.qml @@ -121,7 +121,7 @@ Item { clip: true width: navigationWidth + space Behavior on width { - NumberAnimation { duration: 250; easing.type: Easing.InOutExpo; } + NumberAnimation { duration: units.longDuration; easing.type: Easing.InOutExpo; } } Item { diff --git a/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml b/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml index 0be636f90..d7989ea49 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml @@ -178,7 +178,7 @@ Item { property bool completed: false // Duration of transition animation (in ms) - property int transitionDuration: 250 + property int transitionDuration: units.longDuration // Sets the page status. function setPageStatus(page, status) diff --git a/src/declarativeimports/plasmaextracomponents/qml/ScrollArea.qml b/src/declarativeimports/plasmaextracomponents/qml/ScrollArea.qml index 20cd9438b..860c0e7e3 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/ScrollArea.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/ScrollArea.qml @@ -187,7 +187,7 @@ Item { opacity: flickableItem.atYBeginning ? 0 : 1 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } @@ -207,7 +207,7 @@ Item { opacity: flickableItem.atYEnd ? 0 : 1 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } @@ -226,7 +226,7 @@ Item { opacity: flickableItem.atXBeginning ? 0 : 1 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } @@ -245,7 +245,7 @@ Item { opacity: flickableItem.atXEnd ? 0 : 1 Behavior on opacity { NumberAnimation { - duration: 250 + duration: units.longDuration easing.type: Easing.InOutQuad } } diff --git a/src/declarativeimports/plasmaextracomponents/qml/animations/ActivateAnimation.qml b/src/declarativeimports/plasmaextracomponents/qml/animations/ActivateAnimation.qml index 508b946c3..d1d22d1f0 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/animations/ActivateAnimation.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/animations/ActivateAnimation.qml @@ -19,14 +19,14 @@ */ import QtQuick 2.0 -import "Animations.js" as Animations +import org.kde.plasma.core 2.0 as PlasmaCore SequentialAnimation { id: activateAnimation objectName: "activateAnimation" property Item targetItem - property int duration: Animations.normalDuration/5 + property int duration: units.shortDuration // Fast scaling while we're animation == more FPS ScriptAction { script: targetItem.smooth = false } diff --git a/src/declarativeimports/plasmaextracomponents/qml/animations/Animations.js b/src/declarativeimports/plasmaextracomponents/qml/animations/Animations.js deleted file mode 100644 index 96db3c14a..000000000 --- a/src/declarativeimports/plasmaextracomponents/qml/animations/Animations.js +++ /dev/null @@ -1,8 +0,0 @@ - -.pragma library - -// a normal animation -var normalDuration = 250; - -// for direct feedback, such as tapping -var feedbackDuration = 50; \ No newline at end of file diff --git a/src/declarativeimports/plasmaextracomponents/qml/animations/AppearAnimation.qml b/src/declarativeimports/plasmaextracomponents/qml/animations/AppearAnimation.qml index cd15a060f..24ae693eb 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/animations/AppearAnimation.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/animations/AppearAnimation.qml @@ -19,14 +19,13 @@ */ import QtQuick 2.0 -import "Animations.js" as Animations SequentialAnimation { id: appearAnimation objectName: "appearAnimation" property Item targetItem - property int duration: Animations.normalDuration + property int duration: units.longDuration // Fast scaling while we're animation == more FPS ScriptAction { script: { targetItem.smooth = false; targetItem.visible = true; } } diff --git a/src/declarativeimports/plasmaextracomponents/qml/animations/DisappearAnimation.qml b/src/declarativeimports/plasmaextracomponents/qml/animations/DisappearAnimation.qml index 2469a78fa..faa4f71c5 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/animations/DisappearAnimation.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/animations/DisappearAnimation.qml @@ -19,14 +19,14 @@ */ import QtQuick 2.0 -import "Animations.js" as Animations +import org.kde.plasma.core 2.0 as PlasmaCore SequentialAnimation { id: disappearAnimation objectName: "disappearAnimation" property Item targetItem - property int duration: Animations.normalDuration + property int duration: units.longDuration ScriptAction { script: targetItem.smooth = false; } diff --git a/src/declarativeimports/plasmaextracomponents/qml/animations/PressedAnimation.qml b/src/declarativeimports/plasmaextracomponents/qml/animations/PressedAnimation.qml index 819e0642d..c50b8fd30 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/animations/PressedAnimation.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/animations/PressedAnimation.qml @@ -19,14 +19,14 @@ */ import QtQuick 2.0 -import "Animations.js" as Animations +import org.kde.plasma.core 2.0 as PlasmaCore SequentialAnimation { id: pressedAnimation objectName: "pressedAnimation" property Item targetItem - property int duration: Animations.feedbackDuration + property int duration: units.shortDuration // Fast scaling while we're animation == more FPS ScriptAction { script: targetItem.smooth = false } diff --git a/src/declarativeimports/plasmaextracomponents/qml/animations/ReleasedAnimation.qml b/src/declarativeimports/plasmaextracomponents/qml/animations/ReleasedAnimation.qml index eff0fe645..029119d7d 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/animations/ReleasedAnimation.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/animations/ReleasedAnimation.qml @@ -19,14 +19,14 @@ */ import QtQuick 2.0 -import "Animations.js" as Animations +import org.kde.plasma.core 2.0 as PlasmaCore SequentialAnimation { id: releasedAnimation objectName: "releasedAnimation" property Item targetItem - property int duration: Animations.feedbackDuration + property int duration: units.shortDuration // Fast scaling while we're animation == more FPS ScriptAction { script: targetItem.smooth = false }