diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-02-06 09:32:44 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-02-06 09:32:44 +0100 |
commit | f8df07c3272c0e02f31f46fda8a429292c7a446a (patch) | |
tree | 31af739dd416f521787ed970af05fb1de8b01222 /gui/ConsoleWindow.cpp | |
parent | b4b6091372310f4a811180cffde3ea5611881e6c (diff) | |
download | MultiMC-f8df07c3272c0e02f31f46fda8a429292c7a446a.tar MultiMC-f8df07c3272c0e02f31f46fda8a429292c7a446a.tar.gz MultiMC-f8df07c3272c0e02f31f46fda8a429292c7a446a.tar.lz MultiMC-f8df07c3272c0e02f31f46fda8a429292c7a446a.tar.xz MultiMC-f8df07c3272c0e02f31f46fda8a429292c7a446a.zip |
Small tweaks to make things better.
Diffstat (limited to 'gui/ConsoleWindow.cpp')
-rw-r--r-- | gui/ConsoleWindow.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index dc36a8ff..ccc037f2 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -84,7 +84,7 @@ void ConsoleWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) } } -void ConsoleWindow::writeColor(QString text, const char *color) +void ConsoleWindow::writeColor(QString text, const char *color, const char * background) { // append a paragraph QString newtext; @@ -92,6 +92,8 @@ void ConsoleWindow::writeColor(QString text, const char *color) { if (color) newtext += QString("color:") + color + ";"; + if (background) + newtext += QString("background-color:") + background + ";"; newtext += "font-family: monospace;"; } newtext += "\">"; @@ -127,26 +129,26 @@ void ConsoleWindow::write(QString data, MessageLevel::Enum mode) QListIterator<QString> iter(paragraphs); if (mode == MessageLevel::MultiMC) while (iter.hasNext()) - writeColor(iter.next(), "blue"); + writeColor(iter.next(), "blue", 0); else if (mode == MessageLevel::Error) while (iter.hasNext()) - writeColor(iter.next(), "red"); + writeColor(iter.next(), "red", 0); else if (mode == MessageLevel::Warning) while (iter.hasNext()) - writeColor(iter.next(), "orange"); + writeColor(iter.next(), "orange", 0); else if (mode == MessageLevel::Fatal) while (iter.hasNext()) - writeColor(iter.next(), "pink"); + writeColor(iter.next(), "red", "black"); else if (mode == MessageLevel::Debug) while (iter.hasNext()) - writeColor(iter.next(), "green"); + writeColor(iter.next(), "green", 0); else if (mode == MessageLevel::PrePost) while (iter.hasNext()) - writeColor(iter.next(), "grey"); + writeColor(iter.next(), "grey", 0); // TODO: implement other MessageLevels else while (iter.hasNext()) - writeColor(iter.next()); + writeColor(iter.next(), 0, 0); if(isVisible()) { if (m_scroll_active) |