- fix: "Toggle breakpoint " in the editor gutter's context menu doesn't work.

- fix: Click editor's gutter won't toggle breakpoint in KDE debian 12
This commit is contained in:
Roy Qu 2023-07-08 19:47:48 +08:00
parent 7f3b45391e
commit 7ad6a64150
4 changed files with 15 additions and 6 deletions

View File

@ -35,6 +35,8 @@ Red Panda C++ Version 2.23
- enhancement: Correctly reformat C++ three-way comparision operator "<=>"
- enhancement: Auto insert spaces between #include and <> when reformat
- enhancement: Auto insert spaces between #include and "" when reformat
- fix: Click editor's gutter won't toggle breakpoint in KDE debian 12
- fix: "Toggle breakpoint " in the editor gutter's context menu doesn't work.
Red Panda C++ Version 2.22

View File

@ -31,7 +31,6 @@
#define USER_CODE_IN_REPL_POS_BEGIN "%REPL_BEGIN%"
#define USER_CODE_IN_REPL_POS_END "%REPL_END%"
class Project;
struct TabStop {
int x;

View File

@ -69,6 +69,7 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
mDocument = std::make_shared<Document>(mFontDummy, mFontDummy, this);
//fPlugins := TList.Create;
mMouseMoved = false;
mMouseOrigin = QPoint(0,0);
mUndoing = false;
mDocument->connect(mDocument.get(), &Document::changed, this, &QSynEdit::onLinesChanged);
mDocument->connect(mDocument.get(), &Document::changing, this, &QSynEdit::onLinesChanging);
@ -656,10 +657,13 @@ bool QSynEdit::pointToCharLine(const QPoint &point, BufferCoord &coord)
bool QSynEdit::pointToLine(const QPoint &point, int &line)
{
BufferCoord coord;
bool result = pointToCharLine(point,coord);
if (result)
line=coord.line;
if ((point.y() < clientTop())
|| (point.y() > clientTop()+clientHeight())) {
return false;
}
line = rowToLine(
std::max(1, mTopLine + (point.y() / mTextHeight))
);
return true;
}
@ -6143,6 +6147,7 @@ void QSynEdit::mousePressEvent(QMouseEvent *event)
bool bWasSel = false;
bool bStartDrag = false;
mMouseMoved = false;
mMouseOrigin = event->pos();
Qt::MouseButton button = event->button();
int X=event->pos().x();
int Y=event->pos().y();
@ -6227,6 +6232,8 @@ void QSynEdit::mouseReleaseEvent(QMouseEvent *event)
void QSynEdit::mouseMoveEvent(QMouseEvent *event)
{
QAbstractScrollArea::mouseMoveEvent(event);
if ( (std::abs(event->pos().y()-mMouseOrigin.y()) > 2)
|| (std::abs(event->pos().x()-mMouseOrigin.x()) > 2) )
mMouseMoved = true;
Qt::MouseButtons buttons = event->buttons();
if (mStateFlags.testFlag(StateFlag::sfWaitForDragging)

View File

@ -656,6 +656,7 @@ private:
QFont mFontDummy;
QFont mFontForNonAscii;
bool mMouseMoved;
QPoint mMouseOrigin;
bool mInserting;
bool mPainting;