Browse Source

Show window in center of screen on first launch

miguelfreitas
Roman Mindalev 12 years ago
parent
commit
f688056f9d
  1. 7
      src/qt/bitcoingui.cpp

7
src/qt/bitcoingui.cpp

@ -55,6 +55,7 @@
#include <QMimeData> #include <QMimeData>
#include <QStyle> #include <QStyle>
#include <QSettings> #include <QSettings>
#include <QDesktopWidget>
#include <iostream> #include <iostream>
@ -480,6 +481,12 @@ void BitcoinGUI::restoreWindowGeometry()
QSettings settings; QSettings settings;
QPoint pos = settings.value("nWindowPos").toPoint(); QPoint pos = settings.value("nWindowPos").toPoint();
QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize(); 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); resize(size);
move(pos); move(pos);
} }

Loading…
Cancel
Save