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? 输入当前断点的生效条件: - + Readonly 只读 @@ -4887,175 +4887,175 @@ Are you really want to continue? 无法载入自动链接设置 - - - - + + + + The following %1 directories don't exist: 下列%1文件夹不存在: - - + + binary 二进制 - + No %1 directories have been specified. 未指定%1文件夹 - + C include C包含 - - + + C++ include C++包含 - - - - + + + + Cannot find the %1 "%2" 无法找到%1程序"%2" - + C options C语言选项 - + Support all ANSI standard C programs (-ansi) 支持所有ANSI标准C程序(-ansi) - + Do not recognize asm,inline or typeof as a keyword (-fno-asm) 不支持将asm、inline和typeof作为关键字(-fno-asm) - + Imitate traditional C preprocessors (-traditional-cpp) 模仿传统C预处理器行为(-traditional-cpp) - + Code Generation 代码生成 - + Optimize for the following machine (-march) 生成特定机器的专用指令(-march) - + Optimize less, while maintaining full compatibility (-tune) 完整兼容特定机器,较少优化(-tune) - + Enable use of specific instructions (-mx) 启用特定指令集(-mx) - + Optimization level (-Ox) 优化级别(-Ox) - + Compile with the following pointer size (-mx) 使用下列指针大小编译(-mx) - + Language standard (-std) 语言标准(-std) - + Profile 性能分析 - + Generate debugging information (-g3) 生成调试信息(-g3) - + Generate profiling info for analysis (-pg) 生成性能分析信息(-pg) - + Warnings 代码警告 - + Inhibit all warning messages (-w) 忽略所有警告信息(-w) - + Show most warnings (-Wall) 启用常见问题警告(-Wall) - + Show some more warnings (-Wextra) 启用更多问题警告(-Wextra) - + Check ISO C/C++/C++0x conformance (-pedantic) 检查ISO C/C++/C++0x语法一致性(-pedantic) - + Only check the code for syntax errors (-fsyntax-only) 只进行语法检查(不编译)(-fsyntax-only) - + Make all warnings into errors (-Werror) 将警告作为错误处理(-Werror) - + Abort compilation on first error (-Wfatal-errors) 遇到第一个错误后立即中止编译(-Wfatal-errors) - + Linker 链接器 - + Link an Objective C program (-lobjc) 链接Objective-C程序 (-lobjc) - + Do not use standard system libraries (-nostdlib) 不使用标准库和系统启动文件(-nostdlib) - + Do not create a console window (-mwindows) 不产生控制台窗口(-mwindows) - + Strip executable (-s) 剥除附加信息(-s) @@ -5064,43 +5064,43 @@ Are you really want to continue? 链接Ojbective C程序(-lobjc) - + Output 输出 - + Put comments in generated assembly code (-fverbose-asm) 在生成的汇编代码中加入注释(-fverbose-asm) - + Use pipes instead of temporary files during compilation (-pipe) 编译时使用管道而不是临时文件(-pipe) - + Do not assemble, compile and generate the assemble code (-S) 只生成汇编代码(-S) - - + + Confirm 确认 - + The following problems were found during validation of compiler set "%1": 在验证编译器设置"%1"时遇到了下列问题: - + Compiler set not configuared. 未配置编译器设置。 - + Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? 您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2 @@ -6415,17 +6415,22 @@ Are you really want to continue? 在滚动页时少滚动一行 - + + Mouse Wheel Scroll Speed + 鼠标滚轮卷轴速度(行) + + + Show right edge line 显示右边缘线 - + Right egde width 右边缘宽度 - + Right edge line color 右边缘颜色 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 + + + + + + +