Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderView.qml
Show First 20 Lines • Show All 315 Lines • ▼ Show 20 Line(s) | 261 | onPositionChanged: { | |||
---|---|---|---|---|---|
316 | } | 316 | } | ||
317 | 317 | | |||
318 | // Drag initiation. | 318 | // Drag initiation. | ||
319 | if (pressX != -1 && root.isDrag(pressX, pressY, mouse.x, mouse.y)) { | 319 | if (pressX != -1 && root.isDrag(pressX, pressY, mouse.x, mouse.y)) { | ||
320 | if (pressedItem != null && dir.isSelected(positioner.map(pressedItem.index))) { | 320 | if (pressedItem != null && dir.isSelected(positioner.map(pressedItem.index))) { | ||
321 | pressedItem.toolTip.hideToolTip(); | 321 | pressedItem.toolTip.hideToolTip(); | ||
322 | dragX = mouse.x; | 322 | dragX = mouse.x; | ||
323 | dragY = mouse.y; | 323 | dragY = mouse.y; | ||
324 | gridView.verticalDropHitscanOffset = pressedItem.iconArea.y + (pressedItem.iconArea.height / 2) | ||||
324 | dir.dragSelected(mouse.x, mouse.y); | 325 | dir.dragSelected(mouse.x, mouse.y); | ||
325 | dragX = -1; | 326 | dragX = -1; | ||
326 | dragY = -1; | 327 | dragY = -1; | ||
327 | clearPressState(); | 328 | clearPressState(); | ||
328 | } else { | 329 | } else { | ||
329 | // Disable rubberband in popup list view mode. | 330 | // Disable rubberband in popup list view mode. | ||
330 | if (root.useListViewMode) { | 331 | if (root.useListViewMode) { | ||
331 | return; | 332 | return; | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 387 | PlasmaExtras.ScrollArea { | |||
391 | focus: true | 392 | focus: true | ||
392 | 393 | | |||
393 | GridView { | 394 | GridView { | ||
394 | id: gridView | 395 | id: gridView | ||
395 | 396 | | |||
396 | property bool isRootView: false | 397 | property bool isRootView: false | ||
397 | 398 | | |||
398 | property int iconSize: makeIconSize() | 399 | property int iconSize: makeIconSize() | ||
400 | property int verticalDropHitscanOffset: 0 | ||||
399 | 401 | | |||
400 | property Item hoveredItem: null | 402 | property Item hoveredItem: null | ||
401 | 403 | | |||
402 | property int anchorIndex: 0 | 404 | property int anchorIndex: 0 | ||
403 | property bool ctrlPressed: false | 405 | property bool ctrlPressed: false | ||
404 | property bool shiftPressed: false | 406 | property bool shiftPressed: false | ||
405 | 407 | | |||
406 | property bool overflowing: (visibleArea.heightRatio < 1.0 || visibleArea.widthRatio < 1.0) | 408 | property bool overflowing: (visibleArea.heightRatio < 1.0 || visibleArea.widthRatio < 1.0) | ||
▲ Show 20 Lines • Show All 490 Lines • ▼ Show 20 Line(s) | 892 | for (var i = 0; i < urls.length; i++) { | |||
897 | 899 | | |||
898 | var offset = dir.dragCursorOffset(positioner.map(from)); | 900 | var offset = dir.dragCursorOffset(positioner.map(from)); | ||
899 | 901 | | |||
900 | if (offset.x == -1) { | 902 | if (offset.x == -1) { | ||
901 | continue; | 903 | continue; | ||
902 | } | 904 | } | ||
903 | 905 | | |||
904 | itemX = dropPos.x + offset.x + (listener.dragX % cellWidth) + (cellWidth / 2); | 906 | itemX = dropPos.x + offset.x + (listener.dragX % cellWidth) + (cellWidth / 2); | ||
905 | itemY = dropPos.y + offset.y + (listener.dragY % cellHeight) + (cellHeight / 2); | 907 | itemY = dropPos.y + offset.y + (listener.dragY % cellHeight) + gridView.verticalDropHitscanOffset; | ||
906 | 908 | | |||
907 | if (gridView.effectiveLayoutDirection == Qt.RightToLeft) { | 909 | if (gridView.effectiveLayoutDirection == Qt.RightToLeft) { | ||
908 | itemX -= (rows ? gridView.contentX : gridView.originX); | 910 | itemX -= (rows ? gridView.contentX : gridView.originX); | ||
909 | itemX = (rows ? gridView.width : gridView.contentItem.width) - itemX; | 911 | itemX = (rows ? gridView.width : gridView.contentItem.width) - itemX; | ||
910 | } | 912 | } | ||
911 | 913 | | |||
912 | col = Math.floor(itemX / gridView.cellWidth); | 914 | col = Math.floor(itemX / gridView.cellWidth); | ||
913 | row = Math.floor(itemY / gridView.cellHeight); | 915 | row = Math.floor(itemY / gridView.cellHeight); | ||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |