Warning, /plasma/latte-dock/declarativeimports/components/IndicatorItem.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2019 Michail Vourlakos <mvourlakos@gmail.com>
0003 SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005
0006 import QtQuick 2.7
0007
0008 Item {
0009 readonly property Item level: parent && parent.hasOwnProperty("level") ? parent.level : null
0010 readonly property Item indicator: {
0011 if (!level) {
0012 return null;
0013 }
0014
0015 if (level.hasOwnProperty("bridge")) {
0016 return level.bridge;
0017 } else if (level.hasOwnProperty("indicator")) {
0018 return level.indicator.publicApi;
0019 }
0020
0021 return null;
0022 }
0023
0024 //! indicator is using main colors from icon e.g. unity style
0025 property bool needsIconColors: false
0026 //! indicator is using the mouse events coordinates e.g. for animations
0027 property bool needsMouseEventCoordinates: false
0028 //! indicator provides also foreground layer that should be drawn on top of the Items icons
0029 property bool providesFrontLayer: false
0030 //! indicator provides its own hovering animations. Latte should not provide
0031 //! any hovering animation in that case
0032 property bool providesHoveredAnimation: false
0033 //! indicator provides its own clicked animations. Latte should not provide
0034 //! any clicked animation in that case
0035 property bool providesClickedAnimation: false
0036 //! indicator provides its own inattention animation. Latte should not provide
0037 //! any inattention animation in that case.
0038 //! [since v0.10.4]
0039 property bool providesInAttentionAnimation: false
0040 //! indicator provides its own window added in group animation. Latte should not provide
0041 //! any window added in group animation in that case.
0042 //! [since v0.10.4]
0043 property bool providesGroupedWindowAddedAnimation: false
0044 //! indicator provides its own window removed from group animation. Latte should not provide
0045 //! any window removed from group animation in that case.
0046 //! [since v0.10.4]
0047 property bool providesGroupedWindowRemovedAnimation: false
0048 //! indicator provides its own task launcher triggered animation. Latte should not provide
0049 //! any task launcher triggered animation in that case.
0050 //! [since v0.10.4]
0051 property bool providesTaskLauncherAnimation: false
0052
0053 //! this indicator will draw its own indicators for applets
0054 //! [since v0.10.0]
0055 property bool enabledForApplets: true
0056
0057 //! this indicator visuals go out of the regular mask thickness and this variable sets
0058 //! the pixels needed outside of the mask thickness e.g. a glow
0059 property int extraMaskThickness: 0
0060
0061 //! this indicator specifies a minimum thickness padding in order to be drawn correctly.
0062 //! Values below the specified value are ignored. This value is a percentage,
0063 //! e.g 0.06 -> 6%
0064 property real minThicknessPadding: 0
0065 //! this indicator specifies a minimum length padding in order to be drawn correctly.
0066 //! Values below the specified value are ignored. This value is a percentage,
0067 //! e.g 0.06 -> 6%
0068 property real minLengthPadding: 0
0069
0070 //! this indicator specifies a different padding value for applets. This value is a percentage,
0071 //! -1, means disabled and the regular length padding is used
0072 //! 0.06 -> 6%
0073 //! [since v0.9.2]
0074 property real appletLengthPadding: -1
0075
0076 //! this indicator specifies how much is going to be the items regular length padding
0077 //! as long as other more specialized paddings such as appletLengthPadding are not
0078 //! applied. This value is a percentage,
0079 //! e.g 0.06 -> 6%
0080 //! [since v0.10.0]
0081 property real lengthPadding: 0.08
0082
0083 //! this indicator specifies how far would like to be from panel background edge
0084 //! it is totally panel background roundness related. By altering that value, indicators
0085 //! can get inside panel background big roundnesses. This value is a percentage,
0086 //! e.g 0.06 -> 6%
0087 //! [since v0.10.3]
0088 property real backgroundCornerMargin: 1.00
0089
0090 //! svg image paths either from plasma theme or local files relevant to indicator "ui" directory
0091 //! in order to reduce resources usage
0092 property var svgImagePaths: []
0093
0094 //! LEVEL.Requested API reference
0095
0096 //! indicator requests different icon X offset from icon center
0097 //! [since v0.9.2]
0098 //property int level.requested.iconOffsetX: 0
0099
0100 //! indicator requests different icon Y offset from icon center
0101 //! [since v0.9.2]
0102 //property int level.requested.iconOffsetY: 0
0103
0104 //! indicator requests different icon tranform origin
0105 //! [since v0.10.4]
0106 //property int level.requested.iconTransformOrigin: Item.Center
0107
0108 //! indicator requests different icon opacity
0109 //! [since v0.10.4]
0110 //property real level.requested.iconOpacity: 1.0
0111
0112 //! indicator requests different icon rotation
0113 //! [since v0.10.4]
0114 //property real level.requested.iconRotation: 0
0115
0116 //! indicator requests different icon scale
0117 //! [since v0.10.4]
0118 //property real level.requested.iconScale: 1.0
0119
0120 //! indicator is playing a task launcher animation. It is used in combination with
0121 //! providesTaskLauncherAnimation
0122 //! [since v0.10.4]
0123 //property bool level.requested.isTaskLauncherAnimationRunning: false
0124
0125 onLevelChanged: {
0126 if (level) {
0127 //! initialization on startup, this way when changing from indicator that changes them
0128 //! at an indicator that is not using them at all, their values are restored
0129 level.requested.iconOffsetX = 0;
0130 level.requested.iconOffsetY = 0;
0131 level.requested.iconTransformOrigin = Item.Center;
0132 level.requested.iconOpacity = 1.0;
0133 level.requested.iconRotation = 0;
0134 level.requested.iconScale = 1.0;
0135 level.requested.isTaskLauncherAnimationRunning = false;
0136 }
0137 }
0138 }