Warning, /plasma/latte-dock/containment/package/contents/ui/applet/TitleTooltipParent.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2017 Smith AR <audoban@openmailbox.org>
0003     SPDX-FileCopyrightText: 2017 Michail Vourlakos <mvourlakos@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.7
0008 
0009 import org.kde.plasma.plasmoid 2.0
0010 import org.kde.plasma.core 2.0 as PlasmaCore
0011 
0012 Item{
0013     id: visual
0014     //used from LatteCore.Dialog Tooltips in order to be anchored properly to their visual parent
0015     signal anchoredTooltipPositionChanged();
0016 
0017     width: root.isVertical ?  thickness : size
0018     height: root.isVertical ? size : thickness
0019 
0020     property int size: 1
0021     property int thickness: Math.min(Math.max(minimumThickness, preferredThickness), maximumThickness)
0022     property int minimumThickness: 0
0023     readonly property int preferredThickness: (parabolic.factor.zoom * metrics.iconSize) + (parabolic.factor.marginThicknessZoom * metrics.totals.thicknessEdges) + metrics.margin.screenEdge
0024     property int maximumThickness: 9999
0025 
0026     property Item metrics: null
0027     property Item parabolic: null
0028     //border.width: 1
0029     //border.color: "green"
0030     //color: "transparent"
0031 
0032     Connections {
0033         target: appletItem.layouts
0034         enabled: parabolic.isEnabled && appletItem.containsMouse
0035         onCurrentSpotChanged: visual.anchoredTooltipPositionChanged();
0036     }
0037 
0038     states:[
0039         State{
0040             name: "bottom"
0041             when: plasmoid.location === PlasmaCore.Types.BottomEdge
0042 
0043             AnchorChanges{
0044                 target: visual;
0045                 anchors.horizontalCenter: parent.horizontalCenter;
0046                 anchors.verticalCenter: undefined;
0047                 anchors.right: undefined; anchors.left: undefined; anchors.top: undefined; anchors.bottom: parent.bottom;
0048             }
0049         },
0050         State{
0051             name: "top"
0052             when: plasmoid.location === PlasmaCore.Types.TopEdge
0053 
0054             AnchorChanges{
0055                 target:visual;
0056                 anchors.horizontalCenter: parent.horizontalCenter;
0057                 anchors.verticalCenter: undefined;
0058                 anchors.right: undefined; anchors.left: undefined; anchors.top: parent.top; anchors.bottom: undefined;
0059             }
0060         },
0061         State{
0062             name: "left"
0063             when: plasmoid.location === PlasmaCore.Types.LeftEdge
0064 
0065             AnchorChanges{
0066                 target: visual;
0067                 anchors.horizontalCenter: undefined;
0068                 anchors.verticalCenter: parent.verticalCenter;
0069                 anchors.right: undefined; anchors.left: parent.left; anchors.top: undefined; anchors.bottom: undefined;
0070             }
0071         },
0072         State{
0073             name: "right"
0074             when: plasmoid.location === PlasmaCore.Types.RightEdge
0075 
0076             AnchorChanges{
0077                 target: visual;
0078                 anchors.horizontalCenter: undefined;
0079                 anchors.verticalCenter: parent.verticalCenter;
0080                 anchors.right: parent.right; anchors.left: undefined; anchors.top: undefined; anchors.bottom: undefined;
0081             }
0082         }
0083     ]
0084 }