summaryrefslogtreecommitdiffstats
path: root/application/pages/global/MinecraftPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/pages/global/MinecraftPage.cpp')
-rw-r--r--application/pages/global/MinecraftPage.cpp45
1 files changed, 23 insertions, 22 deletions
diff --git a/application/pages/global/MinecraftPage.cpp b/application/pages/global/MinecraftPage.cpp
index 4efc2fa0..5e0d9625 100644
--- a/application/pages/global/MinecraftPage.cpp
+++ b/application/pages/global/MinecraftPage.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2018 MultiMC Contributors
+/* Copyright 2013-2019 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
#include <QMessageBox>
#include <QDir>
+#include <QTabBar>
#include "settings/SettingsObject.h"
#include "MultiMC.h"
@@ -25,52 +26,52 @@
MinecraftPage::MinecraftPage(QWidget *parent) : QWidget(parent), ui(new Ui::MinecraftPage)
{
- ui->setupUi(this);
- ui->tabWidget->tabBar()->hide();
- loadSettings();
- updateCheckboxStuff();
+ ui->setupUi(this);
+ ui->tabWidget->tabBar()->hide();
+ loadSettings();
+ updateCheckboxStuff();
}
MinecraftPage::~MinecraftPage()
{
- delete ui;
+ delete ui;
}
bool MinecraftPage::apply()
{
- applySettings();
- return true;
+ applySettings();
+ return true;
}
void MinecraftPage::updateCheckboxStuff()
{
- ui->windowWidthSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked());
- ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked());
+ ui->windowWidthSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked());
+ ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked());
}
void MinecraftPage::on_maximizedCheckBox_clicked(bool checked)
{
- Q_UNUSED(checked);
- updateCheckboxStuff();
+ Q_UNUSED(checked);
+ updateCheckboxStuff();
}
void MinecraftPage::applySettings()
{
- auto s = MMC->settings();
+ auto s = MMC->settings();
- // Window Size
- s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
- s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value());
- s->set("MinecraftWinHeight", ui->windowHeightSpinBox->value());
+ // Window Size
+ s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
+ s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value());
+ s->set("MinecraftWinHeight", ui->windowHeightSpinBox->value());
}
void MinecraftPage::loadSettings()
{
- auto s = MMC->settings();
+ auto s = MMC->settings();
- // Window Size
- ui->maximizedCheckBox->setChecked(s->get("LaunchMaximized").toBool());
- ui->windowWidthSpinBox->setValue(s->get("MinecraftWinWidth").toInt());
- ui->windowHeightSpinBox->setValue(s->get("MinecraftWinHeight").toInt());
+ // Window Size
+ ui->maximizedCheckBox->setChecked(s->get("LaunchMaximized").toBool());
+ ui->windowWidthSpinBox->setValue(s->get("MinecraftWinWidth").toInt());
+ ui->windowHeightSpinBox->setValue(s->get("MinecraftWinHeight").toInt());
}