Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
51d6b09e
Commit
51d6b09e
authored
Jul 27, 2010
by
dt
Browse files
Modify color mixing for compile output / application output
Task-Nr: QTCREATORBUG-1875
parent
3bebc091
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/compileoutputwindow.cpp
View file @
51d6b09e
...
...
@@ -97,8 +97,8 @@ QWidget *CompileOutputWindow::outputWidget(QWidget *)
static
QColor
mix_colors
(
QColor
a
,
QColor
b
)
{
return
QColor
((
a
.
red
()
+
b
.
red
())
/
2
,
(
a
.
green
()
+
b
.
green
())
/
2
,
(
a
.
blue
()
+
b
.
blue
())
/
2
,
(
a
.
alpha
()
+
b
.
alpha
())
/
2
);
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
,
ProjectExplorer
::
BuildStep
::
OutputFormat
format
)
...
...
src/plugins/projectexplorer/outputformatter.cpp
View file @
51d6b09e
...
...
@@ -85,10 +85,11 @@ void OutputFormatter::append(const QString &text, const QTextCharFormat &format)
static
QColor
mix_colors
(
QColor
a
,
QColor
b
)
{
return
QColor
((
a
.
red
()
+
b
.
red
())
/
2
,
(
a
.
green
()
+
b
.
green
())
/
2
,
(
a
.
blue
()
+
b
.
blue
())
/
2
,
(
a
.
alpha
()
+
b
.
alpha
())
/
2
);
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
OutputFormatter
::
initFormats
()
{
QPalette
p
=
plainTextEdit
()
->
palette
();
...
...
@@ -102,11 +103,11 @@ void OutputFormatter::initFormats()
// NormalMessageFormat
m_formats
[
NormalMessageFormat
].
setFont
(
boldFont
);
m_formats
[
NormalMessageFormat
].
setForeground
(
mix_colors
(
QColor
(
Qt
::
blue
),
p
.
color
(
QPalette
::
Text
)));
m_formats
[
NormalMessageFormat
].
setForeground
(
mix_colors
(
p
.
color
(
QPalette
::
Text
)
,
QColor
(
Qt
::
blue
)
));
// ErrorMessageFormat
m_formats
[
ErrorMessageFormat
].
setFont
(
boldFont
);
m_formats
[
ErrorMessageFormat
].
setForeground
(
mix_colors
(
QColor
(
Qt
::
red
),
p
.
color
(
QPalette
::
Text
)));
m_formats
[
ErrorMessageFormat
].
setForeground
(
mix_colors
(
p
.
color
(
QPalette
::
Text
)
,
QColor
(
Qt
::
red
)
));
// StdOutFormat
m_formats
[
StdOutFormat
].
setFont
(
font
);
...
...
@@ -114,7 +115,7 @@ void OutputFormatter::initFormats()
// StdErrFormat
m_formats
[
StdErrFormat
].
setFont
(
font
);
m_formats
[
StdErrFormat
].
setForeground
(
mix_colors
(
QColor
(
Qt
::
red
),
p
.
color
(
QPalette
::
Text
)));
m_formats
[
StdErrFormat
].
setForeground
(
mix_colors
(
p
.
color
(
QPalette
::
Text
)
,
QColor
(
Qt
::
red
)
));
}
void
OutputFormatter
::
handleLink
(
const
QString
&
href
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment