From 49297431b619a5adadbd72df919e83b7d03bc3dc Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 19 Mar 2022 10:27:31 +0800 Subject: [PATCH] - enhancement: press alt to switch to column selection mode while selection by mouse dragging in editor --- NEWS.md | 1 + RedPandaIDE/mainwindow.ui | 2 +- RedPandaIDE/qsynedit/SynEdit.cpp | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 8d2187a8..b855d159 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Red Panda C++ Version 1.0.1 - fix: only convert project icon file when it's filename doesn't end with ".ico" - fix: hide function tip when scroll - fix: short cut for goto definition/declaration doesn't work + - enhancement: press alt to switch to column selection mode while selection by mouse dragging in editor Red Panda C++ Version 1.0.0 - fix: calculation for code snippets's tab stop positions is not correct diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index fa12f372..f8346300 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 1114 - 742 + 627 diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 63765912..811717b7 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -6063,6 +6063,10 @@ void SynEdit::mouseMoveEvent(QMouseEvent *event) //BeginDrag(false); } } else if ((buttons == Qt::LeftButton)) { + if (event->modifiers() == Qt::AltModifier) + setSelectionMode(SynSelectionMode::smColumn); + else + setSelectionMode(SynSelectionMode::smNormal); // should we begin scrolling? //computeScroll(X, Y,false); // DisplayCoord P = pixelsToNearestRowColumn(X, Y);