Skip to content

Commit 917bd82

Browse files
committed
fix: adjust animation start and end values for load slider in DLineEditEx
Updated the animation parameters to improve the visual effect of the load slider by changing the start and end values. This enhances the user experience during loading animations. Log: as title Pms: BUG-311099
1 parent 6e0f29b commit 917bd82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/widgets/dlineeditex.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ void DLineEditEx::startAnimation()
9999
}
100100
m_loadSlider->show();
101101
m_loadSlider->resize(40, height());
102-
m_animation->setStartValue(QPoint(0 - 40, 0));
103-
m_animation->setEndValue(QPoint(width(), 0));
102+
// 动画块距离右侧的距离10px结束
103+
int endX = (width() - m_loadSlider->width() - 10) > 0 ? width() - m_loadSlider->width() - 10 : width();
104+
m_animation->setStartValue(QPoint(0 , 0));
105+
m_animation->setEndValue(QPoint(endX, 0));
104106
m_animation->start();
105107
}
106108

0 commit comments

Comments
 (0)