Warning, /plasma/bluedevil/src/applet/package/contents/ui/CompactRepresentation.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Layouts 1.15
0009 
0010 import org.kde.plasma.core as PlasmaCore
0011 import org.kde.plasma.plasmoid 2.0
0012 import org.kde.kirigami 2.20 as Kirigami
0013 
0014 MouseArea {
0015     readonly property bool inPanel: [
0016         PlasmaCore.Types.TopEdge,
0017         PlasmaCore.Types.RightEdge,
0018         PlasmaCore.Types.BottomEdge,
0019         PlasmaCore.Types.LeftEdge,
0020     ].includes(Plasmoid.location)
0021 
0022     acceptedButtons: Qt.LeftButton | Qt.MiddleButton
0023 
0024     property bool wasExpanded
0025 
0026     onPressed: mouse => { 
0027         wasExpanded = bluetoothApplet.expanded 
0028     }
0029 
0030     onClicked: mouse => {
0031         if (mouse.button === Qt.MiddleButton) {
0032             toggleBluetooth();
0033         } else {
0034             bluetoothApplet.expanded = !wasExpanded;
0035         }
0036     }
0037 
0038     hoverEnabled: true
0039 
0040     Kirigami.Icon {
0041         id: bluetoothIcon
0042         anchors.fill: parent
0043         source: Plasmoid.icon
0044         active: parent.containsMouse
0045     }
0046 }