Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
8fd84d2d
Commit
8fd84d2d
authored
Oct 11, 2020
by
Gustavo Carneiro
Browse files
Remove _printerFriendly to TerminalDisplay.
parent
84e66285
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/terminalDisplay/TerminalDisplay.cpp
View file @
8fd84d2d
...
...
@@ -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
);
}
...
...
src/terminalDisplay/TerminalDisplay.h
View file @
8fd84d2d
...
...
@@ -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
;
...
...
src/terminalDisplay/TerminalPainter.cpp
View file @
8fd84d2d
...
...
@@ -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
,
...
...
src/terminalDisplay/TerminalPainter.hpp
View file @
8fd84d2d
...
...
@@ -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
...
...
src/widgets/KonsolePrintManager.cpp
View file @
8fd84d2d
...
...
@@ -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
);
}
src/widgets/KonsolePrintManager.h
View file @
8fd84d2d
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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