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 | |
parent | b4b6091372310f4a811180cffde3ea5611881e6c (diff) | |
download | PrismLauncher-f8df07c3272c0e02f31f46fda8a429292c7a446a.tar.gz PrismLauncher-f8df07c3272c0e02f31f46fda8a429292c7a446a.tar.bz2 PrismLauncher-f8df07c3272c0e02f31f46fda8a429292c7a446a.zip |
Small tweaks to make things better.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ConsoleWindow.cpp | 18 | ||||
-rw-r--r-- | gui/ConsoleWindow.h | 2 |
2 files changed, 11 insertions, 9 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) diff --git a/gui/ConsoleWindow.h b/gui/ConsoleWindow.h index 9291320e..7fe90c52 100644 --- a/gui/ConsoleWindow.h +++ b/gui/ConsoleWindow.h @@ -47,7 +47,7 @@ private: * this will only insert a single paragraph. * \n are ignored. a real \n is always appended. */ - void writeColor(QString data, const char *color = nullptr); + void writeColor(QString text, const char *color, const char *background); signals: void isClosing(); |