Commit 32bd414b authored by Devin Lin's avatar Devin Lin 🎨
Browse files

homescreens/halcyon: Fix entry removal for folders

parent 2c50d504
Pipeline #202398 passed with stage
in 1 minute and 2 seconds
......@@ -40,6 +40,7 @@ Item {
readonly property string applicationIcon: application ? application.icon : ""
signal folderOpenRequested()
signal removeRequested()
property alias drag: mouseArea.drag
Drag.active: delegate.drag.active
......@@ -101,9 +102,7 @@ Item {
PlasmaComponents.MenuItem {
icon.name: "emblem-favorite"
text: i18n("Remove from favourites")
onClicked: {
Halcyon.PinnedModel.removeEntry(model.index);
}
onClicked: delegate.removeRequested()
}
onClosed: dialogLoader.active = false
}
......
......@@ -177,7 +177,7 @@ MobileShell.GridView {
anchors.left: leftDropArea.right
anchors.right: rightDropArea.left
onEntered: (drag) => {
if (transitionAnim.running || appDelegate.drag.active) return; // don't do anything when reordering
if (transitionAnim.running || appDelegate.drag.active || drag.source.isFolder) return; // don't do anything when reordering
folderAnim.to = 1;
folderAnim.restart();
}
......@@ -186,7 +186,7 @@ MobileShell.GridView {
folderAnim.restart();
}
onDropped: (drop) => {
if (transitionAnim.running || appDelegate.drag.active) return; // don't do anything when reordering
if (transitionAnim.running || appDelegate.drag.active || drag.source.isFolder) return; // don't do anything when reordering
if (appDelegate.isFolder) {
Halcyon.PinnedModel.addAppToFolder(drop.source.visualIndex, appDelegate.visualIndex);
} else {
......@@ -214,6 +214,7 @@ MobileShell.GridView {
application: model.application
onFolderOpenRequested: root.requestOpenFolder(model.folder)
onRemoveRequested: Halcyon.PinnedModel.removeEntry(model.index);
readonly property bool isLeftColumn: !root.twoColumn || ((visualIndex % 2) === 0)
readonly property bool isRightColumn: !root.twoColumn || ((visualIndex % 2) !== 0)
......
......@@ -123,6 +123,8 @@ MobileShell.GridView {
isFolder: false
application: modelData
onRemoveRequested: root.folder.removeApp(model.index);
readonly property bool isLeftColumn: !root.twoColumn || ((visualIndex % 2) === 0)
readonly property bool isRightColumn: !root.twoColumn || ((visualIndex % 2) !== 0)
leftPadding: isLeftColumn ? root.leftMargin : 0
......
Supports Markdown
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