Merge pull request #749 from PhenomRetroShare/Fix_WindowsHeightAtFirstStart

Fix windows height at first start.
This commit is contained in:
csoler 2017-03-25 19:26:12 +01:00 committed by GitHub
commit ccb632a442

View File

@ -76,11 +76,20 @@ RWindow::restoreWindowState()
m_bSaveStateOnClose = true; // now we save the window state on close
#if QT_VERSION >= 0x040200
QByteArray geometry = getSetting("Geometry", QByteArray()).toByteArray();
if (geometry.isEmpty())
QByteArray geo = getSetting("Geometry", QByteArray()).toByteArray();
if (geo.isEmpty())
{
adjustSize();
QRect rect = geometry();
int h = fontMetrics().height()*40;
if (rect.height()<h)
{
rect.setHeight(h);
setGeometry(rect);
}
}
else
restoreGeometry(geometry);
restoreGeometry(geo);
#else
QRect screen = QDesktopWidget().availableGeometry();