mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Show dialog centered
This commit is contained in:
parent
8e9cdaac5a
commit
c540c3bfdf
2 changed files with 8 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <QFile>
|
||||
#include <QDebug>
|
||||
#include <QProcess>
|
||||
#include <QScreen>
|
||||
|
||||
generalDialog::generalDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
@ -49,6 +50,12 @@ generalDialog::generalDialog(QWidget *parent) :
|
|||
// We shouldn't be there ;)
|
||||
;
|
||||
}
|
||||
|
||||
// Centering dialog
|
||||
QRect screenGeometry = QGuiApplication::screens()[0]->geometry();
|
||||
int x = (screenGeometry.width() - this->width()) / 2;
|
||||
int y = (screenGeometry.height() - this->height()) / 2;
|
||||
this->move(x, y);
|
||||
}
|
||||
|
||||
generalDialog::~generalDialog()
|
||||
|
|
|
@ -317,7 +317,7 @@ void settings::on_usbmsBtn_clicked()
|
|||
usbms_t->start();
|
||||
}
|
||||
|
||||
// Now I know that QStackedWidget exists... ;p
|
||||
// Now I know that QStackedWidgets exist... ;p
|
||||
|
||||
void settings::on_previousBtn_clicked()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue