Theming: debugger

Theme the text colors of
- the debugger's log window
- the debugger's watch items

In particular, the watch items were hard to read (default color was
black, color for changed value was red).

For the dark theme, the default color for watch items is now white
(the text color), changed items appear red, and invalid items
appear grey.

Change-Id: I7f9534b054c44d635b106fa0e9ac70479c9fcac5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Thorben Kroeger
2015-03-19 20:44:18 +01:00
committed by hjk
parent 8b46f0d6ef
commit 797af15584
5 changed files with 53 additions and 13 deletions

View File

@@ -54,6 +54,7 @@
#include <utils/savedaction.h>
#include <utils/fancylineedit.h>
#include <utils/fileutils.h>
#include <utils/theme/theme.h>
namespace Debugger {
namespace Internal {
@@ -74,26 +75,28 @@ public:
private:
void highlightBlock(const QString &text)
{
using Utils::Theme;
QTextCharFormat format;
Theme *theme = Utils::creatorTheme();
switch (LogWindow::channelForChar(text.isEmpty() ? QChar() : text.at(0))) {
case LogInput:
format.setForeground(Qt::blue);
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogInput));
setFormat(1, text.size(), format);
break;
case LogStatus:
format.setForeground(Qt::darkGreen);
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogStatus));
setFormat(1, text.size(), format);
break;
case LogWarning:
format.setForeground(Qt::darkYellow);
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogWarning));
setFormat(1, text.size(), format);
break;
case LogError:
format.setForeground(Qt::red);
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogError));
setFormat(1, text.size(), format);
break;
case LogTime:
format.setForeground(Qt::darkRed);
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogTime));
setFormat(1, text.size(), format);
break;
default:
@@ -125,9 +128,11 @@ public:
private:
void highlightBlock(const QString &text)
{
using Utils::Theme;
Theme *theme = Utils::creatorTheme();
if (text.size() > 3 && text.at(2) == QLatin1Char(':')) {
QTextCharFormat format;
format.setForeground(Qt::darkRed);
format.setForeground(theme->color(Theme::Debugger_LogWindow_LogTime));
setFormat(1, text.size(), format);
}
}