mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
more reliable dragging in the favorite strip
This commit is contained in:
parent
1d359284ec
commit
d8aac56a4d
3 changed files with 10 additions and 4 deletions
|
|
@ -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)
|
||||
// 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))) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue