GH-1197 finish color stuff

This commit is contained in:
Petr Mrázek
2015-08-20 01:49:03 +02:00
parent 6858f1dd62
commit d0e88011dc
9 changed files with 175 additions and 88 deletions

View File

@ -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);