1
0

revert: remove the ability that disable built-in close window animation

no need to preserve this option because frameless window and
close window animation will be fully removed in future.
This commit is contained in:
2026-07-02 20:32:30 +08:00
parent 457647c59f
commit 032752faf9
6 changed files with 11 additions and 43 deletions

View File

@@ -75,7 +75,11 @@ MainWindow::MainWindow(QWidget *parent)
m_exitAnimationGroup->addAnimation(m_fadeOutAnimation);
m_exitAnimationGroup->addAnimation(m_floatUpAnimation);
connect(m_exitAnimationGroup, &QParallelAnimationGroup::finished,
this, &MainWindow::doCloseWindow);
#ifdef Q_OS_MAC
this, &QWidget::hide);
#else
this, &QWidget::close);
#endif
GraphicsScene * scene = new GraphicsScene(this);
@@ -592,16 +596,12 @@ void MainWindow::centerWindow()
void MainWindow::closeWindow()
{
if (Settings::instance()->useBuiltInCloseAnimation()) {
QRect windowRect(this->geometry());
m_floatUpAnimation->setStartValue(windowRect);
m_floatUpAnimation->setEndValue(windowRect.adjusted(0, -80, 0, 0));
m_floatUpAnimation->setStartValue(QRect(this->geometry().x(), this->geometry().y(), this->geometry().width(), this->geometry().height()));
m_floatUpAnimation->setEndValue(QRect(this->geometry().x(), this->geometry().y()-80, this->geometry().width(), this->geometry().height()));
m_exitAnimationGroup->start();
} else {
doCloseWindow();
}
QRect windowRect(this->geometry());
m_floatUpAnimation->setStartValue(windowRect);
m_floatUpAnimation->setEndValue(windowRect.adjusted(0, -80, 0, 0));
m_floatUpAnimation->setStartValue(QRect(this->geometry().x(), this->geometry().y(), this->geometry().width(), this->geometry().height()));
m_floatUpAnimation->setEndValue(QRect(this->geometry().x(), this->geometry().y()-80, this->geometry().width(), this->geometry().height()));
m_exitAnimationGroup->start();
}
void MainWindow::updateWidgetsPosition()
@@ -925,15 +925,6 @@ void MainWindow::on_actionQuitApp_triggered()
quitAppAction(false);
}
void MainWindow::doCloseWindow()
{
#ifdef Q_OS_MAC
this->hide();
#else
this->close();
#endif
}
bool MainWindow::updateFileWatcher(const QString &basePath)
{
m_fileSystemWatcher->removePaths(m_fileSystemWatcher->files());