Allow full cursor height (it is not chopped when line spacing is not zero). This fixes issues with misbehaving fonts.

This commit is contained in:
Filippo Scognamiglio
2014-12-12 02:18:56 +01:00
parent 4f65e1c42b
commit fb04792ae3
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -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)
{
+5
View File
@@ -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)
{