Commit d8aac56a authored by Marco Martin's avatar Marco Martin

more reliable dragging in the favorite strip

parent 1d359284
......@@ -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
......
......@@ -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
......
......@@ -46,7 +46,7 @@ Item {
var newRow = 0;
var newContainer = internal.containerForItem(delegate, dragCenterX, dragCenterY);
print("AAA"+newContainer)
Please register or sign in to reply
// 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))) {
......
Markdown is supported
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