fix: Editor vertical scroller's page step are not correct
This commit is contained in:
parent
bc19b58cd3
commit
a24debae6f
|
@ -159,7 +159,7 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
connect(verticalScrollBar(),&QScrollBar::valueChanged,
|
connect(verticalScrollBar(),&QScrollBar::valueChanged,
|
||||||
this, &QSynEdit::onScrolled);
|
this, &QSynEdit::onScrolled);
|
||||||
connect(verticalScrollBar(), &QAbstractSlider::sliderReleased,
|
connect(verticalScrollBar(), &QAbstractSlider::sliderReleased,
|
||||||
this, qOverload<>(&QSynEdit::ensureLineAlignedWithTop));
|
this, &QSynEdit::ensureLineAlignedWithTop);
|
||||||
//enable input method
|
//enable input method
|
||||||
setAttribute(Qt::WA_InputMethodEnabled);
|
setAttribute(Qt::WA_InputMethodEnabled);
|
||||||
|
|
||||||
|
@ -3125,7 +3125,7 @@ void QSynEdit::updateVScrollbar()
|
||||||
nMaxScroll = maxScrollHeight();
|
nMaxScroll = maxScrollHeight();
|
||||||
nMin = 0;
|
nMin = 0;
|
||||||
nMax = std::max(1, nMaxScroll);
|
nMax = std::max(1, nMaxScroll);
|
||||||
nPage = mLinesInWindow;
|
nPage = mLinesInWindow * mTextHeight;
|
||||||
nPos = mTopPos;
|
nPos = mTopPos;
|
||||||
verticalScrollBar()->setMinimum(nMin);
|
verticalScrollBar()->setMinimum(nMin);
|
||||||
verticalScrollBar()->setMaximum(nMax);
|
verticalScrollBar()->setMaximum(nMax);
|
||||||
|
|
Loading…
Reference in New Issue