diff --git a/NEWS.md b/NEWS.md index 0db48ed1..477f1b02 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,7 @@ Red Panda C++ Version 1.0.4 - fix: crash when eval statements like "fsm::stack fsm;" - enhancement: add Traditional Chinese translation - fix: index of the longest line not correctly updated ( which will cause selection errors) + - fix: scroll bar not correctly updated when collapse/uncollapse folders Red Panda C++ Version 1.0.3 - fix: when oj problem grabbed by competitive companion received, diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 30a95974..7bb0546b 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -140,6 +140,7 @@ MainWindow::MainWindow(QWidget *parent) mCompilerSet = new QComboBox(); mCompilerSet->setMinimumWidth(200); + mCompilerSet->setSizeAdjustPolicy(QComboBox::AdjustToContents); ui->toolbarCompilerSet->addWidget(mCompilerSet); connect(mCompilerSet,QOverload::of(&QComboBox::currentIndexChanged), this, &MainWindow::onCompilerSetChanged); diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index ed9c42e2..cc0a6c2e 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -1142,16 +1142,20 @@ bool SynEdit::inputMethodOn() void SynEdit::collapseAll() { + incPaintLock(); for (int i = mAllFoldRanges.count()-1;i>=0;i--){ collapse(mAllFoldRanges[i]); } + decPaintLock(); } void SynEdit::unCollpaseAll() { + incPaintLock(); for (int i = mAllFoldRanges.count()-1;i>=0;i--){ uncollapse(mAllFoldRanges[i]); } + decPaintLock(); } void SynEdit::processGutterClick(QMouseEvent *event) @@ -3434,6 +3438,7 @@ void SynEdit::uncollapse(PSynEditFoldRange FoldRange) // Redraw fold mark invalidateGutterLines(FoldRange->fromLine, INT_MAX); + updateScrollbars(); } void SynEdit::collapse(PSynEditFoldRange FoldRange) @@ -3452,6 +3457,8 @@ void SynEdit::collapse(PSynEditFoldRange FoldRange) // Redraw fold mark invalidateGutterLines(FoldRange->fromLine, INT_MAX); + + updateScrollbars(); } void SynEdit::foldOnListInserted(int Line, int Count)