Warning, /plasma/plasma-nm/applet/contents/ui/CompactRepresentation.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2013-2017 Jan Grulich <jgrulich@redhat.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.2
0008 
0009 import org.kde.plasma.core 2.0 as PlasmaCore
0010 import org.kde.plasma.components 3.0 as PlasmaComponents3
0011 import org.kde.plasma.plasmoid 2.0
0012 
0013 MouseArea {
0014     id: panelIconWidget
0015 
0016     readonly property bool airplaneModeAvailable: availableDevices.modemDeviceAvailable || availableDevices.wirelessDeviceAvailable
0017 
0018     anchors.fill: parent
0019     hoverEnabled: true
0020 
0021     acceptedButtons: airplaneModeAvailable ? Qt.LeftButton | Qt.MiddleButton : Qt.LeftButton
0022 
0023     property bool wasExpanded
0024 
0025     onPressed: wasExpanded = Plasmoid.expanded
0026     onClicked: {
0027         if (airplaneModeAvailable && mouse.button === Qt.MiddleButton) {
0028             action_planeModeSwitch();
0029         } else {
0030             Plasmoid.expanded = !wasExpanded;
0031         }
0032     }
0033 
0034     PlasmaCore.IconItem {
0035         id: connectionIcon
0036 
0037         anchors.fill: parent
0038         source: connectionIconProvider.connectionIcon
0039         colorGroup: PlasmaCore.ColorScope.colorGroup
0040         active: parent.containsMouse
0041     }
0042 }