diff --git a/MultiMC.cpp b/MultiMC.cpp index a75ccb135..149bb9397 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -379,6 +379,15 @@ void MultiMC::initGlobalSettings() // Remembered state m_settings->registerSetting("LastUsedGroupForNewInstance", QString()); + // Console settings + QFont consoleFont; + consoleFont.setFamily(""); + consoleFont.setStyleHint(QFont::Monospace); + consoleFont.setFixedPitch(true); + QFontInfo consoleFontInfo(consoleFont); + QString consoleFontFamily = consoleFontInfo.family(); + m_settings->registerSetting("ConsoleFont", consoleFontFamily); + // FTB m_settings->registerSetting("TrackFTBInstances", false); QString ftbDataDefault; diff --git a/gui/pages/LogPage.cpp b/gui/pages/LogPage.cpp index f16e3477f..719eba037 100644 --- a/gui/pages/LogPage.cpp +++ b/gui/pages/LogPage.cpp @@ -1,6 +1,8 @@ #include "LogPage.h" #include "ui_LogPage.h" +#include "MultiMC.h" + #include #include #include @@ -18,11 +20,8 @@ LogPage::LogPage(MinecraftProcess *proc, QWidget *parent) // create the format and set its font defaultFormat = new QTextCharFormat(ui->text->currentCharFormat()); - QFont font; - font.setFamily("Courier"); - font.setStyleHint(QFont::Monospace); - font.setFixedPitch(true); - defaultFormat->setFont(font); + QString fontFamily = MMC->settings()->get("ConsoleFont").toString(); + defaultFormat->setFont(QFont(fontFamily)); auto findShortcut = new QShortcut(QKeySequence(QKeySequence::Find), this); connect(findShortcut, SIGNAL(activated()), SLOT(findActivated())); diff --git a/gui/pages/global/MultiMCPage.cpp b/gui/pages/global/MultiMCPage.cpp index 4c050059b..9e0a0ed89 100644 --- a/gui/pages/global/MultiMCPage.cpp +++ b/gui/pages/global/MultiMCPage.cpp @@ -293,6 +293,11 @@ void MultiMCPage::applySettings() s->set("IconTheme", "multimc"); break; } + + // Console settings + QString consoleFontFamily = ui->consoleFont->currentFont().family(); + s->set("ConsoleFont", consoleFontFamily); + // FTB s->set("TrackFTBInstances", ui->trackFtbBox->isChecked()); s->set("FTBLauncherRoot", ui->ftbLauncherBox->text()); @@ -365,6 +370,12 @@ void MultiMCPage::loadSettings() { ui->themeComboBox->setCurrentIndex(0); } + + // Console settings + QString fontFamily = MMC->settings()->get("ConsoleFont").toString(); + QFont consoleFont(fontFamily); + ui->consoleFont->setCurrentFont(consoleFont); + // FTB ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool()); ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString()); diff --git a/gui/pages/global/MultiMCPage.ui b/gui/pages/global/MultiMCPage.ui index 308d88423..81c215582 100644 --- a/gui/pages/global/MultiMCPage.ui +++ b/gui/pages/global/MultiMCPage.ui @@ -6,8 +6,8 @@ 0 0 - 545 - 609 + 556 + 559 @@ -42,7 +42,7 @@ QTabWidget::Rounded - 0 + 1 @@ -280,7 +280,7 @@ - By last launched + By &last launched sortingModeGroup @@ -290,7 +290,7 @@ - By name + By &name sortingModeGroup @@ -369,6 +369,28 @@ + + + + Console font + + + + + + + 0 + 0 + + + + QFontComboBox::MonospacedFonts + + + + + +