2019-10-07 16:49:18 +00:00
|
|
|
/*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
|
2019-10-07 16:49:18 +00:00
|
|
|
*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
2019-10-07 16:49:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.1
|
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
|
import org.kde.plasma.plasmoid 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlasmaCore.ToolTipArea {
|
|
|
|
|
id: appletRoot
|
|
|
|
|
objectName: "org.kde.desktop-CompactApplet"
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
icon: plasmoid.icon
|
|
|
|
|
mainText: plasmoid.toolTipMainText
|
|
|
|
|
subText: plasmoid.toolTipSubText
|
|
|
|
|
location: if (plasmoid.parent && plasmoid.parent.parent.objectName === "hiddenTasksColumn" && plasmoid.location !== PlasmaCore.Types.LeftEdge) {
|
|
|
|
|
return PlasmaCore.Types.RightEdge;
|
|
|
|
|
} else {
|
|
|
|
|
return plasmoid.location;
|
|
|
|
|
}
|
|
|
|
|
active: !plasmoid.expanded
|
|
|
|
|
textFormat: plasmoid.toolTipTextFormat
|
|
|
|
|
mainItem: plasmoid.toolTipItem ? plasmoid.toolTipItem : null
|
|
|
|
|
|
|
|
|
|
property Item fullRepresentation
|
|
|
|
|
property Item compactRepresentation
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: plasmoid
|
|
|
|
|
onContextualActionsAboutToShow: appletRoot.hideToolTip()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Layout.minimumWidth: {
|
|
|
|
|
switch (plasmoid.formFactor) {
|
|
|
|
|
case PlasmaCore.Types.Vertical:
|
|
|
|
|
return 0;
|
|
|
|
|
case PlasmaCore.Types.Horizontal:
|
|
|
|
|
return height;
|
|
|
|
|
default:
|
|
|
|
|
return units.gridUnit * 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Layout.minimumHeight: {
|
|
|
|
|
switch (plasmoid.formFactor) {
|
|
|
|
|
case PlasmaCore.Types.Vertical:
|
|
|
|
|
return width;
|
|
|
|
|
case PlasmaCore.Types.Horizontal:
|
|
|
|
|
return 0;
|
|
|
|
|
default:
|
|
|
|
|
return units.gridUnit * 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onCompactRepresentationChanged: {
|
|
|
|
|
if (compactRepresentation) {
|
|
|
|
|
compactRepresentation.parent = appletRoot;
|
|
|
|
|
compactRepresentation.anchors.fill = appletRoot;
|
|
|
|
|
compactRepresentation.visible = true;
|
|
|
|
|
}
|
|
|
|
|
appletRoot.visible = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|