mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-11 13:18:13 +03:00
improve task needs attention design
--when a task needs attention the task bounces for 8500ms instead of 6500ms --the color animation of needs attention was improved in order to not drain the cpu cycles --all animations concerning needs attention,bouncing and color are stopped after the 8500ms timer --the bounce animation is not stopped in the middle but it waits each bounce to finish in order to make the checks
This commit is contained in:
parent
1145b42e17
commit
a4cf8055fa
@ -26,12 +26,12 @@ import QtGraphicalEffects 1.0
|
||||
|
||||
Item{
|
||||
// property string color
|
||||
id: glowItem
|
||||
id: glowItem
|
||||
|
||||
property bool roundCorners: true
|
||||
property bool showAttention: false
|
||||
|
||||
property int animation: root.durationTime*units.longDuration
|
||||
property int animation: Math.max(1.65*3*units.longDuration,root.durationTime*3*units.longDuration)
|
||||
|
||||
property color attentionColor: colorScopePalette.negativeTextColor // "#ffff1717"
|
||||
property color basicColor: "blue"
|
||||
@ -74,7 +74,7 @@ Item{
|
||||
duration: glowItem.animation
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RectangularGlow {
|
||||
@ -99,6 +99,4 @@ Item{
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ Item{
|
||||
glowFrame.isActiveColor : glowFrame.notActiveColor
|
||||
|
||||
roundCorners: true
|
||||
showAttention: model.IsDemandingAttention ? true : false
|
||||
showAttention: model.IsDemandingAttention && plasmoid.status === PlasmaCore.Types.RequiresAttentionStatus? true : false
|
||||
|
||||
opacity: (!mainItemContainer.hasActive && root.showPreviews
|
||||
&& windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === mainItemContainer)) ? 0.4 : 1
|
||||
|
@ -763,18 +763,6 @@ Item{
|
||||
|
||||
|
||||
////////////////// new window and needs attention animation
|
||||
//stop the bouncing animation for attention needed when the plasmoid
|
||||
//does not need any more attention
|
||||
Connections{
|
||||
target: plasmoid
|
||||
onStatusChanged:{
|
||||
if ( (plasmoid.status === PlasmaCore.Types.PassiveStatus)
|
||||
&& newWindowAnimation.running && (newWindowAnimation.loops > 2) ) {
|
||||
newWindowAnimation.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: mainItemContainer
|
||||
onContainsMouseChanged: {
|
||||
@ -818,6 +806,18 @@ Item{
|
||||
duration: 3*root.durationTime*newWindowAnimation.speed
|
||||
easing.type: Easing.OutBounce
|
||||
}
|
||||
|
||||
ScriptAction{
|
||||
script:{
|
||||
if (mainItemContainer.containsMouse) {
|
||||
newWindowAnimation.stop();
|
||||
}
|
||||
if (!newWindowAnimation.isDemandingAttention
|
||||
|| (plasmoid.status === PlasmaCore.Types.PassiveStatus && newWindowAnimation.loops > 2)){
|
||||
newWindowAnimation.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clear(){
|
||||
@ -835,11 +835,7 @@ Item{
|
||||
}
|
||||
|
||||
onIsDemandingAttentionChanged: {
|
||||
if( (!isDemandingAttention)&&(running)){
|
||||
clear();
|
||||
// wrapper.animationEnded();
|
||||
}
|
||||
else if(isDemandingAttention){
|
||||
if(isDemandingAttention){
|
||||
bounceNewWindow();
|
||||
}
|
||||
}
|
||||
|
@ -660,7 +660,7 @@ Item {
|
||||
id: attentionTimerComponent
|
||||
Timer{
|
||||
id: attentionTimer
|
||||
interval:6500
|
||||
interval:8500
|
||||
onTriggered: {
|
||||
plasmoid.status = PlasmaCore.Types.PassiveStatus;
|
||||
destroy();
|
||||
|
Loading…
Reference in New Issue
Block a user