syncthingtray/plasmoid/package6/contents/ui/CompactRepresentation.qml

28 lines
653 B
QML
Raw Permalink Normal View History

import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.20 as Kirigami
MouseArea {
2023-11-14 23:58:22 +01:00
property bool wasExpanded
Layout.fillWidth: false
hoverEnabled: true
2023-11-14 23:58:22 +01:00
onPressed: wasExpanded = syncthingApplet.expanded
onClicked: mouse => {
if (mouse.button === Qt.MiddleButton) {
Plasmoid.showWebUI();
} else {
syncthingApplet.expanded = !wasExpanded;
}
}
Kirigami.Icon {
id: icon
anchors.fill: parent
source: plasmoid.statusIcon
active: parent.containsMouse
}
}