Fix bug solve the problem of anti clockwise rotation of animation icon

This commit is contained in:
chenlelin 2021-02-23 19:27:25 +08:00
parent fe786325b0
commit 25e5185b30
4 changed files with 16 additions and 16 deletions

View File

@ -50,10 +50,10 @@ void LoadingDiv::switchAnimStep()
loadingGif->setProperty("useIconHighlightEffect", true);
loadingGif->setProperty("iconHighlightEffectMode", true);
this->currentPage --;
this->currentPage ++;
if (this->currentPage < 1) {
this->currentPage = 12; //循环播放
if (this->currentPage > 12) {
this->currentPage = 1; //循环播放
}
this->countCurrentTime += FRAMESPEED;
@ -65,7 +65,7 @@ void LoadingDiv::switchAnimStep()
//开始播放动画
void LoadingDiv::startLoading()
{
this->currentPage = 12;
this->currentPage = 1;
this->countCurrentTime = 0;
this->switchTimer->start(FRAMESPEED);
this->show();

View File

@ -609,11 +609,11 @@ void MainWindow::createTrayIcon()
void MainWindow::iconStep()
{
if (currentIconIndex < 0) {
currentIconIndex = 11;
if (currentIconIndex > 11) {
currentIconIndex = 0;
}
setTrayIcon(loadIcons.at(currentIconIndex));
currentIconIndex --;
currentIconIndex ++;
}
void MainWindow::setTrayIcon(QIcon icon)
@ -624,7 +624,7 @@ void MainWindow::setTrayIcon(QIcon icon)
void MainWindow::setTrayLoading(bool isLoading)
{
if (isLoading) {
currentIconIndex = 11;
currentIconIndex = 0;
iconTimer->start(60);
} else {
iconTimer->stop();

View File

@ -900,9 +900,9 @@ void OneConnForm::waitAnimStep()
qpmQss.append(".png');}");
ui->lbWaitingIcon->setStyleSheet(qpmQss);
this->waitPage --;
if (this->waitPage < 1) {
this->waitPage = TOTAL_PAGE; //循环播放8张图片
this->waitPage ++;
if (this->waitPage > TOTAL_PAGE) {
this->waitPage = 1; //循环播放8张图片
}
this->countCurrentTime += FRAME_SPEED;
@ -932,7 +932,7 @@ void OneConnForm::startWaiting(bool isToConnect)
ui->lbWaiting->setStyleSheet("QLabel{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);}");
}
this->countCurrentTime = 0;
this->waitPage = TOTAL_PAGE; //总共有8张图片
this->waitPage = 1; //总共有8张图片
this->waitTimer->start(FRAME_SPEED);
ui->lbWaiting->show();
ui->lbWaitingIcon->show();

View File

@ -454,9 +454,9 @@ void OneLancForm::waitAnimStep()
qpmQss.append(".png');}");
ui->lbWaitingIcon->setStyleSheet(qpmQss);
this->waitPage --;
if (this->waitPage < 1) {
this->waitPage = TOTAL_PAGE; //循环播放8张图片
this->waitPage ++;
if (this->waitPage > TOTAL_PAGE) {
this->waitPage = 1; //循环播放8张图片
}
this->countCurrentTime += FRAME_SPEED;
@ -485,7 +485,7 @@ void OneLancForm::startWaiting(bool isToConnect)
ui->lbWaiting->setStyleSheet("QLabel{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);}");
}
this->countCurrentTime = 0;
this->waitPage = TOTAL_PAGE; //总共有8张图片
this->waitPage = 1; //总共有8张图片
this->waitTimer->start(FRAME_SPEED);
ui->lbWaiting->show();
ui->lbWaitingIcon->show();