Commit fa384c70 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Merge pull request #7 from locusf/uninstall_remove

[uninstall] Uninstall/remove areas to homescreen.
parents 0ea10c58 119a7fb7
......@@ -24,6 +24,8 @@
import QtQuick 2.0
import org.nemomobile.lipstick 0.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
// App Launcher page
// the place for browsing installed applications and launching them
......@@ -35,14 +37,48 @@ GridView {
width: Math.floor(parent.width / cellWidth) * cellWidth
cacheBuffer: gridview.contentHeight
property Item reorderItem
property bool onUninstall
property alias deleter: deleter
// just for margin purposes
header: Item {
height: 30
height: 100
}
footer: Item {
height: 20
Item {
id: deleter
anchors.top: parent.top
property alias remove: remove
property alias uninstall: uninstall
Rectangle {
id: remove
property alias text: lbl.text
visible: onUninstall
height: 110
color: "red"
width: gridview.width / 2
Label {
id: lbl
anchors.centerIn: parent
text: "Remove"
font.pointSize: 8
}
}
Rectangle {
id: uninstall
property alias text: lbl2.text
anchors.left: remove.right
visible: onUninstall
color: "red"
width: gridview.width / 2
height: 110
Label {
id: lbl2
anchors.centerIn: parent
text: "Uninstall"
font.pointSize: 8
}
}
}
model: LauncherModel { id: launcherModel }
......
......@@ -74,6 +74,7 @@ Item {
drag.target = launcherItem
z = 1000
reordering = true
gridview.onUninstall = true
// don't allow dragging an icon out of pages with a horizontal flick
pager.interactive = false
......@@ -85,9 +86,14 @@ Item {
reorderTimer.stop()
drag.target = null
reorderItem = null
pager.interactive = true
gridview.onUninstall = false
deleter.remove.text = "Remove"
deleter.uninstall.text = "Uninstall"
reparent(gridview.contentItem)
slideMoveAnim.start()
pager.interactive = true
}
}
......@@ -102,18 +108,17 @@ Item {
if (reordering) {
var gridViewPos = gridview.contentItem.mapFromItem(launcherItem, width/2, height/2)
var idx = gridview.indexAt(gridViewPos.x, gridViewPos.y)
var delPos = deleter.remove.mapFromItem(launcherItem, width/2, height/2)
var isdel = deleter.childAt(delPos.x, delPos.y)
if (isdel === deleter.remove) {
deleter.remove.text = "Removing " + iconCaption
} else if (isdel === deleter.uninstall) {
deleter.uninstall.text = "Uninstalling " + iconCaption
}
if (newIndex !== idx) {
reorderTimer.restart()
newIndex = idx
}
/*
var globalY = desktop.mapFromItem(launcherItem, 0, 0).y
if (globalY < 70) {
pageChangeTimer.start()
} else {
pageChangeTimer.stop()
}
*/
}
}
......
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