[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ktexteditor] src/view: TextPreview: Adjust the grooveRect-height when scrollPastEnd is enabled
From:       Kåre Särs <kare.sars () iki ! fi>
Date:       2016-06-20 20:04:47
Message-ID: E1bF5R9-0006S7-6K () code ! kde ! org
[Download RAW message or body]

Git commit f5500b6de837d0751ccc5c90ca85072678a22847 by Kåre Särs.
Committed on 20/06/2016 at 20:02.
Pushed by sars into branch 'master'.

TextPreview: Adjust the grooveRect-height when scrollPastEnd is enabled

REVIEW: 128262

M  +6    -0    src/view/kateviewhelpers.cpp

http://commits.kde.org/ktexteditor/f5500b6de837d0751ccc5c90ca85072678a22847

diff --git a/src/view/kateviewhelpers.cpp b/src/view/kateviewhelpers.cpp
index 119d009..3bf25b3 100644
--- a/src/view/kateviewhelpers.cpp
+++ b/src/view/kateviewhelpers.cpp
@@ -315,6 +315,12 @@ void KateScrollBar::showTextPreview()
         grooveRect = style()->subControlRect(QStyle::CC_ScrollBar, &opt, \
QStyle::SC_ScrollBarGroove, this);  }
 
+    if (m_view->config()->scrollPastEnd()) {
+        // Adjust the grove size to accommodate the added pageStep at the bottom
+        int adjust = pageStep()*grooveRect.height() / (maximum() + pageStep() - \
minimum()); +        grooveRect.adjust(0,0,0, -adjust);
+    }
+
     const QPoint cursorPos = mapFromGlobal(QCursor::pos());
     if (grooveRect.contains(cursorPos)) {
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic