Warning, /plasma/latte-dock/declarativeimports/abilities/client/Animations.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 import QtQuick 2.7
0007 
0008 import org.kde.latte.core 0.2 as LatteCore
0009 import org.kde.latte.abilities.definition 0.1 as AbilityDefinition
0010 
0011 AbilityDefinition.Animations {
0012     id: _animations
0013     property Item bridge: null
0014     readonly property bool bridgeIsActive: bridge !== null
0015 
0016     active: ref.animations.active
0017     readonly property bool hasThicknessAnimation: ref.animations.hasThicknessAnimation //redefined to make it readonly and switchable
0018 
0019     //! animations tracking
0020     needBothAxis: ref.animations.needBothAxis
0021     needLength: ref.animations.needLength
0022     needThickness: ref.animations.needThickness
0023 
0024     //! animations properties
0025     duration: ref.animations.duration
0026     speedFactor: ref.animations.speedFactor
0027 
0028     //! parabolic effect animations
0029     hoverPixelSensitivity: ref.animations.hoverPixelSensitivity
0030 
0031     //! requirements
0032     requirements: local.requirements
0033 
0034     readonly property AbilityDefinition.Animations local: AbilityDefinition.Animations{
0035         active: local.speedFactor.current !== 0
0036         hoverPixelSensitivity: 1
0037         speedFactor.normal: active ? speedFactor.current : 1.0
0038 
0039         duration.small: LatteCore.Environment.shortDuration
0040         duration.large: LatteCore.Environment.longDuration
0041     }
0042 
0043     Item {
0044         id: ref
0045         readonly property Item animations: bridge ? bridge.animations.host : local
0046     }
0047 
0048     //! Bridge - Client assignment
0049     onBridgeIsActiveChanged: {
0050         if (bridgeIsActive) {
0051             bridge.animations.client = _animations;
0052         }
0053     }
0054 
0055     Component.onCompleted: {
0056         if (bridgeIsActive) {
0057             bridge.animations.client = _animations;
0058         }
0059     }
0060 
0061     Component.onDestruction: {
0062         if (bridgeIsActive) {
0063             bridge.animations.client = null;
0064         }
0065     }
0066 }