From 42594804711fc90f42f5d989b980ac7e551b7fc9 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Mon, 8 Nov 2021 21:19:48 +0800 Subject: [PATCH] - fix: correct set the position of chinese input methods --- NEWS.md | 3 +- RedPandaIDE/RedPandaIDE.pro | 3 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 104124 -> 104468 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 594 +++++++++--------- RedPandaIDE/editor.cpp | 49 +- RedPandaIDE/editor.h | 4 + RedPandaIDE/mainwindow.cpp | 36 +- RedPandaIDE/mainwindow.h | 5 + RedPandaIDE/qsynedit/SynEdit.cpp | 33 +- RedPandaIDE/qsynedit/SynEdit.h | 7 +- RedPandaIDE/settings.cpp | 2 +- .../editorcodecompletionwidget.cpp | 2 - .../environmentperformancewidget.cpp | 27 + .../environmentperformancewidget.h | 26 + .../environmentperformancewidget.ui | 50 ++ RedPandaIDE/settingsdialog/settingsdialog.cpp | 5 + 16 files changed, 516 insertions(+), 330 deletions(-) create mode 100644 RedPandaIDE/settingsdialog/environmentperformancewidget.cpp create mode 100644 RedPandaIDE/settingsdialog/environmentperformancewidget.h create mode 100644 RedPandaIDE/settingsdialog/environmentperformancewidget.ui diff --git a/NEWS.md b/NEWS.md index 1de5bc01..799d43e1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,8 @@ Version 0.8.2 For Dev-C++ 7 Beta - fix: highlighter can't correctly find the end of ANSI C-style Comments - enhancement: add default color scheme to themes. Change theme option will change color scheme too. - fix: when changing options in the option dialog's color scheme panle, color of the demo editor won't be not correctly updated - - enhancement: auto clear parsed symbols when the editor is hidden ( to reduce memory usage of un-active editors) + - enhancement: add option to auto clear parsed symbols when the editor is hidden ( to reduce total memory usage / turned off by default) + - fix: correct set the position of chinese input methods Version 0.8.1 For Dev-C++ 7 Beta - fix: ConsolePaurser.exe only exits when press ENTER diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index 6008b824..c3592332 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -55,6 +55,7 @@ SOURCES += \ settingsdialog/editortooltipswidget.cpp \ settingsdialog/environmentfileassociationwidget.cpp \ settingsdialog/environmentfolderswidget.cpp \ + settingsdialog/environmentperformancewidget.cpp \ settingsdialog/environmentshortcutwidget.cpp \ settingsdialog/executorproblemsetwidget.cpp \ settingsdialog/formattergeneralwidget.cpp \ @@ -176,6 +177,7 @@ HEADERS += \ settingsdialog/editortooltipswidget.h \ settingsdialog/environmentfileassociationwidget.h \ settingsdialog/environmentfolderswidget.h \ + settingsdialog/environmentperformancewidget.h \ settingsdialog/environmentshortcutwidget.h \ settingsdialog/executorproblemsetwidget.h \ settingsdialog/formattergeneralwidget.h \ @@ -267,6 +269,7 @@ FORMS += \ settingsdialog/editortooltipswidget.ui \ settingsdialog/environmentfileassociationwidget.ui \ settingsdialog/environmentfolderswidget.ui \ + settingsdialog/environmentperformancewidget.ui \ settingsdialog/environmentshortcutwidget.ui \ settingsdialog/executorproblemsetwidget.ui \ settingsdialog/formattergeneralwidget.ui \ diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index e07975b98710e31b547a72191c0f160bf5843413..0c2b609f31c54195b39ba8dac47cdc15c345eb9d 100644 GIT binary patch delta 9093 zcmZ{pby!qu6z1)V+Awv!jqF3;)MC9Mqz;iwAEGn=fPKMAupb^O5V?*b+PcHcZQkGsqLLIM z_s&FX?h*~zPqgk&BEQo_*YLZMMMO^)6Zuad`ig7(EcF=Dqnh#w3SxA7$2 z{XNmm4#bav`Te?>dGjgpvFq{s6T~msL-f#sc;j-oBcJ%yCnb^o9mVAE zIfCd$eQJLivE4eD9NY248oL{tb2f&&J~Vi0cVa`{(cnezh-Qm4c!@7D`^MzbIUAAY zPA&^i5R0lLmnBMK?Fz|dvz*vq@K{q~w%y6K#U^5H_v9KD z3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容超过了字符数限制! - + Print Document 打印文档 - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 - - + + Symbol '%1' not found! 未找到符号'%1'! - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -1856,6 +1856,24 @@ Are you really want to continue? 删除自定义设置失败 + + EnvironmentPerformanceWidget + + + Form + 表单 + + + + Reduce Memory Usage + 减少内存用量 + + + + Auto clear parsed symbols when editor hidden + 自动清理被隐藏的编辑器中的符号表 + + EnvironmentShortcutModel @@ -2838,11 +2856,11 @@ Are you really want to continue? - - - - - + + + + + Issues 编译器 @@ -2986,7 +3004,7 @@ Are you really want to continue? 工具栏2 - + New 新建 @@ -3044,10 +3062,10 @@ Are you really want to continue? - - - - + + + + Compile 编译 @@ -3093,8 +3111,8 @@ Are you really want to continue? - - + + Copy 复制 @@ -3105,7 +3123,7 @@ Are you really want to continue? - + Paste 粘贴 @@ -3116,7 +3134,7 @@ Are you really want to continue? - + Select All 选择全部 @@ -3235,14 +3253,14 @@ Are you really want to continue? - + Problem Set 试题集 - + New Problem Set 新建试题集 @@ -3261,14 +3279,14 @@ Are you really want to continue? - + Save Problem Set 保存试题集 - + Load Problem Set 载入试题集 @@ -3301,7 +3319,7 @@ Are you really want to continue? - + Problem 试题 @@ -3590,7 +3608,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -3691,7 +3709,7 @@ Are you really want to continue? - + Rename Symbol 重命名符号 @@ -3712,13 +3730,13 @@ Are you really want to continue? - + Export As RTF 导出为RTF - + Export As HTML 导出为HTML @@ -3774,7 +3792,7 @@ Are you really want to continue? - + Open Folder 打开文件夹 @@ -3784,42 +3802,42 @@ Are you really want to continue? 运行参数... - + File Encoding 文件编码 - + Recent Files 文件历史 - - - - - - + + + + + + Debugging 正在调试 - - - - - - + + + + + + Running 正在运行 - - - - - - + + + + + + Compiling 正在编译 @@ -3828,184 +3846,184 @@ Are you really want to continue? 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5 - + Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5 Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5 行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5 - + Read Only 只读 - + Insert 插入 - + Overwrite 覆写 - + Close project 关闭项目 - + Are you sure you want to close %1? 你确定要关闭'%1'吗? - - + + Confirm 确认 - - - + + + Source file is not compiled. 源文件尚未编译。 - - + + Compile now? 现在编译? - - - + + + Source file is more recent than executable. 源文件比可执行程序新。 - + Recompile now? 重新编译? - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 - - + + Enable debugging 启用调试参数 - - + + You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now? 当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题? - + Project not built 项目尚未构建 - + Project hasn't been built. Build it now? 项目尚未构建。是否构建? - + Host applcation missing 宿主程序不存在 - + DLL project needs a host application to run. 动态链接库(DLL)需要一个宿主程序来运行。 - + But it's missing. 但它不存在。 - + Host application not exists 宿主程序不存在 - + Host application file '%1' doesn't exist. 宿主程序'%1'不存在。 - + Recompile? 重新编译? - - + + Save last open info error 保存上次打开信息失败 - + Can't remove old last open information file '%1' 无法删除旧上次打开信息文件'%1' - + Can't save last open info file '%1' 无法保存上次打开信息文件'%1' - + Load last open info error 载入上次打开信息失败 - + Can't load last open info file '%1' 无法载入上次打开信息文件'%1' - + Copy all 全部复制 - - + + Clear 清除 - + Export 导出 - + Insert Snippet 插入代码段 - - + + Problem Set %1 试题集%1 @@ -4026,488 +4044,488 @@ Are you really want to continue? 或者选择使用其他的网络端口。 - + Red Panda Dev-C++ 小熊猫Dev-C++ - + Properties... 试题属性... - + Set Problem Set Name 设置试题集名称 - + Problem Set Name: 试题集名称: - + Remove 删除 - + Remove All Bookmarks 删除全部书签 - + Modify Description 修改描述 - - - + + + Bookmark Description 书签描述 - - - + + + Description: 描述: - + Show debug logs in the debug console 在调试主控台中显示调试器输出 - + Remove this search 清除这次搜索 - + Clear all searches 删除所有搜索 - + Breakpoint condition... 断点条件... - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Remove All Breakpoints Remove all breakpoints 删除所有断点 - + Remove Breakpoint 删除当前断点 - + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 - + Remove Folder 删除文件夹 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + Open in Editor 在编辑器中打开 - + Open in External Program 使用外部程序打开 - + Open in Terminal 在终端中打开 - + Open in Windows Explorer 在Windows浏览器中打开 - + Character sets 字符集 - + %1 files autosaved 已自动保存%1个文件 - + Set answer to... 设置答案源代码... - + select other file... 选择其他文件... - + Select Answer Source File 选择答案源代码文件 - + C/C++Source Files (*.c *.cpp *.cc *.cxx) C/C++Source Files (*.c *.cpp *.cc *.cxx C/C++源代码文件 (*.c *.cpp *.cc *.cxx) - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - - + + Do you want to save it? 需要保存吗? - - - - + + + + Save Error 保存失败 - + Change Project Compiler Set 改变项目编译器配置集 - + Change the project's compiler set will lose all custom compiler set options. 改变项目的编译器配置集会导致所有的自定义编译器选项被重置。 - + Do you really want to do that? 你真的想要做那些吗? - + Do you really want to clear all breakpoints in this file? 您真的要清除该文件的所有断点吗? - + New project 新建项目 - + Close %1 and start new project? 关闭'%1'以打开新项目? - + Folder not exist 文件夹不存在 - + Folder '%1' doesn't exist. Create it now? 文件夹'%1'不存在。是否创建? - + Can't create folder 无法创建文件夹 - + Failed to create folder '%1'. 创建文件夹'%1'失败。 - + Save new project as - + Red panda Dev-C++ project file (*.dev) 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + untitled 无标题 - + New Project File Name 新的项目文件名 - + File Name: 文件名: - + File Already Exists! 文件已存在! - + File '%1' already exists! 文件'%1'已经存在! - + Add to project 添加到项目 - + Rename Error 重命名出错 - + Symbol '%1' is defined in system header. 符号'%1'在系统头文件中定义,无法修改。 - + New Name 新名称 - - + + Replace Error 替换出错 - + Can't open file '%1' for replace! 无法打开文件'%1'进行替换! - + Contents has changed since last search! 内容和上次查找时不一致。 - + Rich Text Format Files (*.rtf) RTF格式文件 (*.rtf) - + HTML Files (*.html) HTML文件 (*.html) - + The current problem set is not empty. 当前的试题集不是空的。 - + Problem %1 试题%1 - + Problem Set Files (*.pbs) 试题集文件 (*.pbs) - + Load Error 载入失败 - - + + Problem Case %1 试题案例%1 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Error 错误 - + Recent Projects 项目历史 - + File '%1' was changed. 磁盘文件'%1'已被修改。 - + Reload its content from disk? 是否重新读取它的内容? - + File '%1' was removed. 磁盘文件'%1'已被删除。 - + Keep it open? 是否保持它在小熊猫C++中打开的编辑窗口? - + Open 打开 - + Compile Failed 编译失败 - + Run Failed 运行失败 - - + + Confirm Convertion 确认转换 - - + + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 - + Enter Watch Expression (it is recommended to use 'this->' for class members): 输入监视表达式 - + Parsing file %1 of %2: "%3" (%1/%2)正在解析文件"%3" - - + + Done parsing %1 files in %2 seconds 完成%1个文件的解析,用时%2秒 - + (%1 files per second) (每秒%1个文件) @@ -6371,214 +6389,220 @@ Are you really want to continue? 取消 - + Appearence 外观 - - - - + + + + + Environment 环境 - + File Association 文件关联 - + Shortcuts 快捷键 - + Folders 文件夹 - - + + Performance + 性能 + + + + Compiler Set 编译器配置集 - - + + Compiler 编译器 - + Auto Link 自动链接 - - - - - - - + + + + + + + General 通用 - - - - - - - - - - - + + + + + + + + + + + Editor 编辑器 - + Font 字体 - + Copy & Export 复制/导出 - + Color 配色 - + Code Completion 代码补全 - + Symbol Completion 符号补全 - + Snippet 代码模板 - + Auto Syntax Checking 自动语法检查 - + Tooltips 信息提示 - + Auto save 自动保存 - + Misc 杂项 - - - + + + Program Runner 程序运行 - + Problem Set 试题集 - + Debugger 调试器 - + Code Formatter 代码排版 - + Tools 工具 - - - - - - - - - - + + + + + + + + + + Project 项目 - + Files 文件 - + Custom Compile options 自定义编译选项 - + Directories 文件夹 - + Precompiled Header 预编译头文件 - + Makefile Makefile - + Output 输出 - + DLL host DLL宿主 - + Version info 版本信息 - + Save Changes 保存修改 - + There are changes in the settings, do you want to save them before swtich to other page? 本页中有尚未保存的设置修改,是否保存后再切换到其他页? diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 97f48216..794aa1fb 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -1375,7 +1375,11 @@ void Editor::onStatusChanged(SynStatusChanges changes) && !changes.testFlag(SynStatusChange::scReadOnly) && changes.testFlag(SynStatusChange::scCaretY))) { mCurrentLineModified = false; - reparse(); + if (pSettings->codeCompletion().clearWhenEditorHidden() + && changes.testFlag(SynStatusChange::scOpenFile)) { + } else{ + reparse(); + } if (pSettings->editor().syntaxCheckWhenLineChanged()) checkSyntaxInBack(); reparseTodo(); @@ -1458,28 +1462,7 @@ void Editor::onStatusChanged(SynStatusChanges changes) } else { mCurrentHighlightedWord = ""; } -// mSelectionWord=""; -// if (selAvail()) { -// BufferCoord wordBegin,wordEnd,bb,be; -// bb = blockBegin(); -// be = blockEnd(); -// wordBegin = wordStartEx(bb); -// wordEnd = wordEndEx(be); -// if (wordBegin.Line == bb.Line -// && wordBegin.Char == bb.Char -// && wordEnd.Line == be.Line -// && wordEnd.Char == be.Char) { -// if (wordBegin.Line>=1 && wordBegin.Line<=lines()->count()) { -// QString line = lines()->getString(wordBegin.Line-1); -// mSelectionWord = line.mid(wordBegin.Char-1,wordEnd.Char-wordBegin.Char); -// } -// } -//// qDebug()<editor().showFunctionTips()) { updateFunctionTip(); } -// fFunctionTip.ForceHide := false; -// if Assigned(fFunctionTipTimer) then begin -// if fFunctionTip.Activated and FunctionTipAllowed then begin -// fFunctionTip.Parser := fParser; -// fFunctionTip.FileName := fFileName; -// fFunctionTip.Show; -// end else begin // Reset the timer -// fFunctionTipTimer.Enabled := false; -// fFunctionTipTimer.Enabled := true; -// end; } @@ -3148,6 +3121,16 @@ void Editor::onExportedFormatToken(PSynHighlighter syntaxHighlighter, int Line, } } +const QDateTime &Editor::hideTime() const +{ + return mHideTime; +} + +void Editor::setHideTime(const QDateTime &newHideTime) +{ + mHideTime = newHideTime; +} + const std::shared_ptr > > &Editor::statementColors() const { return mStatementColors; diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h index 9380cc6f..52b07f33 100644 --- a/RedPandaIDE/editor.h +++ b/RedPandaIDE/editor.h @@ -261,6 +261,7 @@ private: TipType mCurrentTipType; QString mOldHighlightedWord; QString mCurrentHighlightedWord; + QDateTime mHideTime; bool mSaving; bool mCurrentLineModified; @@ -308,6 +309,9 @@ public: const std::shared_ptr > > &statementColors() const; void setStatementColors(const std::shared_ptr > > &newStatementColors); + const QDateTime &hideTime() const; + void setHideTime(const QDateTime &newHideTime); + protected: void mouseReleaseEvent(QMouseEvent *event) override; diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 7e77a612..e602df08 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -60,6 +60,7 @@ MainWindow::MainWindow(QWidget *parent) mOpenClosingLeftPanel(false), mShouldRemoveAllSettings(false), mClosing(false), + mOpenningFiles(false), mSystemTurnedOff(false) { ui->setupUi(this); @@ -727,7 +728,7 @@ void MainWindow::rebuildOpenedFileHisotryMenu() for (const QString& filename: pSettings->history().openedFiles()) { QAction* action = new QAction(filename,mMenuRecentFiles); connect(action, &QAction::triggered, [&filename,this](bool){ - this->openFile(filename); + openFile(filename); }); mMenuRecentFiles->addAction(action); } @@ -843,8 +844,12 @@ void MainWindow::updateStatusbarMessage(const QString &s) void MainWindow::openFiles(const QStringList &files) { mEditorList->beginUpdate(); + mOpenningFiles = true; auto end = finally([this] { this->mEditorList->endUpdate(); + mOpenningFiles = false; + updateEditorParser(ui->EditorTabsLeft); + updateEditorParser(ui->EditorTabsRight); }); //Check if there is a project file in the list and open it for (const QString& file:files) { @@ -4772,8 +4777,10 @@ PSymbolUsageManager &MainWindow::symbolUsageManager() return mSymbolUsageManager; } -static void updateEditorParser(QTabWidget* tabWidget, - Editor* editor) { +void MainWindow::updateEditorParser(QTabWidget* tabWidget) { + if (mOpenningFiles) + return; + Editor * editor = mEditorList->getEditor(-1,tabWidget); if (pSettings->codeCompletion().clearWhenEditorHidden()) { for (int i=0;icount();i++) { Editor * e = (Editor*)(tabWidget->widget(i)); @@ -4790,13 +4797,26 @@ static void updateEditorParser(QTabWidget* tabWidget, } } +void MainWindow::updateEditorHideTime(QTabWidget* tabWidget) { + Editor * editor = mEditorList->getEditor(-1,tabWidget); + for (int i=0;icount();i++) { + Editor * e = (Editor*)(tabWidget->widget(i)); + if (e!=editor) { + if (!e->hideTime().isValid()) + e->setHideTime(QDateTime::currentDateTime()); + } else { + e->setHideTime(QDateTime()); + } + } +} void MainWindow::on_EditorTabsLeft_currentChanged(int) { Editor * editor = mEditorList->getEditor(-1,ui->EditorTabsLeft); if (editor) { editor->reparseTodo(); } - updateEditorParser(ui->EditorTabsLeft,editor); + updateEditorParser(ui->EditorTabsLeft); + updateEditorHideTime(ui->EditorTabsLeft); } @@ -4806,7 +4826,8 @@ void MainWindow::on_EditorTabsRight_currentChanged(int) if (editor) { editor->reparseTodo(); } - updateEditorParser(ui->EditorTabsRight,editor); + updateEditorParser(ui->EditorTabsRight); + updateEditorHideTime(ui->EditorTabsRight); } @@ -5383,3 +5404,8 @@ void MainWindow::on_btnOpenProblemAnswer_clicked() } } +bool MainWindow::openningFiles() const +{ + return mOpenningFiles; +} + diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index db3b793a..f91c58a9 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -155,6 +155,8 @@ public: void openProject(const QString& filename); void changeOptions(const QString& widgetName=QString(), const QString& groupName=QString()); + bool openningFiles() const; + public slots: void onCompileLog(const QString& msg); void onCompileIssue(PCompileIssue issue); @@ -212,6 +214,8 @@ private: void doCompileRun(RunType runType); void updateProblemCaseOutput(POJProblemCase problemCase); void applyCurrentProblemCaseChanges(); + void updateEditorParser(QTabWidget* tabWidget); + void updateEditorHideTime(QTabWidget* tabWidget); private slots: void onAutoSaveTimeout(); @@ -534,6 +538,7 @@ private: CaretList mCaretList; bool mClosing; + bool mOpenningFiles; bool mSystemTurnedOff; QPoint mEditorContextMenuPos; QTcpServer mTcpServer; diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 3481ac33..3497183a 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -2404,7 +2404,7 @@ bool SynEdit::canDoBlockIndent() return true; } -QRect SynEdit::calculateCaretRect() +QRect SynEdit::calculateCaretRect() const { DisplayCoord coord = displayXY(); if (!mInputPreeditString.isEmpty()) { @@ -2419,7 +2419,19 @@ QRect SynEdit::calculateCaretRect() caretWidth = charColumns(mLines->getString(mCaretY-1)[mCaretX-1])*mCharWidth; } return QRect(caretPos.x(),caretPos.y(),caretWidth, - mTextHeight); + mTextHeight); +} + +QRect SynEdit::calculateInputCaretRect() const +{ + DisplayCoord coord = displayXY(); + QPoint caretPos = rowColumnToPixels(coord); + int caretWidth=mCharWidth; + if (mCaretY <= mLines->count() && mCaretX <= mLines->getString(mCaretY-1).length()) { + caretWidth = charColumns(mLines->getString(mCaretY-1)[mCaretX-1])*mCharWidth; + } + return QRect(caretPos.x(),caretPos.y(),caretWidth, + mTextHeight); } void SynEdit::clearAreaList(SynEditingAreaList areaList) @@ -2946,6 +2958,10 @@ void SynEdit::setStatusChanged(SynStatusChanges changes) void SynEdit::doOnStatusChange(SynStatusChanges) { + if (mStatusChanges.testFlag(SynStatusChange::scCaretX) + || mStatusChanges.testFlag(SynStatusChange::scCaretY)) { + qApp->inputMethod()->update(Qt::ImCursorPosition); + } emit statusChanged(mStatusChanges); mStatusChanges = SynStatusChange::scNone; } @@ -6039,6 +6055,19 @@ bool SynEdit::viewportEvent(QEvent * event) return QAbstractScrollArea::viewportEvent(event); } +QVariant SynEdit::inputMethodQuery(Qt::InputMethodQuery property) const +{ + QRect rect = calculateInputCaretRect(); + + switch(property) { + case Qt::ImCursorRectangle: + return rect; + default: + return QWidget::inputMethodQuery(property); + } + +} + int SynEdit::maxScrollHeight() const { if (mOptions.testFlag(eoScrollPastEof)) diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h index 634aac11..234c6637 100644 --- a/RedPandaIDE/qsynedit/SynEdit.h +++ b/RedPandaIDE/qsynedit/SynEdit.h @@ -524,7 +524,8 @@ private: BufferCoord getPreviousLeftBrace(int x,int y); bool canDoBlockIndent(); - QRect calculateCaretRect(); + QRect calculateCaretRect() const; + QRect calculateInputCaretRect() const; //Commands void doDeleteLastChar(); @@ -717,6 +718,10 @@ void wheelEvent(QWheelEvent *event) override; // QAbstractScrollArea interface protected: bool viewportEvent(QEvent * event) override; + +// QWidget interface +public: +QVariant inputMethodQuery(Qt::InputMethodQuery property) const override; }; #endif // SYNEDIT_H diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index bae75365..7b9cd538 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -3262,7 +3262,7 @@ void Settings::CodeCompletion::doLoad() mIgnoreCase = boolValue("ignore_case",true); mAppendFunc = boolValue("append_func",true); mShowCodeIns = boolValue("show_code_ins",true); - mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",true); + mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",false); } Settings::CodeFormatter::CodeFormatter(Settings *settings): diff --git a/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp b/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp index 1547ac0d..07eac772 100644 --- a/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp +++ b/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp @@ -34,7 +34,6 @@ void EditorCodeCompletionWidget::doLoad() ui->chkIgnoreCases->setChecked(pSettings->codeCompletion().ignoreCase()); ui->chkAppendFunc->setChecked(pSettings->codeCompletion().appendFunc()); ui->chkShowCodeIns->setChecked(pSettings->codeCompletion().showCodeIns()); - ui->chkClearWhenEditorHidden->setChecked(pSettings->codeCompletion().clearWhenEditorHidden()); } void EditorCodeCompletionWidget::doSave() @@ -55,7 +54,6 @@ void EditorCodeCompletionWidget::doSave() pSettings->codeCompletion().setIgnoreCase(ui->chkIgnoreCases->isChecked()); pSettings->codeCompletion().setAppendFunc(ui->chkAppendFunc->isChecked()); pSettings->codeCompletion().setShowCodeIns(ui->chkShowCodeIns->isChecked()); - pSettings->codeCompletion().setClearWhenEditorHidden(ui->chkClearWhenEditorHidden->isChecked()); pSettings->codeCompletion().save(); } diff --git a/RedPandaIDE/settingsdialog/environmentperformancewidget.cpp b/RedPandaIDE/settingsdialog/environmentperformancewidget.cpp new file mode 100644 index 00000000..d7c453d3 --- /dev/null +++ b/RedPandaIDE/settingsdialog/environmentperformancewidget.cpp @@ -0,0 +1,27 @@ +#include "environmentperformancewidget.h" +#include "ui_environmentperformancewidget.h" +#include "../settings.h" + +EnvironmentPerformanceWidget::EnvironmentPerformanceWidget(const QString& name, const QString& group, QWidget *parent) : + SettingsWidget(name,group,parent), + ui(new Ui::EnvironmentPerformanceWidget) +{ + ui->setupUi(this); +} + +EnvironmentPerformanceWidget::~EnvironmentPerformanceWidget() +{ + delete ui; +} + +void EnvironmentPerformanceWidget::doLoad() +{ + ui->chkClearWhenEditorHidden->setChecked(pSettings->codeCompletion().clearWhenEditorHidden()); +} + +void EnvironmentPerformanceWidget::doSave() +{ + pSettings->codeCompletion().setClearWhenEditorHidden(ui->chkClearWhenEditorHidden->isChecked()); + + pSettings->codeCompletion().save(); +} diff --git a/RedPandaIDE/settingsdialog/environmentperformancewidget.h b/RedPandaIDE/settingsdialog/environmentperformancewidget.h new file mode 100644 index 00000000..0162adde --- /dev/null +++ b/RedPandaIDE/settingsdialog/environmentperformancewidget.h @@ -0,0 +1,26 @@ +#ifndef ENVIRONMENTPERFORMANCEWIDGET_H +#define ENVIRONMENTPERFORMANCEWIDGET_H + +#include +#include "settingswidget.h" + +namespace Ui { +class EnvironmentPerformanceWidget; +} + +class EnvironmentPerformanceWidget : public SettingsWidget +{ + Q_OBJECT + +public: + explicit EnvironmentPerformanceWidget(const QString& name, const QString& group, QWidget *parent = nullptr); + ~EnvironmentPerformanceWidget(); + + void doLoad() override; + void doSave() override; + +private: + Ui::EnvironmentPerformanceWidget *ui; +}; + +#endif // ENVIRONMENTPERFORMANCEWIDGET_H diff --git a/RedPandaIDE/settingsdialog/environmentperformancewidget.ui b/RedPandaIDE/settingsdialog/environmentperformancewidget.ui new file mode 100644 index 00000000..8d88a084 --- /dev/null +++ b/RedPandaIDE/settingsdialog/environmentperformancewidget.ui @@ -0,0 +1,50 @@ + + + EnvironmentPerformanceWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + Reduce Memory Usage + + + + + + Auto clear parsed symbols when editor hidden + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/RedPandaIDE/settingsdialog/settingsdialog.cpp b/RedPandaIDE/settingsdialog/settingsdialog.cpp index 4547eba3..19fda5df 100644 --- a/RedPandaIDE/settingsdialog/settingsdialog.cpp +++ b/RedPandaIDE/settingsdialog/settingsdialog.cpp @@ -18,6 +18,7 @@ #include "environmentshortcutwidget.h" #include "environmentfileassociationwidget.h" #include "environmentfolderswidget.h" +#include "environmentperformancewidget.h" #include "executorgeneralwidget.h" #include "executorproblemsetwidget.h" #include "debuggeneralwidget.h" @@ -114,6 +115,10 @@ PSettingsDialog SettingsDialog::optionDialog() widget->init(); dialog->addWidget(widget); + widget = new EnvironmentPerformanceWidget(tr("Performance"),tr("Environment")); + widget->init(); + dialog->addWidget(widget); + connect((EnvironmentFoldersWidget*)widget, &EnvironmentFoldersWidget::shouldQuitApp, dialog.get(),