diff --git a/shell/contents/components/HomeLauncher.qml b/shell/contents/components/HomeLauncher.qml new file mode 100644 index 00000000..0ebd5cf5 --- /dev/null +++ b/shell/contents/components/HomeLauncher.qml @@ -0,0 +1,39 @@ +import QtQuick 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore + +MouseArea { + id: root + width: applications.cellWidth + height: width + onClicked: { + console.log("Clicked: " + width) + } + + PlasmaCore.IconItem { + id: icon + anchors { + top: root.top + horizontalCenter: root.horizontalCenter + } + width: units.iconSizes.large + height: width + source: iconName + } + + Text { + visible: text.length > 0 + + anchors { + top: icon.bottom + left: parent.left + right: parent.right + } + + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + + font.pixelSize: theme.smallestFont.pointSize + text: name + color: "white" + } +} diff --git a/shell/contents/components/HomeLauncherSvg.qml b/shell/contents/components/HomeLauncherSvg.qml index bb9c56cf..a64672ce 100644 --- a/shell/contents/components/HomeLauncherSvg.qml +++ b/shell/contents/components/HomeLauncherSvg.qml @@ -30,11 +30,5 @@ Item { addNumber(parent.text); } } - - onReleased: { - if (drag.active) { - - } - } } } diff --git a/shell/contents/views/Desktop.qml b/shell/contents/views/Desktop.qml index 7de8069d..771f7fd2 100644 --- a/shell/contents/views/Desktop.qml +++ b/shell/contents/views/Desktop.qml @@ -172,6 +172,10 @@ Item { NumberAnimation { properties: "opacity"; duration: 100 } } + onOpacityChanged: { + visible = opacity > 0; + } + onVisibleChanged: { opacity = visible ? 0.9 : 0; } @@ -306,15 +310,39 @@ Item { } } - Grid { + PlasmaCore.DataSource { + id: applicationsSource + + engine: "apps" + interval: 0 + connectedSources: sources + + onSourceAdded: { + connectSource(source); + } + + onSourceRemoved: { + disconnectSource(source); + } + } + + GridView { id: applications - z: 1 anchors { top: stripe.bottom bottom: parent.bottom - left: parent.left - right: parent.right + horizontalCenter: parent.horizontalCenter + topMargin: units.smallSpacing } + z: 1 + cellWidth: stripe.height * 2 + cellHeight: cellWidth + width: cellWidth * 4 + model: PlasmaCore.DataModel { dataSource: applicationsSource } + snapMode: GridView.SnapToRow + clip: true + delegate: HomeLauncher {} + Component.onCompleted : { console.log("WTF " + width) } } Component.onCompleted: {