summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-12-16 12:15:51 +0100
committermae <qt-info@nokia.com>2009-12-16 13:32:14 +0100
commitc04ece53081d06fd0e071155ca6d47b66e74aac3 (patch)
tree2fb09999d8f52a1daf76bd46716a4c4859fa1ea2 /src/plugins/projectexplorer
parent3bb71243d431811673b442461b3cf573f7faa32e (diff)
downloadqt-creator-c04ece53081d06fd0e071155ca6d47b66e74aac3.tar.gz
Nicer graying out of old content in the output window
Experiment with changing the foreground rather than the background. Done with: thorbjorn
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/outputwindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp
index b17e96b323..69567498c5 100644
--- a/src/plugins/projectexplorer/outputwindow.cpp
+++ b/src/plugins/projectexplorer/outputwindow.cpp
@@ -465,18 +465,23 @@ void OutputWindow::insertLine()
void OutputWindow::grayOutOldContent()
{
QTextCursor cursor = textCursor();
+ cursor.movePosition(QTextCursor::End);
+ QTextCharFormat endFormat = cursor.charFormat();
+
cursor.select(QTextCursor::Document);
- QTextBlockFormat tbf;
+
+ QTextCharFormat format;
const QColor bkgColor = palette().base().color();
const QColor fgdColor = palette().text().color();
- double bkgFactor = 0.85;
+ double bkgFactor = 0.50;
double fgdFactor = 1.-bkgFactor;
- tbf.setBackground(QColor((bkgFactor * bkgColor.red() + fgdFactor * fgdColor.red()),
+ format.setForeground(QColor((bkgFactor * bkgColor.red() + fgdFactor * fgdColor.red()),
(bkgFactor * bkgColor.green() + fgdFactor * fgdColor.green()),
(bkgFactor * bkgColor.blue() + fgdFactor * fgdColor.blue()) ));
- cursor.mergeBlockFormat(tbf);
+ cursor.mergeCharFormat(format);
cursor.movePosition(QTextCursor::End);
+ cursor.setCharFormat(endFormat);
cursor.insertBlock(QTextBlockFormat());
}