From 328e221bb05ad94fa6bc9313975df3670c446659 Mon Sep 17 00:00:00 2001 From: rekols Date: Fri, 14 Sep 2018 13:12:03 +0800 Subject: [PATCH] fix: don't display horizontal scrollbar. Change-Id: Ia0b9225b3df3e9f935e630fb7b2d18b0aaeb9e68 --- editor/src/texteditor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/src/texteditor.cpp b/editor/src/texteditor.cpp index 4e1ce6d7..3073e217 100644 --- a/editor/src/texteditor.cpp +++ b/editor/src/texteditor.cpp @@ -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); }