forked from qt-creator/qt-creator
Theming: theme compile output pane
Change-Id: Ic364457884765ea755d0dc6e3e35296d5bd36359 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
0b6b5631b7
commit
a4bb572a3b
@@ -87,6 +87,10 @@ OutputPaneToggleButtonTextColorChecked=text
|
||||
OutputPaneToggleButtonTextColorUnchecked=text
|
||||
QtOutputFormatter_LinkTextColor=ff0000ff
|
||||
|
||||
CompileOutput_ErrorOutput=ffff6c6c
|
||||
CompileOutput_MessageOutput=ff008787
|
||||
CompileOutput_ErrorMessageOutput=ffff6c6c
|
||||
|
||||
Welcome_BackgroundColorNormal=normalBackground
|
||||
Welcome_Button_BorderColorNormal=0
|
||||
Welcome_Button_BorderColorPressed=0
|
||||
|
@@ -81,6 +81,10 @@ OutputPaneToggleButtonTextColorChecked=ffffffff
|
||||
OutputPaneToggleButtonTextColorUnchecked=ff000000
|
||||
QtOutputFormatter_LinkTextColor=ff0000aa
|
||||
|
||||
CompileOutput_ErrorOutput=ffaa0000
|
||||
CompileOutput_MessageOutput=ff0000aa
|
||||
CompileOutput_ErrorMessageOutput=ffaa0000
|
||||
|
||||
Welcome_BackgroundColorNormal=ffffffff
|
||||
Welcome_Button_BorderColorNormal=ff737373
|
||||
Welcome_Button_BorderColorPressed=ff333333
|
||||
|
@@ -133,6 +133,12 @@ public:
|
||||
|
||||
QtOutputFormatter_LinkTextColor,
|
||||
|
||||
/* Compile Output Pane */
|
||||
|
||||
CompileOutput_ErrorOutput,
|
||||
CompileOutput_MessageOutput,
|
||||
CompileOutput_ErrorMessageOutput,
|
||||
|
||||
/* Welcome Plugin */
|
||||
|
||||
Welcome_TextColorNormal,
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <utils/ansiescapecodehandler.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QTextCharFormat>
|
||||
@@ -184,30 +185,26 @@ QList<QWidget *> CompileOutputWindow::toolBarWidgets() const
|
||||
return QList<QWidget *>() << m_cancelBuildButton;
|
||||
}
|
||||
|
||||
static QColor mix_colors(const QColor &a, const QColor &b)
|
||||
{
|
||||
return QColor((a.red() + 2 * b.red()) / 3, (a.green() + 2 * b.green()) / 3,
|
||||
(a.blue() + 2* b.blue()) / 3, (a.alpha() + 2 * b.alpha()) / 3);
|
||||
}
|
||||
|
||||
void CompileOutputWindow::appendText(const QString &text, BuildStep::OutputFormat format)
|
||||
{
|
||||
using Utils::Theme;
|
||||
QPalette p = m_outputWindow->palette();
|
||||
Theme *theme = Utils::creatorTheme();
|
||||
QTextCharFormat textFormat;
|
||||
switch (format) {
|
||||
case BuildStep::NormalOutput:
|
||||
textFormat.setForeground(p.color(QPalette::Text));
|
||||
textFormat.setForeground(theme->color(Theme::TextColorNormal));
|
||||
textFormat.setFontWeight(QFont::Normal);
|
||||
break;
|
||||
case BuildStep::ErrorOutput:
|
||||
textFormat.setForeground(mix_colors(p.color(QPalette::Text), QColor(Qt::red)));
|
||||
textFormat.setForeground(theme->color(Theme::CompileOutput_ErrorOutput));
|
||||
textFormat.setFontWeight(QFont::Normal);
|
||||
break;
|
||||
case BuildStep::MessageOutput:
|
||||
textFormat.setForeground(mix_colors(p.color(QPalette::Text), QColor(Qt::blue)));
|
||||
textFormat.setForeground(theme->color(Theme::CompileOutput_MessageOutput));
|
||||
break;
|
||||
case BuildStep::ErrorMessageOutput:
|
||||
textFormat.setForeground(mix_colors(p.color(QPalette::Text), QColor(Qt::red)));
|
||||
textFormat.setForeground(theme->color(Theme::CompileOutput_ErrorMessageOutput));
|
||||
textFormat.setFontWeight(QFont::Bold);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user