Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderView.qml
Show First 20 Lines • Show All 370 Lines • ▼ Show 20 Line(s) | 316 | onPositionChanged: { | |||
---|---|---|---|---|---|
371 | } | 371 | } | ||
372 | 372 | | |||
373 | // Drag initiation. | 373 | // Drag initiation. | ||
374 | if (pressX != -1 && root.isDrag(pressX, pressY, mouse.x, mouse.y)) { | 374 | if (pressX != -1 && root.isDrag(pressX, pressY, mouse.x, mouse.y)) { | ||
375 | if (pressedItem != null && dir.isSelected(positioner.map(pressedItem.index))) { | 375 | if (pressedItem != null && dir.isSelected(positioner.map(pressedItem.index))) { | ||
376 | pressedItem.toolTip.hideToolTip(); | 376 | pressedItem.toolTip.hideToolTip(); | ||
377 | dragX = mouse.x; | 377 | dragX = mouse.x; | ||
378 | dragY = mouse.y; | 378 | dragY = mouse.y; | ||
379 | gridView.verticalDropHitscanOffset = pressedItem.iconArea.y + (pressedItem.iconArea.height / 2) | ||||
379 | dir.dragSelected(mouse.x, mouse.y); | 380 | dir.dragSelected(mouse.x, mouse.y); | ||
380 | dragX = -1; | 381 | dragX = -1; | ||
381 | dragY = -1; | 382 | dragY = -1; | ||
382 | clearPressState(); | 383 | clearPressState(); | ||
383 | } else { | 384 | } else { | ||
384 | // Disable rubberband in popup list view mode. | 385 | // Disable rubberband in popup list view mode. | ||
385 | if (root.useListViewMode) { | 386 | if (root.useListViewMode) { | ||
386 | return; | 387 | return; | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 460 | PlasmaExtras.ScrollArea { | |||
464 | focus: true | 465 | focus: true | ||
465 | 466 | | |||
466 | GridView { | 467 | GridView { | ||
467 | id: gridView | 468 | id: gridView | ||
468 | 469 | | |||
469 | property bool isRootView: false | 470 | property bool isRootView: false | ||
470 | 471 | | |||
471 | property int iconSize: makeIconSize() | 472 | property int iconSize: makeIconSize() | ||
473 | property int verticalDropHitscanOffset: 0 | ||||
472 | 474 | | |||
473 | property Item hoveredItem: null | 475 | property Item hoveredItem: null | ||
474 | 476 | | |||
475 | property int anchorIndex: 0 | 477 | property int anchorIndex: 0 | ||
476 | property bool ctrlPressed: false | 478 | property bool ctrlPressed: false | ||
477 | property bool shiftPressed: false | 479 | property bool shiftPressed: false | ||
478 | 480 | | |||
479 | property bool overflowing: (visibleArea.heightRatio < 1.0 || visibleArea.widthRatio < 1.0) | 481 | property bool overflowing: (visibleArea.heightRatio < 1.0 || visibleArea.widthRatio < 1.0) | ||
▲ Show 20 Lines • Show All 521 Lines • ▼ Show 20 Line(s) | 996 | for (var i = 0; i < urls.length; i++) { | |||
1001 | 1003 | | |||
1002 | var offset = dir.dragCursorOffset(positioner.map(from)); | 1004 | var offset = dir.dragCursorOffset(positioner.map(from)); | ||
1003 | 1005 | | |||
1004 | if (offset.x == -1) { | 1006 | if (offset.x == -1) { | ||
1005 | continue; | 1007 | continue; | ||
1006 | } | 1008 | } | ||
1007 | 1009 | | |||
1008 | itemX = dropPos.x + offset.x + (listener.dragX % cellWidth) + (cellWidth / 2); | 1010 | itemX = dropPos.x + offset.x + (listener.dragX % cellWidth) + (cellWidth / 2); | ||
1009 | itemY = dropPos.y + offset.y + (listener.dragY % cellHeight) + (cellHeight / 2); | 1011 | itemY = dropPos.y + offset.y + (listener.dragY % cellHeight) + gridView.verticalDropHitscanOffset; | ||
1010 | 1012 | | |||
1011 | if (gridView.effectiveLayoutDirection == Qt.RightToLeft) { | 1013 | if (gridView.effectiveLayoutDirection == Qt.RightToLeft) { | ||
1012 | itemX -= (rows ? gridView.contentX : gridView.originX); | 1014 | itemX -= (rows ? gridView.contentX : gridView.originX); | ||
1013 | itemX = (rows ? gridView.width : gridView.contentItem.width) - itemX; | 1015 | itemX = (rows ? gridView.width : gridView.contentItem.width) - itemX; | ||
1014 | } | 1016 | } | ||
1015 | 1017 | | |||
1016 | col = Math.floor(itemX / gridView.cellWidth); | 1018 | col = Math.floor(itemX / gridView.cellWidth); | ||
1017 | row = Math.floor(itemY / gridView.cellHeight); | 1019 | row = Math.floor(itemY / gridView.cellHeight); | ||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |