Warning, /plasma/latte-dock/containment/package/contents/ui/abilities/Indicators.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 import org.kde.plasma.plasmoid 2.0
0008 
0009 import org.kde.latte.abilities.items 0.1 as AbilityItem
0010 
0011 import "./privates" as Ability
0012 
0013 Ability.IndicatorsPrivate {
0014     configuration: view && view.indicator && view.indicator.configuration ? view.indicator.configuration : null
0015     resources: view && view.indicator && view.indicator.resources ? view.indicator.resources : null
0016 
0017     isEnabled: view && view.indicator ? (view.indicator.enabled
0018                                                    && view.indicator.pluginIsReady
0019                                                    && view.indicator.configuration)
0020                                                 : false
0021 
0022     type: view && view.indicator ? view.indicator.type : "org.kde.latte.default"
0023 
0024     indicatorComponent: view && view.indicator ? view.indicator.component : null
0025 
0026     info {
0027         enabledForApplets: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("enabledForApplets")
0028                            && indicatorLevel.item.enabledForApplets
0029 
0030         needsIconColors: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("needsIconColors")
0031                          && indicatorLevel.item.needsIconColors
0032 
0033         needsMouseEventCoordinates: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("needsMouseEventCoordinates")
0034                                     && indicatorLevel.item.needsMouseEventCoordinates
0035 
0036         providesFrontLayer: indicatorLevel.isLoaded &&  indicatorLevel.item.hasOwnProperty("providesFrontLayer")
0037                             && indicatorLevel.item.providesFrontLayer
0038 
0039         providesHoveredAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesHoveredAnimation")
0040                                   && indicatorLevel.item.providesHoveredAnimation
0041 
0042         providesClickedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesClickedAnimation")
0043                                   && indicatorLevel.item.providesClickedAnimation
0044 
0045         providesInAttentionAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesInAttentionAnimation")
0046                                       && indicatorLevel.item.providesInAttentionAnimation
0047 
0048         providesGroupedWindowAddedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesGroupedWindowAddedAnimation")
0049                                              && indicatorLevel.item.providesGroupedWindowAddedAnimation
0050 
0051         providesGroupedWindowRemovedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesGroupedWindowRemovedAnimation")
0052                                                && indicatorLevel.item.providesGroupedWindowRemovedAnimation
0053 
0054         providesTaskLauncherAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesTaskLauncherAnimation")
0055                                        && indicatorLevel.item.providesTaskLauncherAnimation
0056 
0057         extraMaskThickness: {
0058             if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("extraMaskThickness")) {
0059                 return indicatorLevel.item.extraMaskThickness;
0060             }
0061 
0062             return 0;
0063         }
0064 
0065         minThicknessPadding: {
0066             if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("minThicknessPadding")) {
0067                 return indicatorLevel.item.minThicknessPadding;
0068             }
0069 
0070             return 0;
0071         }
0072 
0073         minLengthPadding: {
0074             if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("minLengthPadding")) {
0075                 return indicatorLevel.item.minLengthPadding;
0076             }
0077 
0078             return 0;
0079         }
0080 
0081         lengthPadding: {
0082             if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("lengthPadding")) {
0083                 return indicatorLevel.item.lengthPadding;
0084             }
0085 
0086             return 0.08;
0087         }
0088 
0089         appletLengthPadding: {
0090             if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("appletLengthPadding")) {
0091                 return indicatorLevel.item.appletLengthPadding;
0092             }
0093 
0094             return -1;
0095         }
0096 
0097         backgroundCornerMargin: {
0098             if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("backgroundCornerMargin")) {
0099                 return indicatorLevel.item.backgroundCornerMargin;
0100             }
0101 
0102             return 1.00;
0103         }
0104 
0105         svgPaths: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("svgImagePaths") ?
0106                       indicatorLevel.item.svgImagePaths : []
0107     }
0108 
0109     readonly property Component plasmaStyleComponent: view && view.indicator ? view.indicator.plasmaComponent : null
0110 
0111     //! Metrics and values provided from an invisible indicator
0112     AbilityItem.IndicatorLevel{
0113         id: indicatorLevel
0114         opacity: 0
0115         level.isDrawn: root.indicators.isEnabled
0116         level.isBackground: true
0117         level.indicator: AbilityItem.IndicatorObject{
0118             animations: root.animations
0119             metrics: root.metrics
0120             host: root.indicators
0121         }
0122 
0123         readonly property bool isLoaded: active && item
0124     }
0125 }