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

0001 /*
0002     SPDX-FileCopyrightText: 2021 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.abilities.definition 0.1 as AbilityDefinition
0009 
0010 AbilityDefinition.ThinTooltip {
0011     id: thinTooltip
0012     property Item bridge: null
0013 
0014     isEnabled: ref.thinTooltip.isEnabled
0015     showIsBlocked: local.showIsBlocked
0016     currentVisualParent: ref.thinTooltip.currentVisualParent
0017     currentText: ref.thinTooltip.currentText
0018 
0019     readonly property bool isActive: bridge !== null
0020     readonly property AbilityDefinition.ThinTooltip local: AbilityDefinition.ThinTooltip {}
0021 
0022     Item {
0023         id: ref
0024         readonly property Item thinTooltip: bridge ? bridge.thinTooltip.host : local
0025     }
0026 
0027     function show(visualParent, text) {
0028         if (bridge) {
0029             bridge.thinTooltip.host.show(visualParent, text);
0030         } else {
0031             local.show(visualParent, text);
0032         }
0033     }
0034 
0035     function hide(visualParent) {
0036         if (bridge) {
0037             bridge.thinTooltip.host.hide(visualParent);
0038         } else {
0039             local.hide(visualParent);
0040         }
0041     }
0042 
0043     onIsActiveChanged: {
0044         if (isActive) {
0045             bridge.thinTooltip.client = thinTooltip;
0046         }
0047     }
0048 
0049     Component.onCompleted: {
0050         if (isActive) {
0051             bridge.thinTooltip.client = thinTooltip;
0052         }
0053     }
0054 
0055     Component.onDestruction: {
0056         if (isActive) {
0057             bridge.thinTooltip.client = null;
0058         }
0059     }
0060 }