mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
Show window in center of screen on first launch
This commit is contained in:
parent
e11f1806b6
commit
f688056f9d
1 changed files with 7 additions and 0 deletions
|
@ -55,6 +55,7 @@
|
|||
#include <QMimeData>
|
||||
#include <QStyle>
|
||||
#include <QSettings>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -480,6 +481,12 @@ void BitcoinGUI::restoreWindowGeometry()
|
|||
QSettings settings;
|
||||
QPoint pos = settings.value("nWindowPos").toPoint();
|
||||
QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize();
|
||||
if (!pos.x() && !pos.y())
|
||||
{
|
||||
QRect screen = qApp->desktop()->screenGeometry();
|
||||
pos.setX((screen.width()-size.width())/2);
|
||||
pos.setY((screen.height()-size.height())/2);
|
||||
}
|
||||
resize(size);
|
||||
move(pos);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue