Skip to content

Commit

Permalink
fix: move burn confirm dialog center.
Browse files Browse the repository at this point in the history
show dialogs in cursor screen's center.

Log: as above.
  • Loading branch information
itsXuSt authored and deepin-bot[bot] committed Dec 31, 2024
1 parent 0d11c71 commit 6622166
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/plugins/common/dfmplugin-burn/utils/burnjobmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <dfm-base/file/local/localfilehandler.h>
#include <dfm-base/utils/dialogmanager.h>
#include <dfm-base/utils/windowutils.h>
#include <dfm-base/base/schemefactory.h>
#include <dfm-base/base/device/devicemanager.h>
#include <dfm-base/base/device/deviceproxymanager.h>
Expand All @@ -20,6 +21,7 @@
#include <QVBoxLayout>
#include <QTextEdit>
#include <QLabel>
#include <QScreen>

DFMBASE_USE_NAMESPACE

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 6622166

Please sign in to comment.