Allow changing the console font family
This commit is contained in:
parent
2e9284951c
commit
24a0635b62
@ -379,6 +379,15 @@ void MultiMC::initGlobalSettings()
|
|||||||
// Remembered state
|
// Remembered state
|
||||||
m_settings->registerSetting("LastUsedGroupForNewInstance", QString());
|
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
|
// FTB
|
||||||
m_settings->registerSetting("TrackFTBInstances", false);
|
m_settings->registerSetting("TrackFTBInstances", false);
|
||||||
QString ftbDataDefault;
|
QString ftbDataDefault;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "LogPage.h"
|
#include "LogPage.h"
|
||||||
#include "ui_LogPage.h"
|
#include "ui_LogPage.h"
|
||||||
|
|
||||||
|
#include "MultiMC.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
@ -18,11 +20,8 @@ LogPage::LogPage(MinecraftProcess *proc, QWidget *parent)
|
|||||||
|
|
||||||
// create the format and set its font
|
// create the format and set its font
|
||||||
defaultFormat = new QTextCharFormat(ui->text->currentCharFormat());
|
defaultFormat = new QTextCharFormat(ui->text->currentCharFormat());
|
||||||
QFont font;
|
QString fontFamily = MMC->settings()->get("ConsoleFont").toString();
|
||||||
font.setFamily("Courier");
|
defaultFormat->setFont(QFont(fontFamily));
|
||||||
font.setStyleHint(QFont::Monospace);
|
|
||||||
font.setFixedPitch(true);
|
|
||||||
defaultFormat->setFont(font);
|
|
||||||
|
|
||||||
auto findShortcut = new QShortcut(QKeySequence(QKeySequence::Find), this);
|
auto findShortcut = new QShortcut(QKeySequence(QKeySequence::Find), this);
|
||||||
connect(findShortcut, SIGNAL(activated()), SLOT(findActivated()));
|
connect(findShortcut, SIGNAL(activated()), SLOT(findActivated()));
|
||||||
|
@ -293,6 +293,11 @@ void MultiMCPage::applySettings()
|
|||||||
s->set("IconTheme", "multimc");
|
s->set("IconTheme", "multimc");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Console settings
|
||||||
|
QString consoleFontFamily = ui->consoleFont->currentFont().family();
|
||||||
|
s->set("ConsoleFont", consoleFontFamily);
|
||||||
|
|
||||||
// FTB
|
// FTB
|
||||||
s->set("TrackFTBInstances", ui->trackFtbBox->isChecked());
|
s->set("TrackFTBInstances", ui->trackFtbBox->isChecked());
|
||||||
s->set("FTBLauncherRoot", ui->ftbLauncherBox->text());
|
s->set("FTBLauncherRoot", ui->ftbLauncherBox->text());
|
||||||
@ -365,6 +370,12 @@ void MultiMCPage::loadSettings()
|
|||||||
{
|
{
|
||||||
ui->themeComboBox->setCurrentIndex(0);
|
ui->themeComboBox->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Console settings
|
||||||
|
QString fontFamily = MMC->settings()->get("ConsoleFont").toString();
|
||||||
|
QFont consoleFont(fontFamily);
|
||||||
|
ui->consoleFont->setCurrentFont(consoleFont);
|
||||||
|
|
||||||
// FTB
|
// FTB
|
||||||
ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool());
|
ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool());
|
||||||
ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString());
|
ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString());
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>545</width>
|
<width>556</width>
|
||||||
<height>609</height>
|
<height>559</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -42,7 +42,7 @@
|
|||||||
<enum>QTabWidget::Rounded</enum>
|
<enum>QTabWidget::Rounded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="featuresTab">
|
<widget class="QWidget" name="featuresTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -280,7 +280,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="sortLastLaunchedBtn">
|
<widget class="QRadioButton" name="sortLastLaunchedBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>By last launched</string>
|
<string>By &last launched</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="buttonGroup">
|
<attribute name="buttonGroup">
|
||||||
<string notr="true">sortingModeGroup</string>
|
<string notr="true">sortingModeGroup</string>
|
||||||
@ -290,7 +290,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="sortByNameBtn">
|
<widget class="QRadioButton" name="sortByNameBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>By name</string>
|
<string>By &name</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="buttonGroup">
|
<attribute name="buttonGroup">
|
||||||
<string notr="true">sortingModeGroup</string>
|
<string notr="true">sortingModeGroup</string>
|
||||||
@ -369,6 +369,28 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<spacer name="generalTabSpacer">
|
<spacer name="generalTabSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user