kdeconnect-kde/plasmoid/package/contents/ui/CompactRepresentation.qml

45 lines
946 B
QML
Raw Permalink Normal View History

2024-06-30 23:03:57 +01:00
/**
* SPDX-FileCopyrightText: 2014-2015 Frederic St-Pierre <me@fredericstpierre.com>
* SPDX-FileCopyrightText: 2024 ivan tkachenko <me@ratijas.tk>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
2024-06-30 23:03:57 +01:00
pragma ComponentBehavior: Bound
import QtQuick
2024-06-30 23:03:57 +01:00
import org.kde.kirigami as Kirigami
2024-06-30 23:03:57 +01:00
import org.kde.plasma.plasmoid
DropArea {
2024-06-30 23:03:57 +01:00
id: root
required property PlasmoidItem plasmoidItem
onEntered: drag => {
if (drag.hasUrls) {
2024-06-30 23:03:57 +01:00
root.plasmoidItem.expanded = true;
}
}
MouseArea {
anchors.fill: parent
2024-06-30 23:03:57 +01:00
property bool wasExpanded: false
onPressed: mouse => {
wasExpanded = root.plasmoidItem.expanded;
}
onClicked: mouse => {
root.plasmoidItem.expanded = !root.plasmoidItem.expanded;
}
}
Kirigami.Icon {
anchors.fill: parent
2024-06-30 23:03:57 +01:00
source: Plasmoid.icon
}
}