Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderView.qml
Show First 20 Lines • Show All 477 Lines • ▼ Show 20 Line(s) | 475 | onContentYChanged: { | |||
---|---|---|---|---|---|
478 | if (contentY == 0) { | 478 | if (contentY == 0) { | ||
479 | scrollUp = false; | 479 | scrollUp = false; | ||
480 | } | 480 | } | ||
481 | 481 | | |||
482 | if (contentY == contentItem.height - height) { | 482 | if (contentY == contentItem.height - height) { | ||
483 | scrollDown = false; | 483 | scrollDown = false; | ||
484 | } | 484 | } | ||
485 | 485 | | |||
486 | // Update rubberband geomety. | 486 | // Update rubberband geometry. | ||
487 | if (main.rubberBand) { | 487 | if (main.rubberBand) { | ||
488 | var rB = main.rubberBand; | 488 | var rB = main.rubberBand; | ||
489 | 489 | | |||
490 | if (scrollUp) { | 490 | if (scrollUp) { | ||
491 | rB.y = 0; | 491 | rB.y = 0; | ||
492 | rB.height = listener.cPress.y; | 492 | rB.height = listener.cPress.y; | ||
493 | } | 493 | } | ||
494 | 494 | | |||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 552 | onLayoutDirectionChanged: { | |||
556 | } | 556 | } | ||
557 | } | 557 | } | ||
558 | 558 | | |||
559 | onCurrentIndexChanged: { | 559 | onCurrentIndexChanged: { | ||
560 | positionViewAtIndex(currentIndex, GridView.Contain); | 560 | positionViewAtIndex(currentIndex, GridView.Contain); | ||
561 | } | 561 | } | ||
562 | 562 | | |||
563 | onCachedRectangleSelectionChanged: { | 563 | onCachedRectangleSelectionChanged: { | ||
564 | if (cachedRectangleSelection) { | 564 | if (cachedRectangleSelection.length) { | ||
565 | dir.updateSelection(cachedRectangleSelection, gridView.ctrlPressed); | 565 | // Set current index to start of selection. | ||
566 | // cachedRectangleSelection is pre-sorted. | ||||
567 | currentIndex = cachedRectangleSelection[0]; | ||||
568 | | ||||
569 | dir.updateSelection(cachedRectangleSelection.map(positioner.map), | ||||
570 | gridView.ctrlPressed); | ||||
566 | } | 571 | } | ||
567 | } | 572 | } | ||
568 | 573 | | |||
569 | function makeIconSize() { | 574 | function makeIconSize() { | ||
570 | if (root.useListViewMode) { | 575 | if (root.useListViewMode) { | ||
571 | return units.iconSizes.small; | 576 | return units.iconSizes.small; | ||
572 | } | 577 | } | ||
573 | 578 | | |||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 633 | if (main.rubberBand.intersects(Qt.rect(itemX + units.smallSpacing, itemY + units.smallSpacing, | |||
631 | 636 | | |||
632 | // If this is a visible item, check for intersection with the actual | 637 | // If this is a visible item, check for intersection with the actual | ||
633 | // icon or label rects for better feel. | 638 | // icon or label rects for better feel. | ||
634 | if (item && item.iconArea) { | 639 | if (item && item.iconArea) { | ||
635 | var iconRect = Qt.rect(itemX + item.iconArea.x, itemY + item.iconArea.y, | 640 | var iconRect = Qt.rect(itemX + item.iconArea.x, itemY + item.iconArea.y, | ||
636 | item.iconArea.width, item.iconArea.height); | 641 | item.iconArea.width, item.iconArea.height); | ||
637 | 642 | | |||
638 | if (main.rubberBand.intersects(iconRect)) { | 643 | if (main.rubberBand.intersects(iconRect)) { | ||
639 | indices.push(positioner.map(index)); | 644 | indices.push(index); | ||
640 | continue; | 645 | continue; | ||
641 | } | 646 | } | ||
642 | 647 | | |||
643 | var labelRect = Qt.rect(itemX + item.labelArea.x, itemY + item.labelArea.y, | 648 | var labelRect = Qt.rect(itemX + item.labelArea.x, itemY + item.labelArea.y, | ||
644 | item.labelArea.width, item.labelArea.height); | 649 | item.labelArea.width, item.labelArea.height); | ||
645 | 650 | | |||
646 | if (main.rubberBand.intersects(labelRect)) { | 651 | if (main.rubberBand.intersects(labelRect)) { | ||
647 | indices.push(positioner.map(index)); | 652 | indices.push(index); | ||
648 | continue; | 653 | continue; | ||
649 | } | 654 | } | ||
650 | } else { | 655 | } else { | ||
651 | // Otherwise be content with the cell intersection. | 656 | // Otherwise be content with the cell intersection. | ||
652 | indices.push(positioner.map(index)); | 657 | indices.push(index); | ||
653 | } | 658 | } | ||
654 | } | 659 | } | ||
655 | } | 660 | } | ||
656 | } | 661 | } | ||
657 | 662 | | |||
658 | gridView.cachedRectangleSelection = indices; | 663 | gridView.cachedRectangleSelection = indices; | ||
659 | } | 664 | } | ||
660 | 665 | | |||
▲ Show 20 Lines • Show All 436 Lines • Show Last 20 Lines |