From 604f393cae876f85abae7210c3bfbc1fe6ba8d81 Mon Sep 17 00:00:00 2001 From: xust Date: Tue, 31 Dec 2024 15:09:33 +0800 Subject: [PATCH] fix: move burn confirm dialog center. show dialogs in cursor screen's center. Log: as above. --- .../common/dfmplugin-burn/utils/burnjobmanager.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/common/dfmplugin-burn/utils/burnjobmanager.cpp b/src/plugins/common/dfmplugin-burn/utils/burnjobmanager.cpp index d4f7700277..603c2064e7 100644 --- a/src/plugins/common/dfmplugin-burn/utils/burnjobmanager.cpp +++ b/src/plugins/common/dfmplugin-burn/utils/burnjobmanager.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include DFMBASE_USE_NAMESPACE @@ -223,7 +225,8 @@ void BurnJobManager::showOpticalJobCompletionDialog(const QString &msg, const QS d.addButton(tr("OK", "button"), true, DDialog::ButtonRecommend); d.setDefaultButton(0); d.getButton(0)->setFocus(); - d.moveToCenter(); + d.move(WindowUtils::cursorScreen()->geometry().center() + - QPoint(d.width() / 2, d.height() / 2)); d.exec(); } @@ -278,7 +281,8 @@ void BurnJobManager::showOpticalJobFailureDialog(int type, const QString &err, c d.addButton(tr("Confirm", "button"), true, DDialog::ButtonRecommend); d.setDefaultButton(1); d.getButton(1)->setFocus(); - d.moveToCenter(); + d.move(WindowUtils::cursorScreen()->geometry().center() + - QPoint(d.width() / 2, d.height() / 2)); d.exec(); } @@ -322,7 +326,8 @@ void BurnJobManager::showOpticalDumpISOSuccessDialog(const QUrl &imageUrl) iconLabel->setPixmap(QIcon::fromTheme("dialog-ok").pixmap(96, 96)); mainLayout->addWidget(iconLabel, 0, Qt::AlignTop | Qt::AlignCenter); - d.moveToCenter(); + d.move(WindowUtils::cursorScreen()->geometry().center() + - QPoint(d.width() / 2, d.height() / 2)); d.exec(); } @@ -356,7 +361,8 @@ void BurnJobManager::showOpticalDumpISOFailedDialog() iconLabel->setPixmap(QIcon::fromTheme("dialog-error").pixmap(96, 96)); mainLayout->addWidget(iconLabel, 0, Qt::AlignTop | Qt::AlignCenter); - d.moveToCenter(); + d.move(WindowUtils::cursorScreen()->geometry().center() + - QPoint(d.width() / 2, d.height() / 2)); d.exec(); }