From fb04792ae3dfbbc40a8d957a7b7300a98862bb9d Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Fri, 12 Dec 2014 02:18:56 +0100 Subject: [PATCH] Allow full cursor height (it is not chopped when line spacing is not zero). This fixes issues with misbehaving fonts. --- lib/TerminalDisplay.cpp | 3 ++- lib/TerminalDisplay.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/TerminalDisplay.cpp b/lib/TerminalDisplay.cpp index 988459e..18d1d6f 100644 --- a/lib/TerminalDisplay.cpp +++ b/lib/TerminalDisplay.cpp @@ -345,6 +345,7 @@ TerminalDisplay::TerminalDisplay(QQuickItem *parent) ,mMotionAfterPasting(NoMoveScreenWindow) ,m_font("Monospace", 12) ,m_color_role(QPalette::Background) +,m_full_cursor_height(false) { // terminal applications are not designed with Right-To-Left in mind, // so the layout is forced to Left-To-Right @@ -656,7 +657,7 @@ void TerminalDisplay::drawCursor(QPainter& painter, bool& invertCharacterColor) { QRect cursorRect = rect; - cursorRect.setHeight(_fontHeight - _lineSpacing - 1); + cursorRect.setHeight(_fontHeight - ((m_full_cursor_height) ? 0 : _lineSpacing) - 1); if (!_cursorBlinking) { diff --git a/lib/TerminalDisplay.h b/lib/TerminalDisplay.h index 110cd81..5606d19 100644 --- a/lib/TerminalDisplay.h +++ b/lib/TerminalDisplay.h @@ -95,7 +95,9 @@ class KONSOLEPRIVATE_EXPORT TerminalDisplay : public QQuickPaintedItem Q_PROPERTY(int scrollbarMaximum READ getScrollbarMaximum NOTIFY scrollbarParamsChanged ) Q_PROPERTY(int scrollbarMinimum READ getScrollbarMinimum NOTIFY scrollbarParamsChanged ) Q_PROPERTY(QSize fontMetrics READ getFontMetrics NOTIFY changedFontMetricSignal ) + Q_PROPERTY(bool enableBold WRITE setBoldIntense) + Q_PROPERTY(bool fullCursorHeight WRITE setFullCursorHeight) public: /** Constructs a new terminal display widget with the specified parent. */ @@ -879,6 +881,7 @@ private: QPalette m_palette; QPalette::ColorRole m_color_role; KSession *m_session; + bool m_full_cursor_height; QFont font() const { return m_font; } @@ -907,6 +910,8 @@ private: QSize getFontMetrics(); + void setFullCursorHeight(bool val) { m_full_cursor_height = val; } + public: static void setTransparencyEnabled(bool enable) {