more reliable dragging in the favorite strip

This commit is contained in:
Marco Martin 2020-02-14 16:09:44 +01:00
parent 1d359284ec
commit d8aac56a4d
3 changed files with 10 additions and 4 deletions

View file

@ -38,10 +38,16 @@ LauncherContainer {
opacity: launcherDragManager.active && plasmoid.nativeInterface.applicationListModel.favoriteCount >= plasmoid.nativeInterface.applicationListModel.maxFavoriteCount ? 0.3 : 1 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 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 { Behavior on opacity {
OpacityAnimator { OpacityAnimator {
duration: units.longDuration * 4 duration: units.longDuration * 4

View file

@ -66,7 +66,7 @@ Item {
topPadding: 0 topPadding: 0
rightPadding: 0 rightPadding: 0
bottomPadding: 0 bottomPadding: 0
background: Rectangle{opacity: 0.3}
// With a mousearea, it will be possible to drag with touch also on empty places // With a mousearea, it will be possible to drag with touch also on empty places
contentItem: MouseArea { contentItem: MouseArea {
implicitWidth: applicationsFlow.implicitWidth implicitWidth: applicationsFlow.implicitWidth

View file

@ -46,7 +46,7 @@ Item {
var newRow = 0; var newRow = 0;
var newContainer = internal.containerForItem(delegate, dragCenterX, dragCenterY); var newContainer = internal.containerForItem(delegate, dragCenterX, dragCenterY);
print("AAA"+newContainer)
// Put it in the favorites strip // Put it in the favorites strip
if (newContainer == favoriteStrip) { if (newContainer == favoriteStrip) {
var pos = favoriteStrip.flow.mapFromItem(delegate, 0, 0); var pos = favoriteStrip.flow.mapFromItem(delegate, 0, 0);
@ -100,7 +100,7 @@ Item {
} }
function containerForItem(item, dragCenterX, dragCenterY) { 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) { && plasmoid.nativeInterface.applicationListModel.favoriteCount < plasmoid.nativeInterface.applicationListModel.maxFavoriteCount) {
return favoriteStrip; return favoriteStrip;
} else if (appletsLayout.contains(appletsLayout.mapFromItem(item, dragCenterX, dragCenterY))) { } else if (appletsLayout.contains(appletsLayout.mapFromItem(item, dragCenterX, dragCenterY))) {