aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/WaitingDialog.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-02 19:49:32 +0000
committerSaturneric <[email protected]>2021-12-02 19:49:32 +0000
commit6027b6098ac4e8dfdc75fc08e3f5d3b3b2997ef3 (patch)
treea399d2c830dadf6750ddb44a69309b443255846c /src/ui/WaitingDialog.cpp
parentModified & Improve (diff)
downloadGpgFrontend-6027b6098ac4e8dfdc75fc08e3f5d3b3b2997ef3.tar.gz
GpgFrontend-6027b6098ac4e8dfdc75fc08e3f5d3b3b2997ef3.zip
Fix and Modified.
1. Fix known issues. 2. Modified Settings. 3. Modified parts of modules.
Diffstat (limited to 'src/ui/WaitingDialog.cpp')
-rw-r--r--src/ui/WaitingDialog.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ui/WaitingDialog.cpp b/src/ui/WaitingDialog.cpp
index d9aab23b..a83845ab 100644
--- a/src/ui/WaitingDialog.cpp
+++ b/src/ui/WaitingDialog.cpp
@@ -40,10 +40,33 @@ WaitingDialog::WaitingDialog(const QString& title, QWidget* parent)
this->setLayout(layout);
this->setModal(true);
+ this->raise();
this->setWindowFlags(Qt::Window | Qt::WindowTitleHint |
Qt::CustomizeWindowHint);
this->setWindowTitle(title);
+ this->setAttribute(Qt::WA_DeleteOnClose);
this->setFixedSize(240, 42);
+
+ if (parentWidget() == nullptr) {
+ auto* screen = QGuiApplication::primaryScreen();
+ QRect geo = screen->availableGeometry();
+ int screen_width = geo.width();
+ int screen_height = geo.height();
+
+ LOG(INFO) << "primary screen available geometry" << screen_width
+ << screen_height;
+
+ auto pos = QPoint((screen_width - QWidget::width()) / 2,
+ (screen_height - QWidget::height()) / 2);
+ this->move(pos);
+
+ } else {
+ auto pos = QPoint(parent->x() + (parent->width() - QWidget::width()) / 2,
+ parent->y() + (parent->height() - QWidget::height()) / 2);
+ LOG(INFO) << "pos" << pos.x() << pos.y();
+ this->move(pos);
+ }
+
this->show();
}