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
|
|
|
|
*/
|
2023-11-30 23:41:36 +00:00
|
|
|
|
2024-06-30 23:03:57 +01:00
|
|
|
pragma ComponentBehavior: Bound
|
2023-11-30 23:41:36 +00:00
|
|
|
|
|
|
|
import QtQuick
|
2024-06-30 23:03:57 +01:00
|
|
|
|
2023-11-30 23:41:36 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
2024-06-30 23:03:57 +01:00
|
|
|
import org.kde.plasma.plasmoid
|
2023-11-30 23:41:36 +00:00
|
|
|
|
|
|
|
DropArea {
|
2024-06-30 23:03:57 +01:00
|
|
|
id: root
|
|
|
|
|
|
|
|
required property PlasmoidItem plasmoidItem
|
|
|
|
|
|
|
|
onEntered: drag => {
|
2023-11-30 23:41:36 +00:00
|
|
|
if (drag.hasUrls) {
|
2024-06-30 23:03:57 +01:00
|
|
|
root.plasmoidItem.expanded = true;
|
2023-11-30 23:41:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2023-11-30 23:41:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
anchors.fill: parent
|
2024-06-30 23:03:57 +01:00
|
|
|
source: Plasmoid.icon
|
2023-11-30 23:41:36 +00:00
|
|
|
}
|
|
|
|
}
|