Compare commits

..

1 Commits

Author SHA1 Message Date
Kakueeen 15b999c3c2
Merge cb4ec62c1e into 7a6efa41fb 2025-02-13 13:10:51 +08:00
4 changed files with 26 additions and 28 deletions

View File

@ -24,7 +24,7 @@ Item {
}
QtObject{
id:d
property bool flagXChanged: false
property bool flagXChanged: true
property bool isAnimEnable: control.autoPlay && list_view.count>3
function setData(data){
if(!data){
@ -88,17 +88,14 @@ Item {
}
}
onMovementEnded:{
d.flagXChanged = false
list_view.highlightMoveDuration = 0
currentIndex = list_view.contentX/list_view.width
if(currentIndex === 0){
currentIndex = list_view.count-2
}else if(currentIndex === list_view.count-1){
currentIndex = 1
}
if(d.isAnimEnable){
timer_run.restart()
}
d.flagXChanged = false
timer_run.restart()
}
onMovementStarted: {
d.flagXChanged = true
@ -107,12 +104,12 @@ Item {
onContentXChanged: {
if(d.flagXChanged){
var maxX = Math.min(list_view.width*(currentIndex+1),list_view.count*list_view.width)
var minX = Math.max(0,(list_view.width*(currentIndex-1)))
var minY = Math.max(0,(list_view.width*(currentIndex-1)))
if(contentX>=maxX){
contentX = maxX
}
if(contentX<=minX){
contentX = minX
if(contentX<=minY){
contentX = minY
}
}
}

View File

@ -14,6 +14,13 @@ ProgressBar{
id:d
property real _radius: strokeWidth/2
}
onIndeterminateChanged:{
if(!indeterminate){
animator_x.duration = 0
rect_progress.x = 0
animator_x.duration = control.duration
}
}
background: Rectangle {
implicitWidth: 150
implicitHeight: control.strokeWidth
@ -38,11 +45,6 @@ ProgressBar{
id: animator_x
running: control.indeterminate && control.visible
loops: Animation.Infinite
onRunningChanged: {
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width

View File

@ -24,7 +24,7 @@ Item {
}
QtObject{
id:d
property bool flagXChanged: false
property bool flagXChanged: true
property bool isAnimEnable: control.autoPlay && list_view.count>3
function setData(data){
if(!data){
@ -88,17 +88,14 @@ Item {
}
}
onMovementEnded:{
d.flagXChanged = false
list_view.highlightMoveDuration = 0
currentIndex = list_view.contentX/list_view.width
if(currentIndex === 0){
currentIndex = list_view.count-2
}else if(currentIndex === list_view.count-1){
currentIndex = 1
}
if(d.isAnimEnable){
timer_run.restart()
}
d.flagXChanged = false
timer_run.restart()
}
onMovementStarted: {
d.flagXChanged = true
@ -107,12 +104,12 @@ Item {
onContentXChanged: {
if(d.flagXChanged){
var maxX = Math.min(list_view.width*(currentIndex+1),list_view.count*list_view.width)
var minX = Math.max(0,(list_view.width*(currentIndex-1)))
var minY = Math.max(0,(list_view.width*(currentIndex-1)))
if(contentX>=maxX){
contentX = maxX
}
if(contentX<=minX){
contentX = minX
if(contentX<=minY){
contentX = minY
}
}
}

View File

@ -15,6 +15,13 @@ ProgressBar{
id:d
property real _radius: strokeWidth/2
}
onIndeterminateChanged:{
if(!indeterminate){
animator_x.duration = 0
rect_progress.x = 0
animator_x.duration = control.duration
}
}
background: Rectangle {
implicitWidth: 150
implicitHeight: control.strokeWidth
@ -39,11 +46,6 @@ ProgressBar{
id: animator_x
running: control.indeterminate && control.visible
loops: Animation.Infinite
onRunningChanged: {
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width