- change: reduce time intervals for selection by mouse

This commit is contained in:
Roy Qu 2022-08-25 16:53:06 +08:00
parent 4df3ba4f14
commit d438864a4d
2 changed files with 13 additions and 8 deletions

View File

@ -2,6 +2,7 @@ Red Panda C++ Version 1.3
- enhancement: don't parse all openned files when start up - enhancement: don't parse all openned files when start up
- enhancement: don't parse files when close all and exit - enhancement: don't parse files when close all and exit
- change: reduce time intervals for selection by mouse
Red Panda C++ Version 1.2 Red Panda C++ Version 1.2

View File

@ -2005,7 +2005,13 @@ void SynEdit::doMouseScroll(bool isDragging)
if (mOptions.testFlag(SynEditorOption::eoGroupUndo)) if (mOptions.testFlag(SynEditorOption::eoGroupUndo))
mUndoList->addGroupBreak(); mUndoList->addGroupBreak();
} }
computeScroll(isDragging); if (isDragging) {
mScrollTimer->singleShot(20,this,&SynEdit::onDraggingScrollTimeout);
} else {
mScrollTimer->singleShot(20,this,&SynEdit::onScrollTimeout);
}
// computeScroll(isDragging);
} }
QString SynEdit::getDisplayStringAtLine(int line) const QString SynEdit::getDisplayStringAtLine(int line) const
@ -2756,11 +2762,7 @@ void SynEdit::computeScroll(bool isDragging)
// if (mScrollDeltaX!=0 || mScrollDeltaY!=0) { // if (mScrollDeltaX!=0 || mScrollDeltaY!=0) {
if (isDragging) { doMouseScroll(isDragging);
mScrollTimer->singleShot(100,this,&SynEdit::onDraggingScrollTimeout);
} else {
mScrollTimer->singleShot(100,this,&SynEdit::onScrollTimeout);
}
// } // }
} }
@ -6947,10 +6949,12 @@ void SynEdit::onGutterChanged()
void SynEdit::onScrollTimeout() void SynEdit::onScrollTimeout()
{ {
doMouseScroll(false); computeScroll(false);
//doMouseScroll(false);
} }
void SynEdit::onDraggingScrollTimeout() void SynEdit::onDraggingScrollTimeout()
{ {
doMouseScroll(true); computeScroll(true);
//doMouseScroll(true);
} }