Warning, /plasma/plasma-workspace/applets/systemtray/package/contents/applet/CompactApplet.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 import QtQuick 2.1 0008 import QtQuick.Layouts 1.1 0009 import org.kde.plasma.core as PlasmaCore 0010 import org.kde.plasma.plasmoid 2.0 0011 import org.kde.kirigami 2.20 as Kirigami 0012 0013 PlasmaCore.ToolTipArea { 0014 id: appletRoot 0015 objectName: "org.kde.desktop-CompactApplet" 0016 anchors.fill: parent 0017 0018 mainText: plasmoidItem ? plasmoidItem.toolTipMainText : "" 0019 subText: plasmoidItem ? plasmoidItem.toolTipSubText : "" 0020 location: if (plasmoidItem && plasmoidItem.parent && plasmoidItem.parent.inHiddenLayout && Plasmoid.location !== PlasmaCore.Types.LeftEdge) { 0021 return PlasmaCore.Types.RightEdge; 0022 } else { 0023 return Plasmoid.location; 0024 } 0025 active: plasmoidItem ? !plasmoidItem.expanded : 0 0026 textFormat: plasmoidItem ? plasmoidItem.toolTipTextFormat : 0 0027 mainItem: plasmoidItem && plasmoidItem.toolTipItem ? plasmoidItem.toolTipItem : null 0028 0029 property Item fullRepresentation 0030 property Item compactRepresentation 0031 property PlasmoidItem plasmoidItem 0032 0033 Connections { 0034 target: Plasmoid 0035 function onContextualActionsAboutToShow() { 0036 appletRoot.hideImmediately() 0037 } 0038 } 0039 0040 Layout.minimumWidth: { 0041 switch (Plasmoid.formFactor) { 0042 case PlasmaCore.Types.Vertical: 0043 return 0; 0044 case PlasmaCore.Types.Horizontal: 0045 return height; 0046 default: 0047 return Kirigami.Units.gridUnit * 3; 0048 } 0049 } 0050 0051 Layout.minimumHeight: { 0052 switch (Plasmoid.formFactor) { 0053 case PlasmaCore.Types.Vertical: 0054 return width; 0055 case PlasmaCore.Types.Horizontal: 0056 return 0; 0057 default: 0058 return Kirigami.Units.gridUnit * 3; 0059 } 0060 } 0061 0062 onCompactRepresentationChanged: { 0063 if (compactRepresentation) { 0064 compactRepresentation.parent = appletRoot; 0065 compactRepresentation.anchors.fill = appletRoot; 0066 compactRepresentation.visible = true; 0067 } 0068 appletRoot.visible = true; 0069 } 0070 } 0071