This commit is contained in:
zhuzichu 2023-10-12 18:25:08 +08:00
parent 16da5f1633
commit 992d8c142c
2 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import FluentUI import FluentUI
ProgressBar{ ProgressBar{
property int duration: 888
property real strokeWidth: 6 property real strokeWidth: 6
property bool progressVisible: false property bool progressVisible: false
property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
@ -17,7 +18,7 @@ ProgressBar{
if(!indeterminate){ if(!indeterminate){
animator_x.duration = 0 animator_x.duration = 0
rect_progress.x = 0 rect_progress.x = 0
animator_x.duration = 888 animator_x.duration = control.duration
} }
} }
background: Rectangle { background: Rectangle {
@ -46,7 +47,7 @@ ProgressBar{
from: -rect_progress.width from: -rect_progress.width
to:control.width+rect_progress.width to:control.width+rect_progress.width
loops: Animation.Infinite loops: Animation.Infinite
duration: 888 duration: control.duration
} }
} }
} }

View File

@ -4,6 +4,7 @@ import QtQuick.Shapes
import FluentUI import FluentUI
ProgressBar{ ProgressBar{
property int duration: 888
property real strokeWidth: 6 property real strokeWidth: 6
property bool progressVisible: false property bool progressVisible: false
property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
@ -23,7 +24,7 @@ ProgressBar{
if(!indeterminate){ if(!indeterminate){
animator_r.duration = 0 animator_r.duration = 0
layout_item.rotation = 0 layout_item.rotation = 0
animator_r.duration = 888 animator_r.duration = control.duration
} }
} }
QtObject{ QtObject{
@ -48,7 +49,7 @@ ProgressBar{
from: 0 from: 0
to:360 to:360
loops: Animation.Infinite loops: Animation.Infinite
duration: 888 duration: control.duration
} }
Canvas { Canvas {
id:canvas id:canvas