diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-11-09 19:48:35 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-11-09 19:48:35 +0100 |
commit | 24a0635b62071aee56c090283b8c8527174be039 (patch) | |
tree | c6db5f75c70fd5d907fbe210d8d2b74a3c329666 /gui | |
parent | 2e9284951c7364dc766a406099ce3a779773abb1 (diff) | |
download | MultiMC-24a0635b62071aee56c090283b8c8527174be039.tar MultiMC-24a0635b62071aee56c090283b8c8527174be039.tar.gz MultiMC-24a0635b62071aee56c090283b8c8527174be039.tar.lz MultiMC-24a0635b62071aee56c090283b8c8527174be039.tar.xz MultiMC-24a0635b62071aee56c090283b8c8527174be039.zip |
Allow changing the console font family
Diffstat (limited to 'gui')
-rw-r--r-- | gui/pages/LogPage.cpp | 9 | ||||
-rw-r--r-- | gui/pages/global/MultiMCPage.cpp | 11 | ||||
-rw-r--r-- | gui/pages/global/MultiMCPage.ui | 32 |
3 files changed, 42 insertions, 10 deletions
diff --git a/gui/pages/LogPage.cpp b/gui/pages/LogPage.cpp index f16e3477..719eba03 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 <QIcon> #include <QScrollBar> #include <QShortcut> @@ -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 4c050059..9e0a0ed8 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 308d8842..81c21558 100644 --- a/gui/pages/global/MultiMCPage.ui +++ b/gui/pages/global/MultiMCPage.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>545</width> - <height>609</height> + <width>556</width> + <height>559</height> </rect> </property> <property name="sizePolicy"> @@ -42,7 +42,7 @@ <enum>QTabWidget::Rounded</enum> </property> <property name="currentIndex"> - <number>0</number> + <number>1</number> </property> <widget class="QWidget" name="featuresTab"> <attribute name="title"> @@ -280,7 +280,7 @@ <item> <widget class="QRadioButton" name="sortLastLaunchedBtn"> <property name="text"> - <string>By last launched</string> + <string>By &last launched</string> </property> <attribute name="buttonGroup"> <string notr="true">sortingModeGroup</string> @@ -290,7 +290,7 @@ <item> <widget class="QRadioButton" name="sortByNameBtn"> <property name="text"> - <string>By name</string> + <string>By &name</string> </property> <attribute name="buttonGroup"> <string notr="true">sortingModeGroup</string> @@ -370,6 +370,28 @@ </widget> </item> <item> + <widget class="QGroupBox" name="themeBox_2"> + <property name="title"> + <string>Console font</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QFontComboBox" name="consoleFont"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="fontFilters"> + <set>QFontComboBox::MonospacedFonts</set> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <spacer name="generalTabSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> |