diff options
Diffstat (limited to 'application/pages/global')
-rw-r--r-- | application/pages/global/MultiMCPage.cpp | 9 | ||||
-rw-r--r-- | application/pages/global/MultiMCPage.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/application/pages/global/MultiMCPage.cpp b/application/pages/global/MultiMCPage.cpp index b5389e25..6a8730c7 100644 --- a/application/pages/global/MultiMCPage.cpp +++ b/application/pages/global/MultiMCPage.cpp @@ -40,6 +40,10 @@ enum InstSortMode MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCPage) { ui->setupUi(this); + auto origForeground = ui->fontPreview->palette().color(ui->fontPreview->foregroundRole()); + auto origBackground = ui->fontPreview->palette().color(ui->fontPreview->backgroundRole()); + m_colors.reset(new LogColorCache(origForeground, origBackground)); + ui->sortingModeGroup->setId(ui->sortByNameBtn, Sort_Name); ui->sortingModeGroup->setId(ui->sortLastLaunchedBtn, Sort_LastLaunch); @@ -424,7 +428,7 @@ void MultiMCPage::refreshFontPreview() defaultFormat->setFont(QFont(fontFamily, fontSize)); { QTextCharFormat format(*defaultFormat); - format.setForeground(QColor("red")); + format.setForeground(m_colors->getFront(MessageLevel::Error)); // append a paragraph/line auto workCursor = ui->fontPreview->textCursor(); workCursor.movePosition(QTextCursor::End); @@ -433,6 +437,7 @@ void MultiMCPage::refreshFontPreview() } { QTextCharFormat format(*defaultFormat); + format.setForeground(m_colors->getFront(MessageLevel::Message)); // append a paragraph/line auto workCursor = ui->fontPreview->textCursor(); workCursor.movePosition(QTextCursor::End); @@ -441,7 +446,7 @@ void MultiMCPage::refreshFontPreview() } { QTextCharFormat format(*defaultFormat); - format.setForeground(QColor("orange")); + format.setForeground(m_colors->getFront(MessageLevel::Warning)); // append a paragraph/line auto workCursor = ui->fontPreview->textCursor(); workCursor.movePosition(QTextCursor::End); diff --git a/application/pages/global/MultiMCPage.h b/application/pages/global/MultiMCPage.h index d90acc13..4ecc2d93 100644 --- a/application/pages/global/MultiMCPage.h +++ b/application/pages/global/MultiMCPage.h @@ -21,6 +21,7 @@ #include "java/JavaChecker.h" #include "pages/BasePage.h" #include <MultiMC.h> +#include "ColorCache.h" class QTextCharFormat; class SettingsObject; @@ -97,4 +98,6 @@ private: // default format for the font preview... QTextCharFormat *defaultFormat; + + std::unique_ptr<LogColorCache> m_colors; }; |