restack applets internal ClickEffect

--internal click effect is now moved to CompactApplet
which is much better place to be. This way fullrepresentation
applets do not use it at all
pull/22/head
Michail Vourlakos 4 years ago
parent 249aeeccb4
commit 170f14c3c0

@ -326,7 +326,7 @@ Item {
property Item userRequests: null property Item userRequests: null
property bool containsMouse: parabolicAreaLoader.active && parabolicAreaLoader.item.containsMouse 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 //// BEGIN :: Animate Applet when a new applet is dragged in the view
@ -1019,33 +1019,4 @@ Item {
easing.type: Easing.InCubic 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
} }

@ -153,7 +153,6 @@ Item{
property int index: appletItem.index property int index: appletItem.index
property Item wrapperContainer: _wrapperContainer property Item wrapperContainer: _wrapperContainer
property Item clickedEffect: _clickedEffect
property Item overlayIconLoader: _overlayIconLoader property Item overlayIconLoader: _overlayIconLoader
readonly property int internalSplitterComputedLength: { readonly property int internalSplitterComputedLength: {
@ -679,14 +678,6 @@ Item{
} }
} }
BrightnessContrast {
id: _clickedEffect
anchors.fill: _wrapperContainer
source: _wrapperContainer
visible: clickedAnimation.running && !indicators.info.providesClickedAnimation
}
Loader{ Loader{
anchors.fill: parent anchors.fill: parent
active: appletItem.debug.graphicsEnabled active: appletItem.debug.graphicsEnabled

@ -6,6 +6,7 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.0 import QtQuick.Window 2.0
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
@ -32,6 +33,10 @@ PlasmaCore.ToolTipArea {
property Item compactRepresentationVisualParent: originalCompactRepresenationParent && originalCompactRepresenationParent.parent property Item compactRepresentationVisualParent: originalCompactRepresenationParent && originalCompactRepresenationParent.parent
? originalCompactRepresenationParent.parent.parent : null ? originalCompactRepresenationParent.parent.parent : null
property Item appletItem: compactRepresentationVisualParent
&& compactRepresentationVisualParent.parent
&& compactRepresentationVisualParent.parent.parent ? compactRepresentationVisualParent.parent.parent.parent : null
onCompactRepresentationChanged: { onCompactRepresentationChanged: {
if (compactRepresentation) { if (compactRepresentation) {
originalCompactRepresenationParent = compactRepresentation.parent; originalCompactRepresenationParent = compactRepresentation.parent;
@ -194,6 +199,48 @@ PlasmaCore.ToolTipArea {
popupWindow.requestActivate(); 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
} }

Loading…
Cancel
Save