Commit 797af155 authored by Thorben Kroeger's avatar Thorben Kroeger Committed by hjk

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's avatarOrgad Shaneh <orgads@gmail.com>
parent 8b46f0d6
......@@ -91,6 +91,16 @@ CompileOutput_ErrorOutput=ffff6c6c
CompileOutput_MessageOutput=ff008787
CompileOutput_ErrorMessageOutput=ffff6c6c
Debugger_LogWindow_LogInput=ff00acac
Debugger_LogWindow_LogStatus=ff00875a
Debugger_LogWindow_LogWarning=fff3c300
Debugger_LogWindow_LogError=ffff6c6c
Debugger_LogWindow_LogTime=ffbf0303
Debugger_WatchItem_ValueNormal=text
Debugger_WatchItem_ValueInvalid=textDisabled
Debugger_WatchItem_ValueChanged=ffbf0303
Welcome_BackgroundColorNormal=normalBackground
Welcome_Button_BorderColorNormal=0
Welcome_Button_BorderColorPressed=0
......
......@@ -85,6 +85,16 @@ CompileOutput_ErrorOutput=ffaa0000
CompileOutput_MessageOutput=ff0000aa
CompileOutput_ErrorMessageOutput=ffaa0000
Debugger_LogWindow_LogInput=ff0000ff
Debugger_LogWindow_LogStatus=ff008000
Debugger_LogWindow_LogWarning=ff808000
Debugger_LogWindow_LogError=ffff0000
Debugger_LogWindow_LogTime=ff800000
Debugger_WatchItem_ValueNormal=ff000000
Debugger_WatchItem_ValueInvalid=ff8c8c8c
Debugger_WatchItem_ValueChanged=ffc80000
Welcome_BackgroundColorNormal=ffffffff
Welcome_Button_BorderColorNormal=ff737373
Welcome_Button_BorderColorPressed=ff333333
......
......@@ -139,6 +139,20 @@ public:
CompileOutput_MessageOutput,
CompileOutput_ErrorMessageOutput,
/* Debugger Log Window */
Debugger_LogWindow_LogInput,
Debugger_LogWindow_LogStatus,
Debugger_LogWindow_LogWarning,
Debugger_LogWindow_LogError,
Debugger_LogWindow_LogTime,
/* Debugger Watch Item */
Debugger_WatchItem_ValueNormal,
Debugger_WatchItem_ValueInvalid,
Debugger_WatchItem_ValueChanged,
/* Welcome Plugin */
Welcome_TextColorNormal,
......
......@@ -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);
}
}
......
......@@ -49,6 +49,7 @@
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
#include <utils/checkablemessagebox.h>
#include <utils/theme/theme.h>
#include <QDebug>
#include <QFile>
......@@ -712,19 +713,19 @@ QString WatchItem::displayType() const
QColor WatchItem::valueColor() const
{
static const QColor red(200, 0, 0);
static const QColor gray(140, 140, 140);
using Utils::Theme;
Theme *theme = Utils::creatorTheme();
if (watchModel()) {
if (!valueEnabled)
return gray;
return theme->color(Theme::Debugger_WatchItem_ValueInvalid);
if (!watchModel()->m_contentsValid && !isInspect())
return gray;
return theme->color(Theme::Debugger_WatchItem_ValueInvalid);
if (value.isEmpty()) // This might still show 0x...
return gray;
return theme->color(Theme::Debugger_WatchItem_ValueInvalid);
if (value != watchModel()->m_valueCache.value(iname))
return red;
return theme->color(Theme::Debugger_WatchItem_ValueChanged);
}
return QColor();
return theme->color(Theme::Debugger_WatchItem_ValueNormal);
}
QVariant WatchItem::data(int column, int role) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment