mirror of
https://gitgud.io/wackyideas/aerothemeplasma.git
synced 2024-08-15 00:43:43 +00:00
40 lines
970 B
QML
40 lines
970 B
QML
/*
|
|
SPDX-FileCopyrightText: 2013-2017 Jan Grulich <jgrulich@redhat.com>
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
*/
|
|
|
|
import QtQuick 2.2
|
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
import org.kde.plasma.plasmoid 2.0
|
|
|
|
MouseArea {
|
|
id: root
|
|
|
|
required property bool airplaneModeAvailable
|
|
required property string iconName
|
|
|
|
hoverEnabled: true
|
|
|
|
acceptedButtons: airplaneModeAvailable ? Qt.LeftButton | Qt.MiddleButton : Qt.LeftButton
|
|
|
|
property bool wasExpanded
|
|
|
|
onPressed: wasExpanded = mainWindow.expanded
|
|
onClicked: mouse => {
|
|
if (airplaneModeAvailable && mouse.button === Qt.MiddleButton) {
|
|
mainWindow.planeModeSwitchAction.trigger();
|
|
} else {
|
|
mainWindow.expanded = !wasExpanded;
|
|
}
|
|
}
|
|
|
|
Kirigami.Icon {
|
|
id: connectionIcon
|
|
|
|
anchors.fill: parent
|
|
source: root.iconName
|
|
active: parent.containsMouse
|
|
}
|
|
}
|