Fix window is not in full screen mode after closing the app (#202)

This commit is contained in:
p-state 2020-03-12 20:38:08 +03:00 committed by GitHub
parent a3425115b8
commit ac1f24ec77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -885,8 +885,8 @@ void UEFITool::contextMenuEvent(QContextMenuEvent* event)
void UEFITool::readSettings() void UEFITool::readSettings()
{ {
QSettings settings(this); QSettings settings(this);
resize(settings.value("mainWindow/size", QSize(800, 600)).toSize()); restoreGeometry(settings.value("mainWindow/geometry").toByteArray());
move(settings.value("mainWindow/position", QPoint(0, 0)).toPoint()); restoreState(settings.value("mainWindow/windowState").toByteArray());
QList<int> horList, vertList; QList<int> horList, vertList;
horList.append(settings.value("mainWindow/treeWidth", 600).toInt()); horList.append(settings.value("mainWindow/treeWidth", 600).toInt());
horList.append(settings.value("mainWindow/infoWidth", 180).toInt()); horList.append(settings.value("mainWindow/infoWidth", 180).toInt());
@ -932,8 +932,8 @@ void UEFITool::readSettings()
void UEFITool::writeSettings() void UEFITool::writeSettings()
{ {
QSettings settings(this); QSettings settings(this);
settings.setValue("mainWindow/size", size()); settings.setValue("mainWindow/geometry", saveGeometry());
settings.setValue("mainWindow/position", pos()); settings.setValue("mainWindow/windowState", saveState());
settings.setValue("mainWindow/treeWidth", ui->structureGroupBox->width()); settings.setValue("mainWindow/treeWidth", ui->structureGroupBox->width());
settings.setValue("mainWindow/infoWidth", ui->infoGroupBox->width()); settings.setValue("mainWindow/infoWidth", ui->infoGroupBox->width());
settings.setValue("mainWindow/treeHeight", ui->structureGroupBox->height()); settings.setValue("mainWindow/treeHeight", ui->structureGroupBox->height());