- fix: scroll bar not correctly updated when collapse/uncollapse folders

This commit is contained in:
Roy Qu 2022-04-18 16:17:06 +08:00
parent 331a5818c6
commit 5743991152
3 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Red Panda C++ Version 1.0.4
- fix: crash when eval statements like "fsm::stack fsm;" - fix: crash when eval statements like "fsm::stack fsm;"
- enhancement: add Traditional Chinese translation - enhancement: add Traditional Chinese translation
- fix: index of the longest line not correctly updated ( which will cause selection errors) - 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 Red Panda C++ Version 1.0.3
- fix: when oj problem grabbed by competitive companion received, - fix: when oj problem grabbed by competitive companion received,

View File

@ -140,6 +140,7 @@ MainWindow::MainWindow(QWidget *parent)
mCompilerSet = new QComboBox(); mCompilerSet = new QComboBox();
mCompilerSet->setMinimumWidth(200); mCompilerSet->setMinimumWidth(200);
mCompilerSet->setSizeAdjustPolicy(QComboBox::AdjustToContents);
ui->toolbarCompilerSet->addWidget(mCompilerSet); ui->toolbarCompilerSet->addWidget(mCompilerSet);
connect(mCompilerSet,QOverload<int>::of(&QComboBox::currentIndexChanged), connect(mCompilerSet,QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &MainWindow::onCompilerSetChanged); this, &MainWindow::onCompilerSetChanged);

View File

@ -1142,16 +1142,20 @@ bool SynEdit::inputMethodOn()
void SynEdit::collapseAll() void SynEdit::collapseAll()
{ {
incPaintLock();
for (int i = mAllFoldRanges.count()-1;i>=0;i--){ for (int i = mAllFoldRanges.count()-1;i>=0;i--){
collapse(mAllFoldRanges[i]); collapse(mAllFoldRanges[i]);
} }
decPaintLock();
} }
void SynEdit::unCollpaseAll() void SynEdit::unCollpaseAll()
{ {
incPaintLock();
for (int i = mAllFoldRanges.count()-1;i>=0;i--){ for (int i = mAllFoldRanges.count()-1;i>=0;i--){
uncollapse(mAllFoldRanges[i]); uncollapse(mAllFoldRanges[i]);
} }
decPaintLock();
} }
void SynEdit::processGutterClick(QMouseEvent *event) void SynEdit::processGutterClick(QMouseEvent *event)
@ -3434,6 +3438,7 @@ void SynEdit::uncollapse(PSynEditFoldRange FoldRange)
// Redraw fold mark // Redraw fold mark
invalidateGutterLines(FoldRange->fromLine, INT_MAX); invalidateGutterLines(FoldRange->fromLine, INT_MAX);
updateScrollbars();
} }
void SynEdit::collapse(PSynEditFoldRange FoldRange) void SynEdit::collapse(PSynEditFoldRange FoldRange)
@ -3452,6 +3457,8 @@ void SynEdit::collapse(PSynEditFoldRange FoldRange)
// Redraw fold mark // Redraw fold mark
invalidateGutterLines(FoldRange->fromLine, INT_MAX); invalidateGutterLines(FoldRange->fromLine, INT_MAX);
updateScrollbars();
} }
void SynEdit::foldOnListInserted(int Line, int Count) void SynEdit::foldOnListInserted(int Line, int Count)