File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed
Qt5/imports/FluentUI/Controls
Qt6/imports/FluentUI/Controls Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 24
24
}
25
25
QtObject{
26
26
id: d
27
- property bool flagXChanged: true
27
+ property bool flagXChanged: false
28
28
property bool isAnimEnable: control .autoPlay && list_view .count > 3
29
29
function setData (data ){
30
30
if (! data){
@@ -88,14 +88,17 @@ Item {
88
88
}
89
89
}
90
90
onMovementEnded: {
91
+ d .flagXChanged = false
92
+ list_view .highlightMoveDuration = 0
91
93
currentIndex = list_view .contentX / list_view .width
92
94
if (currentIndex === 0 ){
93
95
currentIndex = list_view .count - 2
94
96
}else if (currentIndex === list_view .count - 1 ){
95
97
currentIndex = 1
96
98
}
97
- d .flagXChanged = false
98
- timer_run .restart ()
99
+ if (d .isAnimEnable ){
100
+ timer_run .restart ()
101
+ }
99
102
}
100
103
onMovementStarted: {
101
104
d .flagXChanged = true
@@ -104,12 +107,12 @@ Item {
104
107
onContentXChanged: {
105
108
if (d .flagXChanged ){
106
109
var maxX = Math .min (list_view .width * (currentIndex+ 1 ),list_view .count * list_view .width )
107
- var minY = Math .max (0 ,(list_view .width * (currentIndex- 1 )))
110
+ var minX = Math .max (0 ,(list_view .width * (currentIndex- 1 )))
108
111
if (contentX>= maxX){
109
112
contentX = maxX
110
113
}
111
- if (contentX<= minY ){
112
- contentX = minY
114
+ if (contentX<= minX ){
115
+ contentX = minX
113
116
}
114
117
}
115
118
}
Original file line number Diff line number Diff line change 24
24
}
25
25
QtObject{
26
26
id: d
27
- property bool flagXChanged: true
27
+ property bool flagXChanged: false
28
28
property bool isAnimEnable: control .autoPlay && list_view .count > 3
29
29
function setData (data ){
30
30
if (! data){
@@ -88,14 +88,17 @@ Item {
88
88
}
89
89
}
90
90
onMovementEnded: {
91
+ d .flagXChanged = false
92
+ list_view .highlightMoveDuration = 0
91
93
currentIndex = list_view .contentX / list_view .width
92
94
if (currentIndex === 0 ){
93
95
currentIndex = list_view .count - 2
94
96
}else if (currentIndex === list_view .count - 1 ){
95
97
currentIndex = 1
96
98
}
97
- d .flagXChanged = false
98
- timer_run .restart ()
99
+ if (d .isAnimEnable ){
100
+ timer_run .restart ()
101
+ }
99
102
}
100
103
onMovementStarted: {
101
104
d .flagXChanged = true
@@ -104,12 +107,12 @@ Item {
104
107
onContentXChanged: {
105
108
if (d .flagXChanged ){
106
109
var maxX = Math .min (list_view .width * (currentIndex+ 1 ),list_view .count * list_view .width )
107
- var minY = Math .max (0 ,(list_view .width * (currentIndex- 1 )))
110
+ var minX = Math .max (0 ,(list_view .width * (currentIndex- 1 )))
108
111
if (contentX>= maxX){
109
112
contentX = maxX
110
113
}
111
- if (contentX<= minY ){
112
- contentX = minY
114
+ if (contentX<= minX ){
115
+ contentX = minX
113
116
}
114
117
}
115
118
}
You can’t perform that action at this time.
0 commit comments