Skip to content

Commit

Permalink
fix: don't display horizontal scrollbar.
Browse files Browse the repository at this point in the history
Change-Id: Ia0b9225b3df3e9f935e630fb7b2d18b0aaeb9e68
  • Loading branch information
rekols committed Sep 14, 2018
1 parent 4857888 commit 328e221
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions editor/src/texteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2445,10 +2445,13 @@ void TextEditor::adjustScrollbarMargins()
{
if (isVisible() && !m_scrollbarLock) {
m_scrollbarLock = true;
auto documentHeight = (verticalScrollBar()->maximum() - verticalScrollBar()->minimum() + verticalScrollBar()->pageStep()) * fontMetrics().height();

int documentHeight = (verticalScrollBar()->maximum() - verticalScrollBar()->minimum() + verticalScrollBar()->pageStep())
* fontMetrics().height();

if (documentHeight > rect().height()) {
setViewportMargins(0, 0, -verticalScrollBar()->sizeHint().width(), -horizontalScrollBar()->sizeHint().height() + m_scrollbarMargin);
// setViewportMargins(0, 0, -verticalScrollBar()->sizeHint().width(), -horizontalScrollBar()->sizeHint().height() + m_scrollbarMargin);
setViewportMargins(0, 0, -verticalScrollBar()->sizeHint().width(), 0);
} else {
setViewportMargins(0, 0, 0, 0);
}
Expand Down

0 comments on commit 328e221

Please sign in to comment.