Commit 119a7fb7 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

[uninstall] Uninstall/remove areas to homescreen.

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