diff --git a/lib/TerminalDisplay.cpp b/lib/TerminalDisplay.cpp index 75ca462..07c3d33 100644 --- a/lib/TerminalDisplay.cpp +++ b/lib/TerminalDisplay.cpp @@ -194,10 +194,12 @@ void TerminalDisplay::setColorTable(const ColorEntry table[]) QCodec. */ -static inline bool isLineChar(wchar_t c) { return ((c & 0xFF80) == 0x2500);} -static inline bool isLineCharString(const std::wstring& string) -{ - return (string.length() > 0) && (isLineChar(string[0])); +bool TerminalDisplay::isLineChar(wchar_t c) const { + return _drawLineChars && ((c & 0xFF80) == 0x2500); +} + +bool TerminalDisplay::isLineCharString(const std::wstring& string) const { + return (string.length() > 0) && (isLineChar(string[0])); } @@ -361,6 +363,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent) ,mMotionAfterPasting(NoMoveScreenWindow) ,_leftBaseMargin(1) ,_topBaseMargin(1) +,_drawLineChars(true) { // variables for draw text _drawTextAdditionHeight = 0; diff --git a/lib/TerminalDisplay.h b/lib/TerminalDisplay.h index 5105382..83cd3e7 100644 --- a/lib/TerminalDisplay.h +++ b/lib/TerminalDisplay.h @@ -351,6 +351,12 @@ public: */ static bool antialias() { return _antialiasText; } + /** + * Specify whether line chars should be drawn by ourselves or left to + * underlying font rendering libraries. + */ + void setDrawLineChars(bool drawLineChars) { _drawLineChars = drawLineChars; } + /** * Specifies whether characters with intense colors should be rendered * as bold. Defaults to true. @@ -697,6 +703,9 @@ private: bool handleShortcutOverrideEvent(QKeyEvent* event); + bool isLineChar(wchar_t c) const; + bool isLineCharString(const std::wstring& string) const; + // the window onto the terminal screen which this display // is currently showing. QPointer _screenWindow; @@ -827,6 +836,8 @@ private: int _leftBaseMargin; int _topBaseMargin; + bool _drawLineChars; + public: static void setTransparencyEnabled(bool enable) { diff --git a/lib/qtermwidget.cpp b/lib/qtermwidget.cpp index ccabfd1..750a608 100644 --- a/lib/qtermwidget.cpp +++ b/lib/qtermwidget.cpp @@ -759,3 +759,8 @@ void QTermWidget::saveHistory(QIODevice *device) decoder.begin(&stream); m_impl->m_session->emulation()->writeToStream(&decoder, 0, m_impl->m_session->emulation()->lineCount()); } + +void QTermWidget::setDrawLineChars(bool drawLineChars) +{ + m_impl->m_terminalDisplay->setDrawLineChars(drawLineChars); +} diff --git a/lib/qtermwidget.h b/lib/qtermwidget.h index 1a8d3a3..e4cb42e 100644 --- a/lib/qtermwidget.h +++ b/lib/qtermwidget.h @@ -227,6 +227,8 @@ public: /** Get the empty space outside the terminal */ int getMargin() const; + + void setDrawLineChars(bool drawLineChars); signals: void finished(); void copyAvailable(bool);