Warning, /plasma/plasma-nano/shell/contents/applet/DefaultCompactRepresentation.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.0
0008 import QtQuick.Layouts 1.1
0009 import org.kde.plasma.core as PlasmaCore
0010 import org.kde.kirigami 2.20 as Kirigami
0011 
0012 Item {
0013     id: main
0014 
0015     Layout.minimumWidth: {
0016         switch (plasmoid.formFactor) {
0017         case PlasmaCore.Types.Vertical:
0018             return 0;
0019         case PlasmaCore.Types.Horizontal:
0020             return height;
0021         default:
0022             return Kirigami.Units.gridUnit * 3;
0023         }
0024     }
0025 
0026     Layout.minimumHeight: {
0027         switch (plasmoid.formFactor) {
0028         case PlasmaCore.Types.Vertical:
0029             return width;
0030         case PlasmaCore.Types.Horizontal:
0031             return 0;
0032         default:
0033             return Kirigami.Units.gridUnit * 3;
0034         }
0035     }
0036 
0037     Kirigami.Icon {
0038         id: icon
0039         source: plasmoid.icon ? plasmoid.icon : "plasma"
0040         active: mouseArea.containsMouse
0041         Kirigami.Theme.colorSet: Kirigami.Theme.ComplementaryColorGroup
0042         anchors.verticalCenter: parent.verticalCenter
0043     }
0044 
0045     MouseArea {
0046         id: mouseArea
0047 
0048         property bool wasExpanded: false
0049 
0050         anchors.fill: parent
0051         hoverEnabled: true
0052         onPressed: wasExpanded = plasmoid.expanded
0053         onClicked: plasmoid.expanded = !wasExpanded
0054     }
0055 }