forked from Qortal/Brooklyn
71 lines
1.9 KiB
QML
71 lines
1.9 KiB
QML
/*
|
|
SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
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
|
|
|
|
mainText: plasmoid.toolTipMainText
|
|
subText: plasmoid.toolTipSubText
|
|
location: if (plasmoid.parent && plasmoid.parent.inHiddenLayout && 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
|
|
function onContextualActionsAboutToShow() {
|
|
appletRoot.hideImmediately()
|
|
}
|
|
}
|
|
|
|
Layout.minimumWidth: {
|
|
switch (plasmoid.formFactor) {
|
|
case PlasmaCore.Types.Vertical:
|
|
return 0;
|
|
case PlasmaCore.Types.Horizontal:
|
|
return height;
|
|
default:
|
|
return PlasmaCore.Units.gridUnit * 3;
|
|
}
|
|
}
|
|
|
|
Layout.minimumHeight: {
|
|
switch (plasmoid.formFactor) {
|
|
case PlasmaCore.Types.Vertical:
|
|
return width;
|
|
case PlasmaCore.Types.Horizontal:
|
|
return 0;
|
|
default:
|
|
return PlasmaCore.Units.gridUnit * 3;
|
|
}
|
|
}
|
|
|
|
onCompactRepresentationChanged: {
|
|
if (compactRepresentation) {
|
|
compactRepresentation.parent = appletRoot;
|
|
compactRepresentation.anchors.fill = appletRoot;
|
|
compactRepresentation.visible = true;
|
|
}
|
|
appletRoot.visible = true;
|
|
}
|
|
}
|
|
|