summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-02-14 21:37:32 +0100
committerPetr Mrázek <peterix@gmail.com>2018-02-14 21:37:32 +0100
commit2ea22d407d6b9faabe610b58c87c3b96407f8b5d (patch)
treed8f74e9fbf69257049cd3ddef5118342cee8a63f /application
parent22b32fce126a0de8d002f67048792a89513f4e8a (diff)
downloadMultiMC-2ea22d407d6b9faabe610b58c87c3b96407f8b5d.tar
MultiMC-2ea22d407d6b9faabe610b58c87c3b96407f8b5d.tar.gz
MultiMC-2ea22d407d6b9faabe610b58c87c3b96407f8b5d.tar.lz
MultiMC-2ea22d407d6b9faabe610b58c87c3b96407f8b5d.tar.xz
MultiMC-2ea22d407d6b9faabe610b58c87c3b96407f8b5d.zip
GH-604 use the same font for 'Other Logs' as for the main log
This doesn't mean coloring, just the same font and font size.
Diffstat (limited to 'application')
-rw-r--r--application/dialogs/NotificationDialog.cpp1
-rw-r--r--application/pages/OtherLogsPage.cpp19
2 files changed, 17 insertions, 3 deletions
diff --git a/application/dialogs/NotificationDialog.cpp b/application/dialogs/NotificationDialog.cpp
index 8f920371..d61bf6bd 100644
--- a/application/dialogs/NotificationDialog.cpp
+++ b/application/dialogs/NotificationDialog.cpp
@@ -18,6 +18,7 @@ NotificationDialog::NotificationDialog(const NotificationChecker::NotificationEn
case NotificationChecker::NotificationEntry::Warning:
icon = QStyle::SP_MessageBoxWarning;
break;
+ default:
case NotificationChecker::NotificationEntry::Information:
icon = QStyle::SP_MessageBoxInformation;
break;
diff --git a/application/pages/OtherLogsPage.cpp b/application/pages/OtherLogsPage.cpp
index 31b58a24..2141e0cc 100644
--- a/application/pages/OtherLogsPage.cpp
+++ b/application/pages/OtherLogsPage.cpp
@@ -127,9 +127,22 @@ void OtherLogsPage::on_btnReload_clicked()
}
else
{
+ auto setPlainText = [&](const QString & text)
+ {
+ QString fontFamily = MMC->settings()->get("ConsoleFont").toString();
+ bool conversionOk = false;
+ int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk);
+ if(!conversionOk)
+ {
+ fontSize = 11;
+ }
+ QTextDocument *doc = ui->text->document();
+ doc->setDefaultFont(QFont(fontFamily, fontSize));
+ ui->text->setPlainText(text);
+ };
auto showTooBig = [&]()
{
- ui->text->setPlainText(
+ setPlainText(
tr("The file (%1) is too big. You may want to open it in a viewer optimized "
"for large files.").arg(file.fileName()));
};
@@ -144,7 +157,7 @@ void OtherLogsPage::on_btnReload_clicked()
QByteArray temp;
if(!GZip::unzip(file.readAll(), temp))
{
- ui->text->setPlainText(
+ setPlainText(
tr("The file (%1) is not readable.").arg(file.fileName()));
return;
}
@@ -159,7 +172,7 @@ void OtherLogsPage::on_btnReload_clicked()
showTooBig();
return;
}
- ui->text->setPlainText(content);
+ setPlainText(content);
}
}