2019-02-07 11:49:06 +00:00
|
|
|
import QtQuick 2.5
|
2015-02-25 18:26:04 +00:00
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
|
import org.kde.kio 1.0 as Kio
|
|
|
|
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
|
|
|
|
2019-02-07 11:49:06 +00:00
|
|
|
Column {
|
2015-03-05 13:02:32 +00:00
|
|
|
id: delegateRoot
|
2015-02-25 18:26:04 +00:00
|
|
|
width: applicationsView.cellWidth
|
2015-08-22 12:46:56 +00:00
|
|
|
height: applicationsView.cellHeight
|
2015-03-05 14:32:44 +00:00
|
|
|
|
2019-02-07 11:49:06 +00:00
|
|
|
property int iconSize
|
2015-04-10 21:59:52 +00:00
|
|
|
property var modelData: model
|
2015-04-11 10:40:54 +00:00
|
|
|
property bool isDropTarget: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole
|
2015-06-22 23:50:39 +00:00
|
|
|
property alias maximumLineCount: label.maximumLineCount
|
2015-03-05 20:12:23 +00:00
|
|
|
|
2015-04-11 10:40:54 +00:00
|
|
|
opacity: isDropTarget ? 0.3 : 1
|
2015-04-11 12:48:24 +00:00
|
|
|
|
2015-04-10 21:59:52 +00:00
|
|
|
PlasmaCore.IconItem {
|
|
|
|
|
id: icon
|
2019-02-07 11:49:06 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
width: delegateRoot.iconSize
|
|
|
|
|
height: delegateRoot.iconSize
|
2015-04-10 21:59:52 +00:00
|
|
|
source: modelData.ApplicationIconRole
|
2015-04-11 09:36:17 +00:00
|
|
|
scale: root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1
|
2015-04-10 21:59:52 +00:00
|
|
|
Behavior on scale {
|
|
|
|
|
NumberAnimation {
|
2015-03-13 13:42:37 +00:00
|
|
|
duration: units.longDuration
|
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
|
}
|
2015-03-13 12:50:13 +00:00
|
|
|
}
|
|
|
|
|
}
|
2015-02-25 18:26:04 +00:00
|
|
|
|
2015-04-10 21:59:52 +00:00
|
|
|
PlasmaComponents.Label {
|
|
|
|
|
id: label
|
|
|
|
|
visible: text.length > 0
|
2015-03-05 20:12:23 +00:00
|
|
|
|
2019-02-07 11:49:06 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
width: icon.width
|
2015-03-05 20:12:23 +00:00
|
|
|
|
2015-04-10 21:59:52 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
maximumLineCount: 2
|
2015-02-25 18:26:04 +00:00
|
|
|
|
2015-04-10 21:59:52 +00:00
|
|
|
text: modelData.ApplicationNameRole
|
2015-09-01 12:05:01 +00:00
|
|
|
font.pixelSize: theme.defaultFont.pixelSize
|
2015-04-10 21:59:52 +00:00
|
|
|
color: PlasmaCore.ColorScope.textColor
|
2015-02-25 18:26:04 +00:00
|
|
|
}
|
|
|
|
|
}
|