From 32bd414b9e2ddc159e5ea3575bc80b07c79ad71c Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 10 Jul 2022 21:08:03 -0400 Subject: [PATCH] homescreens/halcyon: Fix entry removal for folders --- .../halcyon/package/contents/ui/FavoritesAppDelegate.qml | 5 ++--- .../halcyon/package/contents/ui/FavoritesGrid.qml | 5 +++-- .../homescreens/halcyon/package/contents/ui/FolderGrid.qml | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml index 756681c7..65aa2d2c 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml @@ -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 } diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml index a9bccd83..84739e4f 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml @@ -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) diff --git a/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml index 4a74b84d..8253873c 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml @@ -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