Skip to content
Snippets Groups Projects
Commit c04ece53 authored by mae's avatar mae
Browse files

Nicer graying out of old content in the output window

Experiment with changing the foreground rather than the background.

Done with: thorbjorn
parent 3bb71243
No related branches found
No related tags found
No related merge requests found
......@@ -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());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment