diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 18c91649b..8001854ef 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -326,7 +326,7 @@ Item { property Item userRequests: null property bool containsMouse: parabolicAreaLoader.active && parabolicAreaLoader.item.containsMouse - property bool pressed: viewSignalsConnector.pressed || clickedAnimation.running + property bool pressed: viewSignalsConnector.pressed //// BEGIN :: Animate Applet when a new applet is dragged in the view @@ -1019,33 +1019,4 @@ Item { easing.type: Easing.InCubic } } - - - /////Clicked Animation///// - SequentialAnimation{ - id: clickedAnimation - alwaysRunToEnd: true - running: appletItem.isSquare && !originalAppletBehavior && appletItem.pressed - && (appletItem.animations.speedFactor.current > 0) && !indicators.info.providesClickedAnimation - - ParallelAnimation{ - PropertyAnimation { - target: wrapper.clickedEffect - property: "brightness" - to: -0.35 - duration: appletItem.animations.duration.large - easing.type: Easing.OutQuad - } - } - ParallelAnimation{ - PropertyAnimation { - target: wrapper.clickedEffect - property: "brightness" - to: 0 - duration: appletItem.animations.duration.large - easing.type: Easing.OutQuad - } - } - } - //END animations } diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index 6ad4f3f5e..ce38695f4 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -153,7 +153,6 @@ Item{ property int index: appletItem.index property Item wrapperContainer: _wrapperContainer - property Item clickedEffect: _clickedEffect property Item overlayIconLoader: _overlayIconLoader readonly property int internalSplitterComputedLength: { @@ -679,14 +678,6 @@ Item{ } } - BrightnessContrast { - id: _clickedEffect - anchors.fill: _wrapperContainer - source: _wrapperContainer - - visible: clickedAnimation.running && !indicators.info.providesClickedAnimation - } - Loader{ anchors.fill: parent active: appletItem.debug.graphicsEnabled diff --git a/shell/package/contents/applet/CompactApplet.qml b/shell/package/contents/applet/CompactApplet.qml index bdf5f7773..aa5ebf4a6 100644 --- a/shell/package/contents/applet/CompactApplet.qml +++ b/shell/package/contents/applet/CompactApplet.qml @@ -6,6 +6,7 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 +import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents @@ -32,6 +33,10 @@ PlasmaCore.ToolTipArea { property Item compactRepresentationVisualParent: originalCompactRepresenationParent && originalCompactRepresenationParent.parent ? originalCompactRepresenationParent.parent.parent : null + property Item appletItem: compactRepresentationVisualParent + && compactRepresentationVisualParent.parent + && compactRepresentationVisualParent.parent.parent ? compactRepresentationVisualParent.parent.parent.parent : null + onCompactRepresentationChanged: { if (compactRepresentation) { originalCompactRepresenationParent = compactRepresentation.parent; @@ -194,6 +199,48 @@ PlasmaCore.ToolTipArea { popupWindow.requestActivate(); } } + } + + ////Clicked Effect //// + BrightnessContrast { + id: _clickedEffect + anchors.fill: parent + source: compactRepresentation + visible: appletItem && clickedAnimation.running && !appletItem.indicators.info.providesClickedAnimation + z:1000 + } + /////Clicked Animation///// + SequentialAnimation{ + id: clickedAnimation + alwaysRunToEnd: true + running: appletItem + && appletItem.animations + && appletItem.indicators + && appletItem.isSquare + && appletItem.pressed + && !appletItem.originalAppletBehavior + && (appletItem.animations.speedFactor.current > 0) + && !appletItem.indicators.info.providesClickedAnimation + + ParallelAnimation{ + PropertyAnimation { + target: _clickedEffect + property: "brightness" + to: -0.35 + duration: appletItem && appletItem.animations ? appletItem.animations.duration.large : 0 + easing.type: Easing.OutQuad + } + } + ParallelAnimation{ + PropertyAnimation { + target: _clickedEffect + property: "brightness" + to: 0 + duration: appletItem && appletItem.animations ? appletItem.animations.duration.large : 0 + easing.type: Easing.OutQuad + } + } } + //END animations }