homescreens/halcyon: Fix entry removal for folders

This commit is contained in:
Devin Lin 2022-07-10 21:08:03 -04:00
parent 2c50d50440
commit 32bd414b9e
3 changed files with 7 additions and 5 deletions

View file

@ -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
}

View file

@ -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)

View file

@ -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