on xenial help sign in
Make tryVerticalJournal, tryHorizontalJournal and tryOrganicGrid work again
5743a90Albert Astals
tests/plugins/Dash/horizontaljournaltry.qml+23−2
@@ -29,14 +29,35 @@ Item {
29 width: parent.width - controls.width
29 width: parent.width - controls.width
30
30
31 delegate: HorizontalJournal {
31 delegate: HorizontalJournal {
32+ id: hj
32 model: vjModel
33 model: vjModel
33 rowHeight: 100
34 rowHeight: 100
34 columnSpacing: 10
35 columnSpacing: 10
35 rowSpacing: 10
36 rowSpacing: 10
36 width: parent.width
37 width: parent.width
37 height: implicitHeight > 100 ? implicitHeight : 100
38 height: implicitHeight > 100 ? implicitHeight : 100
38− delegateCreationBegin: lvwph.contentY
39+ displayMarginBeginning: {
39− delegateCreationEnd: lvwph.contentY + lvwph.height
40+ if (hj.y + hj.height <= 0) {
41+ // Not visible (item at top of the list viewport)
42+ return -hj.height;
43+ } else if (hj.y >= lvwph.height) {
44+ // Not visible (item at bottom of the list viewport)
45+ return 0;
46+ } else {
47+ return -Math.max(-hj.y, 0);
48+ }
49+ }
50+ displayMarginEnd: {
51+ if (hj.y + hj.height <= 0) {
52+ // Not visible (item at top of the list viewport)
53+ return 0;
54+ } else if (hj.y >= lvwph.height) {
55+ // Not visible (item at bottom of the list viewport)
56+ return -hj.height;
57+ } else {
58+ return -Math.max(hj.height - lvwph.height + hj.y, 0)
59+ }
60+ }
40
61
41 delegate: Rectangle {
62 delegate: Rectangle {
42 height: 100
63 height: 100
tests/plugins/Dash/organicgridtry.qml+22−2
@@ -37,8 +37,28 @@ Item {
37 rowSpacing: 10
37 rowSpacing: 10
38 width: parent.width
38 width: parent.width
39 height: implicitHeight > 100 ? implicitHeight : 100
39 height: implicitHeight > 100 ? implicitHeight : 100
40− delegateCreationBegin: lvwph.contentY
40+ displayMarginBeginning: {
41− delegateCreationEnd: lvwph.contentY + lvwph.height
41+ if (grid.y + grid.height <= 0) {
42+ // Not visible (item at top of the list viewport)
43+ return -grid.height;
44+ } else if (grid.y >= lvwph.height) {
45+ // Not visible (item at bottom of the list viewport)
46+ return 0;
47+ } else {
48+ return -Math.max(-grid.y, 0);
49+ }
50+ }
51+ displayMarginEnd: {
52+ if (grid.y + grid.height <= 0) {
53+ // Not visible (item at top of the list viewport)
54+ return 0;
55+ } else if (grid.y >= lvwph.height) {
56+ // Not visible (item at bottom of the list viewport)
57+ return -grid.height;
58+ } else {
59+ return -Math.max(grid.height - lvwph.height + grid.y, 0)
60+ }
61+ }
42
62
43 delegate: Rectangle {
63 delegate: Rectangle {
44 width: 100
64 width: 100
tests/plugins/Dash/verticaljournaltry.qml+23−2
@@ -36,8 +36,29 @@ Item {
36 rowSpacing: 10
36 rowSpacing: 10
37 width: parent.width
37 width: parent.width
38 height: implicitHeight > 100 ? implicitHeight : 100
38 height: implicitHeight > 100 ? implicitHeight : 100
39− delegateCreationBegin: lvwph.contentY
39+
40− delegateCreationEnd: lvwph.contentY + lvwph.height
40+ displayMarginBeginning: {
41+ if (vj.y + vj.height <= 0) {
42+ // Not visible (item at top of the list viewport)
43+ return -vj.height;
44+ } else if (vj.y >= lvwph.height) {
45+ // Not visible (item at bottom of the list viewport)
46+ return 0;
47+ } else {
48+ return -Math.max(-vj.y, 0);
49+ }
50+ }
51+ displayMarginEnd: {
52+ if (vj.y + vj.height <= 0) {
53+ // Not visible (item at top of the list viewport)
54+ return 0;
55+ } else if (vj.y >= lvwph.height) {
56+ // Not visible (item at bottom of the list viewport)
57+ return -vj.height;
58+ } else {
59+ return -Math.max(vj.height - lvwph.height + vj.y, 0)
60+ }
61+ }
41
62
42 delegate: Rectangle {
63 delegate: Rectangle {
43 width: 100
64 width: 100