shift-shell/containments/homescreen/package/contents/ui/HomeLauncher.qml

64 lines
2.1 KiB
QML
Raw Normal View History

2019-02-07 11:49:06 +00:00
import QtQuick 2.5
2019-02-24 09:22:31 +00:00
import QtQuick.Layouts 1.2
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-24 09:22:31 +00:00
Item {
2015-03-05 13:02:32 +00:00
id: delegateRoot
2015-03-05 14:32:44 +00:00
2019-02-07 11:49:06 +00:00
property int iconSize
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
2019-02-24 09:22:31 +00:00
width: applicationsView.cellWidth
height: applicationsView.cellHeight
ColumnLayout {
anchors {
left: parent.left
right: parent.right
horizontalCenter: parent.horizonalCenter
verticalCenter: parent.verticalCenter
}
opacity: isDropTarget ? 0.3 : 1
PlasmaCore.IconItem {
id: icon
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: delegateRoot.iconSize
Layout.preferredHeight: delegateRoot.iconSize
usesPlasmaTheme: false
source: modelData.ApplicationIconRole
scale: root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1
Behavior on scale {
NumberAnimation {
duration: units.longDuration
easing.type: Easing.InOutQuad
}
}
2015-03-13 12:50:13 +00:00
}
2019-02-24 09:22:31 +00:00
PlasmaComponents.Label {
id: label
visible: text.length > 0
2019-02-24 09:22:31 +00:00
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: units.gridUnit
Layout.rightMargin: units.gridUnit
2019-02-24 09:22:31 +00:00
wrapMode: Text.WordWrap
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
maximumLineCount: 1
elide: Text.ElideRight
2019-02-24 09:22:31 +00:00
text: modelData.ApplicationNameRole
font.pixelSize: theme.defaultFont.pixelSize
color: PlasmaCore.ColorScope.textColor
}
}
}