- 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: 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
- 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 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_BEGIN "%REPL_BEGIN%"
#define USER_CODE_IN_REPL_POS_END "%REPL_END%" #define USER_CODE_IN_REPL_POS_END "%REPL_END%"
class Project; class Project;
struct TabStop { struct TabStop {
int x; int x;

View File

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

View File

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