Skip to content

Commit

Permalink
Merge pull request #574 from lucky9loogn/fix
Browse files Browse the repository at this point in the history
尝试修复 FluChart 和 FluProgressBar 的一些问题
  • Loading branch information
zhuzichu520 authored Nov 22, 2024
2 parents 0171c36 + 4895269 commit 8ab0cde
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/Qt5/imports/FluentUI/Controls/FluChart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Canvas {
function animateToNewData()
{
chartAnimationProgress = 0.1;
d.jsChart?.update();
if (d.jsChart) {
d.jsChart.update();
}
chartAnimator.restart();
}
QtObject{
Expand Down
12 changes: 7 additions & 5 deletions src/Qt5/imports/FluentUI/Controls/FluProgressBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ ProgressBar{
height: parent.height
radius: d._radius
color: control.color
PropertyAnimation on x {
id:animator_x
SequentialAnimation on x {
id: animator_x
running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite
duration: control.duration
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
duration: control.duration
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Qt6/imports/FluentUI/Controls/FluChart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Canvas {
function animateToNewData()
{
chartAnimationProgress = 0.1;
d.jsChart?.update();
if (d.jsChart) {
d.jsChart.update();
}
chartAnimator.restart();
}
QtObject{
Expand Down
12 changes: 7 additions & 5 deletions src/Qt6/imports/FluentUI/Controls/FluProgressBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ ProgressBar{
height: parent.height
radius: d._radius
color: control.color
PropertyAnimation on x {
id:animator_x
SequentialAnimation on x {
id: animator_x
running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite
duration: control.duration
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
duration: control.duration
}
}
}
}
Expand Down

0 comments on commit 8ab0cde

Please sign in to comment.