app listing

This commit is contained in:
Aaron Seigo 2014-09-29 22:43:08 +02:00
parent 511041d65e
commit 1e20ad8734
3 changed files with 71 additions and 10 deletions

View file

@ -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"
}
}

View file

@ -30,11 +30,5 @@ Item {
addNumber(parent.text);
}
}
onReleased: {
if (drag.active) {
}
}
}
}

View file

@ -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: {