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.components 3.0 as PlasmaComponents3
0011 import org.kde.plasma.core 2.0 as PlasmaCore
0012 import org.kde.plasma.plasmoid 2.0
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 Layout.maximumWidth: inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1
0023 Layout.maximumHeight: inPanel ? PlasmaCore.Units.iconSizeHints.panel : -1
0024
0025 acceptedButtons: Qt.LeftButton | Qt.MiddleButton
0026
0027 property bool wasExpanded
0028
0029 onPressed: wasExpanded = Plasmoid.expanded
0030 onClicked: {
0031 if (mouse.button === Qt.MiddleButton) {
0032 toggleBluetooth();
0033 } else {
0034 Plasmoid.expanded = !wasExpanded;
0035 }
0036 }
0037
0038 hoverEnabled: true
0039
0040 PlasmaCore.IconItem {
0041 id: bluetoothIcon
0042 anchors.fill: parent
0043 source: Plasmoid.icon
0044 active: parent.containsMouse
0045 }
0046 }