1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 06:52:50 -05:00

dock: some cleanup to overflow

This commit is contained in:
bbedward
2026-01-26 16:05:22 -05:00
parent 14a3a0ae55
commit 9d1d73a845
9 changed files with 593 additions and 866 deletions

View File

@@ -215,20 +215,9 @@ Item {
anchors.fill: parent
hoverEnabled: true
enabled: true
// Prevent stealing during drag operations
// Also prevent stealing when NOT in scroll mode (original behavior)
// Only allow Flickable to steal when scrollable AND not dragging
preventStealing: dragging || longPressing || !(dockApps && dockApps.canScroll)
preventStealing: dragging || longPressing
cursorShape: longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onWheel: (wheel) => {
// Only handle wheel if we're NOT in scrollable mode
if (dockApps && dockApps.canScroll) {
wheel.accepted = false // Allow event to propagate to Flickable
} else {
wheel.accepted = true // Consume event (no scrolling needed)
}
}
onPressed: mouse => {
if (mouse.button === Qt.LeftButton && appData && appData.isPinned) {
dragStartPos = Qt.point(mouse.x, mouse.y);
@@ -241,14 +230,8 @@ Item {
const wasDragging = dragging;
const didReorder = wasDragging && targetIndex >= 0 && targetIndex !== originalIndex && dockApps;
console.warn("DockAppButton onReleased:", appData?.appId || "unknown");
console.warn(" wasDragging:", wasDragging, "originalIndex:", originalIndex, "targetIndex:", targetIndex);
console.warn(" didReorder:", didReorder);
if (didReorder) {
// Use movePinnedApp which takes dock indices (original behavior)
if (didReorder)
dockApps.movePinnedApp(originalIndex, targetIndex);
}
longPressing = false;
dragging = false;
@@ -331,7 +314,6 @@ Item {
const distance = Math.sqrt(Math.pow(mouse.x - dragStartPos.x, 2) + Math.pow(mouse.y - dragStartPos.y, 2));
if (distance > 5) {
dragging = true;
// Use dock index directly (original behavior)
targetIndex = index;
originalIndex = index;
if (dockApps) {
@@ -350,7 +332,6 @@ Item {
const spacing = Math.min(8, Math.max(4, actualIconSize * 0.08));
const itemSize = actualIconSize * 1.2 + spacing;
const slotOffset = Math.round(axisOffset / itemSize);
// Use pinnedAppCount as max (original behavior)
const newTargetIndex = Math.max(0, Math.min(dockApps.pinnedAppCount - 1, originalIndex + slotOffset));
if (newTargetIndex !== targetIndex) {