diff --git a/NEWS.md b/NEWS.md
index 6d581c2a..f906468c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -13,6 +13,9 @@ Red Panda C++ Version 0.14.5
- enhancement: better processing of symbol completion
- enhancement: better support of ligatures
- enhancement: use the expression evaluation logic to handle "goto declaration"/"goto definition"
+ - enhancement: reduce startup time by about 1 second.
+ - enhancement: add option "mouse selection/drag scroll speed" in the options dialog's "Editor" / "general" tab.
+ - fix: scroll speed of mouse selection/drag is too fast
Red Panda C++ Version 0.14.4
- enhancement: git - log
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index 8d623312..d7cf17cd 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -1309,45 +1309,43 @@ Are you really want to continue?
要剪切的内容超过了字符数限制!
-
+
打印文档
-
-
-
+
+
+
Ctrl+单击以获取更多信息
-
-
- 未找到符号'%1'!
+ 未找到符号'%1'!
-
+
找不到astyle程序
-
+
找不到astyle程序"%1".
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
只读
@@ -3774,11 +3772,11 @@ Are you really want to continue?
-
-
-
-
-
+
+
+
+
+
编译器
@@ -4201,7 +4199,7 @@ Are you really want to continue?
-
+
新建试题集
@@ -4220,14 +4218,14 @@ Are you really want to continue?
-
+
保存试题集
-
+
载入试题集
@@ -4566,7 +4564,7 @@ Are you really want to continue?
-
+
删除所有断点
@@ -4667,7 +4665,7 @@ Are you really want to continue?
-
+
重命名符号
@@ -4688,13 +4686,13 @@ Are you really want to continue?
-
+
导出为RTF
-
+
导出为HTML
@@ -5174,7 +5172,7 @@ Are you really want to continue?
-
+
试题集%1
@@ -5248,15 +5246,15 @@ Are you really want to continue?
-
-
+
+
书签描述
-
-
+
+
描述:
@@ -5377,7 +5375,7 @@ Are you really want to continue?
-
+
删除
@@ -5454,7 +5452,7 @@ Are you really want to continue?
-
+
需要保存吗?
@@ -5478,141 +5476,141 @@ Are you really want to continue?
-
+
保存失败
-
+
改变项目编译器配置集
-
+
改变项目的编译器配置集会导致所有的自定义编译器选项被重置。
-
+
你真的想要做那些吗?
-
+
您真的要清除该文件的所有断点吗?
-
+
新建项目
-
+
关闭'%1'以打开新项目?
-
+
文件夹不存在
-
+
文件夹'%1'不存在。是否创建?
-
+
无法创建文件夹
-
+
创建文件夹'%1'失败。
-
+
-
+
文件夹%1不是空的。
-
+
你真的要删除它吗?
-
+
无法提交
-
+
Git需要用信息进行提交。
-
+
选择工作文件夹
-
-
+
+
头文件已存在
-
-
+
+
头文件"%1"已存在!
-
+
源文件已存在!
-
+
源文件"%1"已存在!
-
+
无法提交!
-
+
下列文件处于冲突状态,请解决后重新添加和提交:
-
+
提交信息
-
+
提交信息:
-
+
提交失败
-
+
提交信息不能为空!
@@ -5621,125 +5619,125 @@ Are you really want to continue?
小熊猫Dev-C++项目文件 (*.dev)
-
+
新建项目失败
-
+
无法使用模板创建项目
-
+
删除文件
-
+
同时从硬盘上删除文件?
-
+
无标题
-
+
新的项目文件名
-
+
文件名:
-
+
文件已存在!
-
+
文件'%1'已经存在!
-
+
添加到项目
-
+
小熊猫C++项目文件(*.dev)
-
+
重命名出错
-
+
符号'%1'在系统头文件中定义,无法修改。
-
+
新名称
-
-
+
+
替换出错
-
+
无法打开文件'%1'进行替换!
-
+
内容和上次查找时不一致。
-
+
RTF格式文件 (*.rtf)
-
+
HTML文件 (*.html)
-
+
当前的试题集不是空的。
-
+
试题%1
-
-
+
+
试题集文件 (*.pbs)
-
+
载入失败
-
+
试题案例%1
@@ -5755,10 +5753,10 @@ Are you really want to continue?
-
-
-
-
+
+
+
+
错误
@@ -5810,50 +5808,50 @@ Are you really want to continue?
打开
-
+
编译失败
-
+
运行失败
-
-
+
+
确认转换
-
-
+
+
当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?
-
+
新监视表达式
-
+
输入监视表达式
-
+
(%1/%2)正在解析文件"%3"
-
-
+
+
完成%1个文件的解析,用时%2秒
-
+
(每秒%1个文件)
@@ -6832,7 +6830,7 @@ Are you really want to continue?
QApplication
-
+
错误
@@ -6902,205 +6900,205 @@ Are you really want to continue?
无法写入配置文件夹"%1"
-
+
无法载入自动链接设置
-
-
+
+
下列%1文件夹不存在:
-
-
+
+
二进制
-
+
未指定%1文件夹
-
+
C包含
-
+
C++包含
-
-
-
-
+
+
+
+
无法找到%1程序"%2"
-
+
C编译器
-
+
C++编译器
-
+
构建程序(Make)
-
+
调试器
-
+
C语言选项
-
+
支持所有ANSI标准C程序(-ansi)
-
+
不支持将asm、inline和typeof作为关键字(-fno-asm)
-
+
模仿传统C预处理器行为(-traditional-cpp)
-
+
代码生成
-
+
生成特定机器的专用指令(-march)
-
+
完整兼容特定机器,较少优化(-tune)
-
+
启用特定指令集(-mx)
-
+
优化级别(-Ox)
-
+
使用下列指针大小编译(-mx)
-
+
语言标准(-std)
-
+
性能分析
-
+
生成调试信息(-g3)
-
+
您同意小熊猫C++在PATH路径中寻找gcc编译器吗?
-
+
生成性能分析信息(-pg)
-
+
代码警告
-
+
忽略所有警告信息(-w)
-
+
启用常见问题警告(-Wall)
-
+
启用更多问题警告(-Wextra)
-
+
检查ISO C/C++/C++0x语法一致性(-pedantic)
-
+
只进行语法检查(不编译)(-fsyntax-only)
-
+
将警告作为错误处理(-Werror)
-
+
遇到第一个错误后立即中止编译(-Wfatal-errors)
-
+
链接器
-
+
链接Objective-C程序 (-lobjc)
-
+
不使用标准库和系统启动文件(-nostdlib)
-
+
不产生控制台窗口(-mwindows)
-
+
剥除附加信息(-s)
@@ -7109,54 +7107,54 @@ Are you really want to continue?
链接Ojbective C程序(-lobjc)
-
+
输出
-
+
在生成的汇编代码中加入注释(-fverbose-asm)
-
+
编译时使用管道而不是临时文件(-pipe)
-
+
只生成汇编代码(-S)
-
-
+
+
确认
-
+
在验证编译器设置"%1"时遇到了下列问题:
-
+
是否让小熊猫C++删除这些配置,并尝试重新建立配置?
-
+
如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果,
-
-
+
+
未配置编译器设置。
-
+
您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
@@ -7996,7 +7994,7 @@ Are you really want to continue?
自动链接
-
+
@@ -8072,15 +8070,15 @@ Are you really want to continue?
杂项
-
-
+
+
程序运行
-
+
试题集
@@ -8329,8 +8327,8 @@ Are you really want to continue?
SynEdit
-
-
+
+
高亮处理进入了死循环
@@ -8725,17 +8723,23 @@ Are you really want to continue?
鼠标滚轮卷轴速度(行)
-
+
+
+ Mouse Selection/Dragging Speed
+ 鼠标选择/拖拽卷轴速度
+
+
+
显示右边缘线
-
+
右边缘宽度
-
+
右边缘颜色
diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp
index 96432248..9de1a001 100644
--- a/RedPandaIDE/editor.cpp
+++ b/RedPandaIDE/editor.cpp
@@ -4253,6 +4253,7 @@ void Editor::applySettings()
}
setMouseWheelScrollSpeed(pSettings->editor().mouseWheelScrollSpeed());
+ setMouseSelectionScrollSpeed(pSettings->editor().mouseSelectionScrollSpeed());
invalidate();
}
diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp
index 6814248a..b0527047 100644
--- a/RedPandaIDE/main.cpp
+++ b/RedPandaIDE/main.cpp
@@ -255,9 +255,9 @@ int main(int argc, char *argv[])
QString settingFilename = getSettingFilename(QString(), firstRun);
bool openInSingleInstance = false;
if (!settingFilename.isEmpty() && !firstRun) {
- Settings settings(settingFilename);
- settings.load();
- openInSingleInstance = settings.environment().openFilesInSingleInstance();
+ QSettings envSetting(settingFilename,QSettings::IniFormat);
+ envSetting.beginGroup(SETTING_ENVIRONMENT);
+ openInSingleInstance = envSetting.value("open_files_in_single_instance",false).toBool();
} else if (!settingFilename.isEmpty() && firstRun)
openInSingleInstance = false;
if (openInSingleInstance) {
@@ -281,7 +281,6 @@ int main(int argc, char *argv[])
}
}
}
-
//Translation must be loaded first
QTranslator trans,transQt;
bool firstRun;
@@ -293,7 +292,6 @@ int main(int argc, char *argv[])
tempFile.remove();
return -1;
}
-
{
QSettings languageSetting(settingFilename,QSettings::IniFormat);
languageSetting.beginGroup(SETTING_ENVIRONMENT);
@@ -306,7 +304,6 @@ int main(int argc, char *argv[])
app.installTranslator(&transQt);
}
}
-
qRegisterMetaType("PCompileIssue");
qRegisterMetaType("PCompileIssue&");
qRegisterMetaType>("QVector");
@@ -342,7 +339,6 @@ int main(int argc, char *argv[])
pSettings->vcs().detectGitInPath();
}
auto settings = std::unique_ptr(pSettings);
-
//Color scheme settings must be loaded after translation
pColorManager = new ColorManager();
pIconsManager = new IconsManager();
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 86a3dd3a..f5eb870d 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -90,7 +90,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent)
// fRightEdge has to be set before FontChanged is called for the first time
mRightEdge = 80;
- mMouseWheelScrollSpeed = 1;
+ mMouseWheelScrollSpeed = 3;
+ mMouseSelectionScrollSpeed = 1;
mGutter.setRightOffset(21);
mGutter.connect(&mGutter, &SynGutter::changed, this, &SynEdit::onGutterChanged);
@@ -1804,17 +1805,18 @@ void SynEdit::doMouseScroll(bool isDragging)
C = pixelsToRowColumn(iMousePos.x(), iMousePos.y());
C.Row = minMax(C.Row, 1, displayLineCount());
if (mScrollDeltaX != 0) {
- setLeftChar(leftChar() + mScrollDeltaX);
+ setLeftChar(leftChar() + mScrollDeltaX * mMouseSelectionScrollSpeed);
X = leftChar();
if (mScrollDeltaX > 0) // scrolling right?
X+=charsInWindow();
C.Column = X;
}
if (mScrollDeltaY != 0) {
+ //qDebug()< 0) // scrolling down?
Y+=mLinesInWindow - 1;
@@ -2489,17 +2491,15 @@ void SynEdit::computeCaret(int X, int Y)
void SynEdit::computeScroll(int X, int Y, bool isDragging)
{
- if (!isDragging) {
- Qt::MouseButtons buttons = qApp->mouseButtons();
- if (!buttons.testFlag(Qt::LeftButton))
- return;
- }
+ Qt::MouseButtons buttons = qApp->mouseButtons();
+ if (!buttons.testFlag(Qt::LeftButton))
+ return;
QRect iScrollBounds; // relative to the client area
int dispX=2,dispY = 2;
- if (isDragging) {
- dispX = mCharWidth / 2 -1;
- dispY = mTextHeight/ 2 -1;
- }
+// if (isDragging) {
+// dispX = mCharWidth / 2 -1;
+// dispY = mTextHeight/ 2 -1;
+// }
int left = mGutterWidth+frameWidth()+dispX;
int top = frameWidth()+dispY;
iScrollBounds = QRect(left,
@@ -2529,13 +2529,13 @@ void SynEdit::computeScroll(int X, int Y, bool isDragging)
mScrollDeltaY = 0;
}
- if (mScrollDeltaX!=0 || mScrollDeltaY!=0) {
- if (isDragging) {
- mScrollTimer->singleShot(100,this,&SynEdit::onDraggingScrollTimeout);
- } else {
- mScrollTimer->singleShot(100,this,&SynEdit::onScrollTimeout);
- }
+// if (mScrollDeltaX!=0 || mScrollDeltaY!=0) {
+ if (isDragging) {
+ mScrollTimer->singleShot(100,this,&SynEdit::onDraggingScrollTimeout);
+ } else {
+ mScrollTimer->singleShot(100,this,&SynEdit::onScrollTimeout);
}
+// }
}
void SynEdit::doBlockIndent()
@@ -3780,6 +3780,16 @@ void SynEdit::onScrolled(int)
invalidate();
}
+int SynEdit::mouseSelectionScrollSpeed() const
+{
+ return mMouseSelectionScrollSpeed;
+}
+
+void SynEdit::setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed)
+{
+ mMouseSelectionScrollSpeed = newMouseSelectionScrollSpeed;
+}
+
const QFont &SynEdit::fontForNonAscii() const
{
return mFontForNonAscii;
@@ -5912,6 +5922,7 @@ void SynEdit::mousePressEvent(QMouseEvent *event)
//Selection mode must be set before calling SetBlockBegin
setBlockBegin(caretXY());
}
+ computeScroll(X,Y,false);
}
}
}
@@ -5964,7 +5975,7 @@ void SynEdit::mouseMoveEvent(QMouseEvent *event)
}
} else if ((buttons == Qt::LeftButton)) {
// should we begin scrolling?
- computeScroll(X, Y,false);
+ //computeScroll(X, Y,false);
DisplayCoord P = pixelsToNearestRowColumn(X, Y);
P.Row = minMax(P.Row, 1, displayLineCount());
if (mScrollDeltaX != 0)
@@ -6076,6 +6087,8 @@ void SynEdit::dragEnterEvent(QDragEnterEvent *event)
setBlockBegin(mDragSelBeginSave);
setBlockEnd(mDragSelEndSave);
showCaret();
+ computeScroll(event->pos().x(),
+ event->pos().y(),true);
}
}
@@ -6146,8 +6159,8 @@ void SynEdit::dragMoveEvent(QDragMoveEvent *event)
event->setDropAction(Qt::MoveAction);
}
// should we begin scrolling?
- computeScroll(event->pos().x(),
- event->pos().y(),true);
+// computeScroll(event->pos().x(),
+// event->pos().y(),true);
BufferCoord coord = displayToBufferPos(pixelsToNearestRowColumn(event->pos().x(),
event->pos().y()));
diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h
index 81352f5d..eafe37ec 100644
--- a/RedPandaIDE/qsynedit/SynEdit.h
+++ b/RedPandaIDE/qsynedit/SynEdit.h
@@ -723,6 +723,7 @@ private:
QString mInputPreeditString;
int mMouseWheelScrollSpeed;
+ int mMouseSelectionScrollSpeed;
BufferCoord mDragCaretSave;
BufferCoord mDragSelBeginSave;
@@ -760,6 +761,9 @@ QVariant inputMethodQuery(Qt::InputMethodQuery property) const override;
const QFont &fontForNonAscii() const;
void setFontForNonAscii(const QFont &newFontForNonAscii);
+int mouseSelectionScrollSpeed() const;
+void setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed);
+
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp
index 70f4e42a..415a5942 100644
--- a/RedPandaIDE/qsynedit/TextPainter.cpp
+++ b/RedPandaIDE/qsynedit/TextPainter.cpp
@@ -431,7 +431,6 @@ void SynEditTextPainter::PaintToken(const QString &Token, int TokenCols, int Col
textToPaint+=Token[i];
}
painter->drawText(nX,rcToken.bottom()-painter->fontMetrics().descent() , textToPaint);
- qDebug()<chkScrollHalfPage->setChecked(pSettings->editor().halfPageScroll());
ui->chkScrollByOneLess->setChecked(pSettings->editor().scrollByOneLess());
ui->spinMouseWheelScrollSpeed->setValue(pSettings->editor().mouseWheelScrollSpeed());
+ ui->spinMouseSelectionScrollSpeed->setValue(pSettings->editor().mouseSelectionScrollSpeed());
//right margin line;
ui->grpRightEdge->setChecked(pSettings->editor().showRightEdgeLine());
@@ -114,6 +115,7 @@ void EditorGeneralWidget::doSave()
pSettings->editor().setScrollByOneLess(ui->chkScrollByOneLess->isChecked());
pSettings->editor().setHalfPageScroll(ui->chkScrollHalfPage->isChecked());
pSettings->editor().setMouseWheelScrollSpeed(ui->spinMouseWheelScrollSpeed->value());
+ pSettings->editor().setMouseSelectionScrollSpeed(ui->spinMouseSelectionScrollSpeed->value());
//right margin line;
pSettings->editor().setShowRightEdgeLine(ui->grpRightEdge->isChecked());
diff --git a/RedPandaIDE/settingsdialog/editorgeneralwidget.ui b/RedPandaIDE/settingsdialog/editorgeneralwidget.ui
index 760f4900..47d3a9de 100644
--- a/RedPandaIDE/settingsdialog/editorgeneralwidget.ui
+++ b/RedPandaIDE/settingsdialog/editorgeneralwidget.ui
@@ -340,6 +340,54 @@
+ -
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Mouse Selection/Dragging Scroll Speed
+
+
+
+ -
+
+
+ 1
+
+
+ 100
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+