mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
app listing
This commit is contained in:
parent
511041d65e
commit
1e20ad8734
3 changed files with 71 additions and 10 deletions
39
shell/contents/components/HomeLauncher.qml
Normal file
39
shell/contents/components/HomeLauncher.qml
Normal 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"
|
||||
}
|
||||
}
|
||||
|
|
@ -30,11 +30,5 @@ Item {
|
|||
addNumber(parent.text);
|
||||
}
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
if (drag.active) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue