Commit 8fd84d2d authored by Gustavo Carneiro's avatar Gustavo Carneiro
Browse files

Remove _printerFriendly to TerminalDisplay.

parent 84e66285
......@@ -489,7 +489,6 @@ TerminalDisplay::TerminalDisplay(QWidget* parent)
, _cursorTextColor(QColor())
, _antialiasText(true)
, _useFontLineCharacters(false)
, _printerFriendly(false)
, _sessionController(nullptr)
, _trimLeadingSpaces(false)
, _trimTrailingSpaces(false)
......@@ -585,8 +584,8 @@ TerminalDisplay::TerminalDisplay(QWidget* parent)
const QRect &rect, const QColor &backgroundColor, bool useOpacitySetting) {
_terminalPainter->drawBackground(painter, rect, backgroundColor, useOpacitySetting);
};
auto ldrawContents = [this](QPainter &paint, const QRect &rect) {
_terminalPainter->drawContents(paint, rect);
auto ldrawContents = [this](QPainter &paint, const QRect &rect, bool friendly) {
_terminalPainter->drawContents(paint, rect, friendly);
};
auto lgetBackgroundColor = [this]() {
return getBackgroundColor();
......@@ -1014,7 +1013,7 @@ void TerminalDisplay::paintEvent(QPaintEvent* pe)
paint.setRenderHint(QPainter::TextAntialiasing, _antialiasText);
for (const QRect &rect : qAsConst(dirtyImageRegion)) {
_terminalPainter->drawContents(paint, rect);
_terminalPainter->drawContents(paint, rect, false);
}
_terminalPainter->drawCurrentResultRect(paint);
_terminalPainter->highlightScrolledLines(paint);
......@@ -3179,15 +3178,12 @@ void TerminalDisplay::applyProfile(const Profile::Ptr &profile)
void TerminalDisplay::printScreen()
{
auto lprintContent = [this](QPainter &painter, bool friendly) {
_printerFriendly = friendly;
QPoint columnLines(_usedLines, _usedColumns);
auto lfontget = [this]() { return getVTFont(); };
auto lfontset = [this](const QFont &f) { setVTFont(f); };
_printManager->printContent(painter, friendly, columnLines, lfontget, lfontset);
_printerFriendly = false;
};
_printManager->printRequest(lprintContent, this);
}
......
......@@ -786,8 +786,6 @@ private:
bool _antialiasText; // do we anti-alias or not
bool _useFontLineCharacters;
bool _printerFriendly; // are we currently painting to a printer in black/white mode
//the delay in milliseconds between redrawing blinking text
static const int TEXT_BLINK_DELAY = 500;
......
......@@ -72,7 +72,7 @@ namespace Konsole
}
}
void TerminalPainter::drawContents(QPainter &paint, const QRect &rect)
void TerminalPainter::drawContents(QPainter &paint, const QRect &rect, bool printerFriendly)
{
const int numberOfColumns = _display->_usedColumns;
QVector<uint> univec;
......@@ -240,7 +240,7 @@ namespace Konsole
QString unistr = QString::fromUcs4(univec.data(), univec.length());
// paint text fragment
if (_display->_printerFriendly) {
if (printerFriendly) {
drawPrinterFriendlyTextFragment(paint,
textArea,
unistr,
......
......@@ -59,7 +59,7 @@ namespace Konsole
// fragments according to their colors and styles and calls
// drawTextFragment() or drawPrinterFriendlyTextFragment()
// to draw the fragments
void drawContents(QPainter &paint, const QRect &rect);
void drawContents(QPainter &paint, const QRect &rect, bool PrinterFriendly);
// draw a transparent rectangle over the line of the current match
void drawCurrentResultRect(QPainter &painter);
// draw a thin highlight on the left of the screen for lines that have been scrolled into view
......
......@@ -98,6 +98,6 @@ void KonsolePrintManager::printContent(QPainter &painter, bool friendly, QPoint
if (!friendly) {
_drawBackground(painter, rect, _backgroundColor(), true);
}
_drawContents(painter, rect);
_drawContents(painter, rect, friendly);
vtFontSet(savedFont);
}
......@@ -43,7 +43,7 @@ namespace Konsole
const QRect &rect,
const QColor &backgroundColor,
bool useOpacitySetting)> pDrawBackground;
typedef std::function<void (QPainter &paint, const QRect &rect)> pDrawContents;
typedef std::function<void (QPainter &paint, const QRect &rect, bool friendly)> pDrawContents;
typedef std::function<QColor ()> pColorGet;
KonsolePrintManager(pDrawBackground drawBackground, pDrawContents drawContents, pColorGet colorGet);
......
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