2019-01-02 17:26:21 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014-2015 Frederic St-Pierre <me@fredericstpierre.com>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) version 3, or any
|
|
|
|
later version accepted by the membership of KDE e.V. (or its
|
|
|
|
successor approved by the membership of KDE e.V.), which shall
|
|
|
|
act as a proxy defined in Section 6 of version 3 of the license.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2019-03-23 16:29:26 +00:00
|
|
|
License along with this library. If not, see <https://www.gnu.org/licenses/>.
|
2019-01-02 17:26:21 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.1
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
|
|
|
|
|
|
|
DropArea {
|
|
|
|
readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge
|
|
|
|
|| plasmoid.location == PlasmaCore.Types.RightEdge
|
|
|
|
|| plasmoid.location == PlasmaCore.Types.BottomEdge
|
|
|
|
|| plasmoid.location == PlasmaCore.Types.LeftEdge)
|
|
|
|
|
|
|
|
Layout.maximumWidth: inPanel ? units.iconSizeHints.panel : -1
|
|
|
|
Layout.maximumHeight: inPanel ? units.iconSizeHints.panel : -1
|
|
|
|
|
|
|
|
onEntered: {
|
|
|
|
if (drag.hasUrls) {
|
|
|
|
plasmoid.expanded = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: kdeConnectMouseArea
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
plasmoid.expanded = !plasmoid.expanded;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PlasmaCore.IconItem {
|
|
|
|
id: kdeConnectIcon
|
|
|
|
anchors.fill: parent
|
|
|
|
source: plasmoid.icon
|
|
|
|
}
|
|
|
|
}
|