Commit d06b630
Enable scroll in lock mode + fix Android storage path (#4755)
* Fix tile drag: auto-scroll GridView when dragging to screen edges
- Home.qml: Added autoScrollTimer (50ms interval) that scrolls the
GridView when dragging a tile near the top or bottom viewport edge,
with speed proportional to proximity to the edge.
- Home.qml: Added indexAtMouse() helper that accounts for contentY
offset when computing which tile is under the cursor during drag,
fixing incorrect target index when the grid has scrolled.
- Home.qml: Fixed active tile visual position to include gridView.contentY
so the dragged tile stays visually anchored to the cursor while scrolling.
- Home.qml: Track startIndex and tileName at long-press time to correctly
identify source tile and compare against drop position at release.
- homeform.cpp: Fixed moveTile() edge case where inserting a tile at the
last position never wrote its order setting because i only reached
newIndex after the loop ended.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix tile drag: use ghost tile instead of repositioning delegate
Moving the dragged tile's y position within GridView's contentItem
coordinate system confused the GridView's virtualization, causing
other tiles to disappear during drag. Fix by:
- Keeping the source tile in place (just dimming it to opacity 0.3)
- Showing a separate ghost Item outside GridView that follows the mouse
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove Behavior on x/y from tile delegate to fix disappearing tiles during drag
The OutBack easing on delegates caused newly-virtualized tiles to animate
from y=0 (above the viewport when contentY > 0) to their target position,
making them invisible for 400ms during auto-scroll. Since moveTile() rebuilds
the entire model via sortTiles() on release (not appModel.move()), these
animations served no useful purpose.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix moveTile: use correct QSettings key for tiles with camelCase m_id
moveTile() constructed settings keys as "tile_" + m_id.toLower() + "_order",
but several DataObjects use camelCase m_ids (e.g. "avgWattLap") that don't
match the actual QZSettings key ("tile_avg_watt_lap_order"). As a result,
the moved tile's order was written to the wrong settings key and sortTiles()
ignored it, leaving the tile in its original position after drag-and-drop.
Fixed with a static lookup table in moveTile() mapping the mismatched m_ids
to their correct QZSettings order key. Affected tiles:
- avgWattLap → tile_avg_watt_lap_order
- joul → tile_jouls_order
- steeringangle → tile_steering_angle_order
- stride_length → tile_instantaneous_stride_length_order
- external_inclination → tile_ext_incline_order
- target_inclination → tile_target_incline_order
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Enable scroll in lock mode and fix Android storage path on Waydroid
In lock mode (lockTiles=true) the GridView's built-in interactive
scrolling is disabled to prevent accidental tile drags. This meant any
tiles beyond the visible viewport could never be reached.
Fix: set `interactive: !window.lockTiles` so built-in scrolling is
active only in normal mode, and add a manual scroll handler in the
MouseArea's onPositionChanged that moves gridView.contentY when no drag
is in progress (currentId === -1). An `isSwiping` flag suppresses
long-press-to-drag when the gesture starts as a swipe.
Also fix getAndroidDataAppDir() to handle Waydroid/emulator environments
where isExternalStorageRemovable() throws IllegalArgumentException: clear
the pending JNI exception and fall back to internal storage if external
storage resolution fails entirely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent fb3b806 commit d06b630
2 files changed
Lines changed: 141 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| |||
320 | 321 | | |
321 | 322 | | |
322 | 323 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | 324 | | |
333 | 325 | | |
334 | 326 | | |
| |||
340 | 332 | | |
341 | 333 | | |
342 | 334 | | |
343 | | - | |
| 335 | + | |
344 | 336 | | |
345 | 337 | | |
346 | | - | |
| 338 | + | |
347 | 339 | | |
348 | 340 | | |
349 | 341 | | |
| |||
630 | 622 | | |
631 | 623 | | |
632 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
633 | 679 | | |
634 | | - | |
635 | | - | |
636 | | - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
637 | 696 | | |
638 | 697 | | |
639 | 698 | | |
640 | 699 | | |
641 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
642 | 720 | | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
647 | 731 | | |
648 | 732 | | |
649 | 733 | | |
650 | | - | |
651 | | - | |
652 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
653 | 743 | | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
654 | 752 | | |
655 | 753 | | |
656 | 754 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
641 | | - | |
| 641 | + | |
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| |||
4537 | 4537 | | |
4538 | 4538 | | |
4539 | 4539 | | |
4540 | | - | |
4541 | | - | |
4542 | | - | |
4543 | | - | |
4544 | | - | |
4545 | | - | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
4546 | 4555 | | |
4547 | 4556 | | |
4548 | 4557 | | |
4549 | 4558 | | |
4550 | | - | |
| 4559 | + | |
4551 | 4560 | | |
4552 | 4561 | | |
4553 | | - | |
4554 | 4562 | | |
4555 | | - | |
| 4563 | + | |
4556 | 4564 | | |
4557 | 4565 | | |
4558 | 4566 | | |
4559 | | - | |
4560 | | - | |
4561 | | - | |
4562 | | - | |
4563 | | - | |
4564 | | - | |
| 4567 | + | |
| 4568 | + | |
4565 | 4569 | | |
4566 | 4570 | | |
4567 | | - | |
4568 | | - | |
4569 | 4571 | | |
4570 | 4572 | | |
4571 | 4573 | | |
| |||
10760 | 10762 | | |
10761 | 10763 | | |
10762 | 10764 | | |
10763 | | - | |
| 10765 | + | |
10764 | 10766 | | |
10765 | 10767 | | |
10766 | 10768 | | |
| |||
0 commit comments