From d8aac56a4ddf620d21184657679a9fd7838d37f7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 14 Feb 2020 16:09:44 +0100 Subject: [PATCH] more reliable dragging in the favorite strip --- .../package/contents/ui/launcher/FavoriteStrip.qml | 8 +++++++- .../package/contents/ui/launcher/LauncherContainer.qml | 2 +- .../package/contents/ui/launcher/LauncherDragManager.qml | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/containments/homescreen/package/contents/ui/launcher/FavoriteStrip.qml b/containments/homescreen/package/contents/ui/launcher/FavoriteStrip.qml index 2aae87fb..28cb8327 100644 --- a/containments/homescreen/package/contents/ui/launcher/FavoriteStrip.qml +++ b/containments/homescreen/package/contents/ui/launcher/FavoriteStrip.qml @@ -38,10 +38,16 @@ LauncherContainer { opacity: launcherDragManager.active && plasmoid.nativeInterface.applicationListModel.favoriteCount >= plasmoid.nativeInterface.applicationListModel.maxFavoriteCount ? 0.3 : 1 - height: launcherGrid.cellHeight + height: visible ? launcherGrid.cellHeight : 0 frame.implicitWidth: launcherGrid.cellWidth * Math.max(1, flow.children.length) + frame.leftPadding + frame.rightPadding + Behavior on height { + NumberAnimation { + duration: units.longDuration + easing.type: Easing.InOutQuad + } + } Behavior on opacity { OpacityAnimator { duration: units.longDuration * 4 diff --git a/containments/homescreen/package/contents/ui/launcher/LauncherContainer.qml b/containments/homescreen/package/contents/ui/launcher/LauncherContainer.qml index 3a9bf0ca..225cc9d2 100644 --- a/containments/homescreen/package/contents/ui/launcher/LauncherContainer.qml +++ b/containments/homescreen/package/contents/ui/launcher/LauncherContainer.qml @@ -66,7 +66,7 @@ Item { topPadding: 0 rightPadding: 0 bottomPadding: 0 - +background: Rectangle{opacity: 0.3} // With a mousearea, it will be possible to drag with touch also on empty places contentItem: MouseArea { implicitWidth: applicationsFlow.implicitWidth diff --git a/containments/homescreen/package/contents/ui/launcher/LauncherDragManager.qml b/containments/homescreen/package/contents/ui/launcher/LauncherDragManager.qml index 59f96768..5e64ffd3 100644 --- a/containments/homescreen/package/contents/ui/launcher/LauncherDragManager.qml +++ b/containments/homescreen/package/contents/ui/launcher/LauncherDragManager.qml @@ -46,7 +46,7 @@ Item { var newRow = 0; var newContainer = internal.containerForItem(delegate, dragCenterX, dragCenterY); - +print("AAA"+newContainer) // Put it in the favorites strip if (newContainer == favoriteStrip) { var pos = favoriteStrip.flow.mapFromItem(delegate, 0, 0); @@ -100,7 +100,7 @@ Item { } function containerForItem(item, dragCenterX, dragCenterY) { - if (favoriteStrip.contains(favoriteStrip.frame.mapFromItem(item, dragCenterX, dragCenterY)) + if (favoriteStrip.contains(Qt.point(0,favoriteStrip.frame.mapFromItem(item, dragCenterX, dragCenterY).y)) && plasmoid.nativeInterface.applicationListModel.favoriteCount < plasmoid.nativeInterface.applicationListModel.maxFavoriteCount) { return favoriteStrip; } else if (appletsLayout.contains(appletsLayout.mapFromItem(item, dragCenterX, dragCenterY))) {