Commit 34aa76bd authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

[folders] Show a folder contents.

parent db763ecf
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls.Nemo 1.0 import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
import org.nemomobile.lipstick 0.1
Item { Item {
id: wrapper id: wrapper
...@@ -52,6 +53,47 @@ Item { ...@@ -52,6 +53,47 @@ Item {
} }
} }
GridView {
id: folderLoader
anchors.top: parent.bottom
width: gridview.width
height: childrenRect.height
cellWidth: 115
cellHeight: cellWidth + 30
Rectangle {
anchors.fill: parent
opacity: 0.75
color: "white"
}
delegate: MouseArea {
width: gridview.cellWidth
height: gridview.cellHeight
Image {
id: iconimage
source: model.object.iconId == "" ? ":/images/icons/apps.png" : (model.object.iconId.indexOf("/") == 0 ? "file://" : "image://theme/") + model.object.iconId
}
Text {
id: icontext
// elide only works if an explicit width is set
width: parent.width
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 18
color: 'white'
anchors {
left: parent.left
right: parent.right
top: iconimage.bottom
topMargin: 5
}
}
onClicked: {
model.object.launchApplication()
}
}
}
// Application icon for the launcher // Application icon for the launcher
MouseArea { MouseArea {
id: launcherItem id: launcherItem
...@@ -65,7 +107,16 @@ Item { ...@@ -65,7 +107,16 @@ Item {
onClicked: { onClicked: {
// TODO: disallow if close mode enabled // TODO: disallow if close mode enabled
model.object.launchApplication() if (model.object.type !== LauncherModel.Folder) {
model.object.launchApplication()
} else {
if (!folderLoader.visible) {
folderLoader.visible = true
folderLoader.model = model.object
} else {
folderLoader.visible = false
}
}
} }
onPressAndHold: { onPressAndHold: {
...@@ -157,7 +208,7 @@ Item { ...@@ -157,7 +208,7 @@ Item {
Spinner { Spinner {
id: spinner id: spinner
anchors.centerIn: parent anchors.centerIn: parent
enabled: (model.object.type === 0) ? model.object.isLaunching : false enabled: (model.object.type === LauncherModel.Application) ? model.object.isLaunching : false
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment