diff --git a/NEWS.md b/NEWS.md
index c4468f68..d1db1e35 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,6 +4,7 @@ Version 0.7.0
- enhancement: fill indents in the editor (Turned off by default)
- enhancement: new file template
- fix: when an editor is created, its caret will be displayed even it doesn't have focus
+ - enhancement: set mouse wheel scroll speed in the editor general option tab ( 3 lines by default)
Version 0.6.8
- enhancement: add link to cppreference in the help menu
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm
index 5292606d..6eab60c8 100644
Binary files a/RedPandaIDE/RedPandaIDE_zh_CN.qm and b/RedPandaIDE/RedPandaIDE_zh_CN.qm differ
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index f53f4cf4..342ccfc1 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -1020,7 +1020,7 @@ Are you really want to continue?
输入当前断点的生效条件:
-
+
只读
@@ -4887,175 +4887,175 @@ Are you really want to continue?
无法载入自动链接设置
-
-
-
-
+
+
+
+
下列%1文件夹不存在:
-
-
+
+
二进制
-
+
未指定%1文件夹
-
+
C包含
-
-
+
+
C++包含
-
-
-
-
+
+
+
+
无法找到%1程序"%2"
-
+
C语言选项
-
+
支持所有ANSI标准C程序(-ansi)
-
+
不支持将asm、inline和typeof作为关键字(-fno-asm)
-
+
模仿传统C预处理器行为(-traditional-cpp)
-
+
代码生成
-
+
生成特定机器的专用指令(-march)
-
+
完整兼容特定机器,较少优化(-tune)
-
+
启用特定指令集(-mx)
-
+
优化级别(-Ox)
-
+
使用下列指针大小编译(-mx)
-
+
语言标准(-std)
-
+
性能分析
-
+
生成调试信息(-g3)
-
+
生成性能分析信息(-pg)
-
+
代码警告
-
+
忽略所有警告信息(-w)
-
+
启用常见问题警告(-Wall)
-
+
启用更多问题警告(-Wextra)
-
+
检查ISO C/C++/C++0x语法一致性(-pedantic)
-
+
只进行语法检查(不编译)(-fsyntax-only)
-
+
将警告作为错误处理(-Werror)
-
+
遇到第一个错误后立即中止编译(-Wfatal-errors)
-
+
链接器
-
+
链接Objective-C程序 (-lobjc)
-
+
不使用标准库和系统启动文件(-nostdlib)
-
+
不产生控制台窗口(-mwindows)
-
+
剥除附加信息(-s)
@@ -5064,43 +5064,43 @@ Are you really want to continue?
链接Ojbective C程序(-lobjc)
-
+
输出
-
+
在生成的汇编代码中加入注释(-fverbose-asm)
-
+
编译时使用管道而不是临时文件(-pipe)
-
+
只生成汇编代码(-S)
-
-
+
+
确认
-
+
在验证编译器设置"%1"时遇到了下列问题:
-
+
未配置编译器设置。
-
+
您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
@@ -6415,17 +6415,22 @@ Are you really want to continue?
在滚动页时少滚动一行
-
+
+
+ 鼠标滚轮卷轴速度(行)
+
+
+
显示右边缘线
-
+
右边缘宽度
-
+
右边缘颜色
diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp
index d3660f39..691be9ff 100644
--- a/RedPandaIDE/editor.cpp
+++ b/RedPandaIDE/editor.cpp
@@ -3619,6 +3619,8 @@ void Editor::applySettings()
} else {
setRightEdge(0);
}
+
+ setMouseWheelScrollSpeed(pSettings->editor().mouseWheelScrollSpeed());
}
static PSynHighlighterAttribute createRainbowAttribute(const QString& attrName, const QString& schemeName, const QString& schemeItemName) {
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 0f10775a..8bbd4662 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -66,6 +66,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent)
// fRightEdge has to be set before FontChanged is called for the first time
mRightEdge = 80;
+ mMouseWheelScrollSpeed = 1;
+
mGutter.setRightOffset(21);
mGutter.connect(&mGutter, &SynGutter::changed, this, &SynEdit::onGutterChanged);
mGutterWidth = mGutter.realGutterWidth(charWidth());
@@ -3343,6 +3345,16 @@ void SynEdit::onScrolled(int)
invalidate();
}
+int SynEdit::mouseWheelScrollSpeed() const
+{
+ return mMouseWheelScrollSpeed;
+}
+
+void SynEdit::setMouseWheelScrollSpeed(int newMouseWheelScrollSpeed)
+{
+ mMouseWheelScrollSpeed = newMouseWheelScrollSpeed;
+}
+
const PSynHighlighterAttribute &SynEdit::rainbowAttr3() const
{
return mRainbowAttr3;
@@ -5643,11 +5655,11 @@ void SynEdit::leaveEvent(QEvent *)
void SynEdit::wheelEvent(QWheelEvent *event)
{
if (event->angleDelta().y()>0) {
- verticalScrollBar()->setValue(verticalScrollBar()->value()-1);
+ verticalScrollBar()->setValue(verticalScrollBar()->value()-mMouseWheelScrollSpeed);
event->accept();
return;
} else if (event->angleDelta().y()<0) {
- verticalScrollBar()->setValue(verticalScrollBar()->value()+1);
+ verticalScrollBar()->setValue(verticalScrollBar()->value()+mMouseWheelScrollSpeed);
event->accept();
return;
}
diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h
index 7dcf576e..c8141dce 100644
--- a/RedPandaIDE/qsynedit/SynEdit.h
+++ b/RedPandaIDE/qsynedit/SynEdit.h
@@ -373,6 +373,9 @@ public:
const PSynHighlighterAttribute &rainbowAttr3() const;
+ int mouseWheelScrollSpeed() const;
+ void setMouseWheelScrollSpeed(int newMouseWheelScrollSpeed);
+
signals:
void linesDeleted(int FirstLine, int Count);
void linesInserted(int FirstLine, int Count);
@@ -677,6 +680,8 @@ private:
QString mInputPreeditString;
+ int mMouseWheelScrollSpeed;
+
friend class SynEditTextPainter;
// QWidget interface
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index 406cb7af..7f182a71 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -497,6 +497,16 @@ void Settings::Editor::setFillIndents(bool newFillIndents)
mfillIndents = newFillIndents;
}
+int Settings::Editor::mouseWheelScrollSpeed() const
+{
+ return mMouseWheelScrollSpeed;
+}
+
+void Settings::Editor::setMouseWheelScrollSpeed(int newMouseWheelScrollSpeed)
+{
+ mMouseWheelScrollSpeed = newMouseWheelScrollSpeed;
+}
+
bool Settings::Editor::enableTooltips() const
{
return mEnableTooltips;
@@ -983,6 +993,7 @@ void Settings::Editor::doSave()
saveValue("scroll_past_eol", mScrollPastEol);
saveValue("scroll_by_one_less", mScrollByOneLess);
saveValue("half_page_scroll", mHalfPageScroll);
+ saveValue("mouse_wheel_scroll_speed", mMouseWheelScrollSpeed);
//right edge
saveValue("show_right_edge_line",mShowRightEdgeLine);
@@ -1090,6 +1101,8 @@ void Settings::Editor::doLoad()
mScrollPastEol = boolValue("scroll_past_eol", true);
mScrollByOneLess = boolValue("scroll_by_one_less", false);
mHalfPageScroll = boolValue("half_page_scroll",false);
+ mMouseWheelScrollSpeed = intValue("mouse_wheel_scroll_speed", 3);
+
//right edge
mShowRightEdgeLine = boolValue("show_right_edge_line",false);
diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h
index f2893888..5914b5a0 100644
--- a/RedPandaIDE/settings.h
+++ b/RedPandaIDE/settings.h
@@ -323,6 +323,9 @@ public:
bool fillIndents() const;
void setFillIndents(bool newFillIndents);
+ int mouseWheelScrollSpeed() const;
+ void setMouseWheelScrollSpeed(int newMouseWheelScrollSpeed);
+
private:
//General
// indents
@@ -348,6 +351,7 @@ public:
bool mScrollPastEol;
bool mScrollByOneLess;
bool mHalfPageScroll;
+ int mMouseWheelScrollSpeed;
//right margin
bool mShowRightEdgeLine;
diff --git a/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp b/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp
index 40e10921..5bfbc9af 100644
--- a/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp
+++ b/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp
@@ -59,6 +59,8 @@ void EditorGeneralWidget::doLoad()
ui->chkScrollPastEOL->setChecked(pSettings->editor().scrollPastEol());
ui->chkScrollHalfPage->setChecked(pSettings->editor().halfPageScroll());
ui->chkScrollByOneLess->setChecked(pSettings->editor().scrollByOneLess());
+ ui->spinMouseWheelScrollSpeed->setValue(pSettings->editor().mouseWheelScrollSpeed());
+
//right margin line;
ui->grpRightEdge->setChecked(pSettings->editor().showRightEdgeLine());
ui->spRightEdge->setValue(pSettings->editor().rightEdgeWidth());
@@ -90,6 +92,7 @@ void EditorGeneralWidget::doSave()
pSettings->editor().setScrollPastEol(ui->chkScrollPastEOL->isChecked());
pSettings->editor().setScrollByOneLess(ui->chkScrollByOneLess->isChecked());
pSettings->editor().setHalfPageScroll(ui->chkScrollHalfPage->isChecked());
+ pSettings->editor().setMouseWheelScrollSpeed(ui->spinMouseWheelScrollSpeed->value());
//right margin line;
pSettings->editor().setShowRightEdgeLine(ui->grpRightEdge->isChecked());
diff --git a/RedPandaIDE/settingsdialog/editorgeneralwidget.ui b/RedPandaIDE/settingsdialog/editorgeneralwidget.ui
index 2edd34b8..b142a55c 100644
--- a/RedPandaIDE/settingsdialog/editorgeneralwidget.ui
+++ b/RedPandaIDE/settingsdialog/editorgeneralwidget.ui
@@ -276,6 +276,54 @@
+ -
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Mouse Wheel Scroll Speed
+
+
+
+ -
+
+
+ 1
+
+
+ 100
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+