From 452cced03e408ca8df5a66fef8c1e216d3b680a4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 4 Jul 2018 08:46:43 +0200 Subject: [PATCH] Revert "Show the scrollbar only when needed" This reverts commit 05f2469c1a0052939fa7db4fa429d6d8f05aab99. --- src/TerminalDisplay.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index b87d953f..8a61b566 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -2122,12 +2122,7 @@ void TerminalDisplay::setScrollBarPosition(Enum::ScrollBarPositionEnum position) return; } - if (position == Enum::ScrollBarHidden) { - _scrollBar->hide(); - } else if (_scrollBar->maximum() != 0) { - _scrollBar->show(); - } - + _scrollBar->setVisible(position != Enum::ScrollBarHidden); _scrollbarLocation = position; propagateSize(); @@ -2159,14 +2154,10 @@ void TerminalDisplay::setScroll(int cursor, int slines) // // setting the range or value of a _scrollBar will always trigger // a repaint, so it should be avoided if it is not necessary - - if (_scrollBar->maximum() == 0 && _scrollBar->value() == cursor) { - // hide the scrollbar if it's not needed - _scrollBar->hide(); + if (_scrollBar->minimum() == 0 && + _scrollBar->maximum() == (slines - _lines) && + _scrollBar->value() == cursor) { return; - - } else if (_scrollbarLocation != Enum::ScrollBarHidden){ - _scrollBar->show(); } disconnect(_scrollBar, &QScrollBar::valueChanged, this, &Konsole::TerminalDisplay::scrollBarPositionChanged);