From b5a450312a1b61fd00101c5287191de227062cb7 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 23 Dec 2021 00:24:52 +0800 Subject: [PATCH] - refactor: icon manager - work save: icons in the dialogs --- RedPandaIDE/RedPandaIDE_zh_CN.ts | 1218 +++++++++-------- RedPandaIDE/editor.cpp | 12 +- RedPandaIDE/icons.qrc | 2 + RedPandaIDE/iconsmanager.cpp | 215 +-- RedPandaIDE/iconsmanager.h | 17 +- RedPandaIDE/images/newlook/004-addsrc.svg | 241 ---- RedPandaIDE/images/newlook/005-arricon.svg | 181 --- .../images/newlook/00Misc-04Remove.svg | 4 +- .../{007-bughlp.svg => 00Misc-10Check.svg} | 0 .../{008-close.svg => 00Misc-11Rename.svg} | 34 +- RedPandaIDE/images/newlook/011-clrhist.svg | 112 -- RedPandaIDE/mainwindow.cpp | 203 ++- RedPandaIDE/project.cpp | 2 +- .../settingsdialog/compilerautolinkwidget.cpp | 7 + .../settingsdialog/compilerautolinkwidget.h | 4 + .../settingsdialog/compilerautolinkwidget.ui | 10 +- .../compilersetdirectorieswidget.cpp | 10 + .../compilersetdirectorieswidget.h | 2 + .../compilersetdirectorieswidget.ui | 4 +- .../compilersetoptionwidget.cpp | 15 + .../settingsdialog/compilersetoptionwidget.h | 1 + .../settingsdialog/compilersetoptionwidget.ui | 49 +- RedPandaIDE/settingsdialog/settingswidget.cpp | 15 +- RedPandaIDE/settingsdialog/settingswidget.h | 3 + RedPandaIDE/widgets/classbrowser.cpp | 34 +- RedPandaIDE/widgets/cpudialog.cpp | 7 +- 26 files changed, 1004 insertions(+), 1398 deletions(-) delete mode 100644 RedPandaIDE/images/newlook/004-addsrc.svg delete mode 100644 RedPandaIDE/images/newlook/005-arricon.svg rename RedPandaIDE/images/newlook/{007-bughlp.svg => 00Misc-10Check.svg} (100%) rename RedPandaIDE/images/newlook/{008-close.svg => 00Misc-11Rename.svg} (55%) delete mode 100644 RedPandaIDE/images/newlook/011-clrhist.svg diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index c52c8509..ce86925a 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -72,22 +72,22 @@ AutolinkModel - + Header 头文件 - + Link options 链接参数 - + Header exists 头文件已存在 - + Header already exists. 头文件已存在。 @@ -200,26 +200,28 @@ + Step over one machine instruction 单步执行一条机器指令 - + + Step into one machine instruction 单步进入一条机器指令 - + AT&&T AT&&T - + Intel Intel - + Blend Mode 混合模式 @@ -552,12 +554,22 @@ - - ... - ... + + Add + 添加 - + + + Remove + 删除 + + + ... + ... + + + Save failed. 保存失败。 @@ -623,8 +635,12 @@ + Remove + 删除 + + Delete - 删除 + 删除 @@ -633,7 +649,7 @@ 删除非法文件夹 - + Choose Folder 选择文件夹 @@ -651,132 +667,157 @@ 编译器配置方案 - - - - - - - + + ... ... - + General 基本选项 - + Add the following arguments when calling the compiler 编译时加入下列选项: - + Add the following arguments when calling the linker 链接时加入下列选项 - + Add Charset arguments when calling the compiler 编译时自动加入字符编码选项 - + + + Auto Find Compilers + + + + + + Find Compiler in the Folder + + + + + + Add Blank Compiler Set + + + + + + Rename + + + + + + Remove + 删除 + + + Statically link libraries 静态链接所有库 - + Settings 编译/链接选项 - + Directories 文件夹 - + Programs 程序 - + TextLabel 选项 - + Resource Compiler(windres) 资源编辑器(winres) - + C++ Compiler(g++) C++编译器(g++) - + Choose C++ Compiler 选择C++编译器 - + Choose C Compiler 选择C编译器 - + C Compiler(gcc) C编译器(gcc) - + Debugger(gdb) 调试器(gdb) - + Profiler(gprof) 性能分析器(gprof) - + make - + Choose make 选择make - + Choose Debugger 选择调试器 - + Choose Resource Compiler 选择资源编译器 - + Choose Profiler 选择性能分析器 - + Confirm 确认 - + Red Panda C++ will clear current compiler list and search for compilers in the following locations: '%1' '%2' @@ -787,35 +828,35 @@ Are you really want to continue? 你确定要继续吗? - - + + Failed 失败 - - + + Can't find any compiler. 找不到编译器 - - + + Compiler Set Name 编译器配置名称 - + Name 名称 - + Compiler Set Folder 编译器所在文件夹 - + New name 新名称 @@ -823,18 +864,18 @@ Are you really want to continue? CppRefacter - - + + Rename Symbol Error 重命名符号失败 - + Can't rename symbols not defined in this file. 无法重命名不在本文件中定义的符号 - + New symbol already exists! 新符号名称已被使用! @@ -1049,10 +1090,10 @@ Are you really want to continue? - - - - + + + + Error 错误 @@ -1066,55 +1107,55 @@ Are you really want to continue? 另存为 - + The text to be copied exceeds count limit! 要复制的内容超过了行数限制! - + The text to be copied exceeds character limit! 要复制的内容超过了字符数限制! - + The text to be cut exceeds count limit! 要剪切的内容超过了行数限制! - + The text to be cut exceeds character limit! 要剪切的内容超过了字符数限制! - + Print Document 打印文档 - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 - - + + Symbol '%1' not found! 未找到符号'%1'! - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -2759,32 +2800,27 @@ Are you really want to continue? InitChooseLanguageWidget - Dialog - 对话框 + 对话框 InitWizardDialog - Dialog - 对话框 + 对话框 - Previous - 前一步 + 前一步 - Next - 下一步 + 下一步 - Finish - 完成 + 完成 @@ -2935,18 +2971,18 @@ Are you really want to continue? - - - - - - + + + + + + Issues 编译器 - + Compile Log 编译日志 @@ -2961,38 +2997,38 @@ Are you really want to continue? 工具 - - + + Run 运行 - + Edit 编辑 - - + + Project 项目 - + Watch 监视 - + Structure 结构 - + Files 文件 @@ -3002,10 +3038,10 @@ Are you really want to continue? - - - - + + + + Debug 调试 @@ -3016,7 +3052,7 @@ Are you really want to continue? - + Debug Console 调试主控台 @@ -3037,8 +3073,8 @@ Are you really want to continue? - - + + Search 查找 @@ -3063,7 +3099,7 @@ Are you really want to continue? 替换 - + Close 关闭 @@ -3073,13 +3109,13 @@ Are you really want to continue? 运行 - - + + Code 代码 - + Window 窗口 @@ -3092,262 +3128,262 @@ Are you really want to continue? 工具栏2 - + New 新建 - + Ctrl+N Ctrl+N - + Open... 打开... - + Ctrl+O Ctrl+O - + Save 保存 - + Ctrl+S Ctrl+S - + Save As... 另存为... - + Save As 另存为 - + Save All 全部保存 - + Ctrl+Shift+S Ctrl+Shift+S - + Options 选项 - - - - - + + + + + Compile 编译 - + F9 F9 - + F10 F10 - + Undo 恢复 - + Ctrl+Z Ctrl+Z - + Redo 重做 - + Ctrl+Y Ctrl+Y - + Cut 剪切 - + Ctrl+X Ctrl+X - - - + + + Copy 复制 - + Ctrl+C Ctrl+C - - + + Paste 粘贴 - + Ctrl+V Ctrl+V - - + + Select All 选择全部 - + Ctrl+A Ctrl+A - + Indent 缩进 - + UnIndent 取消缩进 - + Toggle Comment 切换注释 - + Ctrl+/ Ctrl+/ - + Collapse All 全部收起 - + Uncollapse All 全部展开 - + Encode in ANSI 使用ANSI编码 - + Encode in UTF-8 使用UTF-8编码 - + Auto Detect 自动检测 - + Convert to ANSI 转换为ANSI编码 - + Convert to UTF-8 转换为UTF-8编码 - - + + Compile & Run 编译运行 - + F11 F11 - - + + Rebuild All 全部重编译 - + F12 F12 - + Stop Execution 停止执行 - + F6 F6 - + F5 F5 - + Step Over 单步跳过 - + F7 F7 - + Step Into 单步进入 - - + + Problem Set 试题集 - + New Problem Set 新建试题集 @@ -3366,14 +3402,14 @@ Are you really want to continue? - + Save Problem Set 保存试题集 - + Load Problem Set 载入试题集 @@ -3395,21 +3431,21 @@ Are you really want to continue? - + TODO TODO - + Bookmark 书签 - - + + Problem 试题 @@ -3465,419 +3501,419 @@ Are you really want to continue? 期望输出 - + Help 帮助 - + Refactor 重构 - + View 视图 - + Tool Windows 工具窗口 - + Main 主工具栏 - + Compiler Set 编译器配置集 - - + + New Source File 新建源代码文件 - + Tab Tab - + Shift+Tab Shift+Tab - + F8 F8 - + Step Out 单步跳出 - + Ctrl+F8 Ctrl+F8 - + Run To Cursor 执行到光标处 - + Ctrl+F5 Ctrl+F5 - + Continue 继续执行 - + F4 F4 - + Add Watch... 添加监视 - + View CPU Window... 打开CPU信息窗口... - + Exit 退出 - + Find... 查找... - + Ctrl+F Ctrl+F - + Find in Files... 在文件中查找... - + Ctrl+Shift+F Ctrl+Shift+F - + Replace... 替换 - + Ctrl+R Ctrl+R - + Find Next 查找下一个 - + F3 F3 - + Find Previous 查找前一个 - + Shift+F3 Shift+F3 - + Remove Watch 删除监视值 - + Remove All Watches Remove All 删除全部监视值 - + Modify Watch... 修改监视值 - + Reformat Code 对代码重新排版 - + Ctrl+Shift+A Ctrl+Shift+A - + Go back 前一次编辑位置 - + Ctrl+Alt+Left Ctrl+Alt+Left - + Forward 后一次编辑位置 - + Ctrl+Alt+Right Ctrl+Alt+Right - + Ctrl+W Ctrl+W - + Close All 全部关闭 - + Ctrl+Shift+W Ctrl+Shift+W - + Maximize Editor 最大化编辑器 - + Ctrl+F11 Ctrl+F11 - + Next 下一窗口 - + Ctrl+Tab Ctrl+Tab - + Previous 前一窗口 - + Ctrl+Shift+Tab Ctrl+Shift+Tab - + Toggle breakpoint 切换断点 - + Ctrl+F4 Ctrl+F4 - - + + Clear all breakpoints 删除所有断点 - + Breakpoint property... 设置断点条件... - + Goto Declaration 跳转到声明处 - + Goto Definition 跳转到定义处 - + Find references 查找符号的引用 - + Open containing folder 打开所在的文件夹 - + Ctrl+B Ctrl+B - + Open a terminal here 打开命令行窗口 - + File Properties... 文件属性... - + Close Project 关闭项目 - + Project options 项目属性 - + New Project... 新建项目... - + New File 新建项目文件 - + Add to project... 添加到项目... - + Remove from project 从项目删除 - + View Makefile 查看Makefile - + Clean 清理构建文件 - + Open Folder in Explorer 在浏览器中打开 - + Open In Terminal 在终端中打开 - + About 关于 - - + + Rename Symbol 重命名符号 - + Shift+F6 Shift+F6 - + Print... 打印... - + Ctrl+P Ctrl+P - - + + Export As RTF 导出为RTF - - + + Export As HTML 导出为HTML - + Move To Other View 移动到其他视图 - + Ctrl+M Ctrl+M - - + + C++ Reference C++参考手册 - + C Reference C参考手册 - + Tool Window Bars 工具窗口栏 - + Status Bar 状态栏 - + Ctrl+Backspace Ctrl+Backspace @@ -3886,47 +3922,47 @@ Are you really want to continue? 插入行 - + Delete Line 删除当前行 - + Ctrl+D Ctrl+D - + Duplicate Line 复制当前行 - + Ctrl+E Ctrl+E - + Delete Word 删除当前单词 - + Ctrl+Shift+D Ctrl+Shift+D - + Delete to EOL 删除到行尾 - + Ctrl+Del Ctrl+Del - + Delete to BOL 删除到行首 @@ -3935,78 +3971,78 @@ Are you really want to continue? C/C++参考 - + EGE Manual EGE图形库手册 - + Add Bookmark 添加书签 - + Remove Bookmark 删除书签 - + Modify Bookmark Description 修改书签说明 - + Locate in Files View 在文件视图中定位 - - + + Open Folder 打开文件夹 - + Running Parameters... 运行参数... - + File Encoding 文件编码 - + Recent Files 文件历史 - - - - - - + + + + + + Debugging 正在调试 - - - - - - + + + + + + Running 正在运行 - - - - - - + + + + + + Compiling 正在编译 @@ -4015,188 +4051,188 @@ 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' - + Show detail debug logs 显示详细调试器日志 - + Copy all 全部复制 - - + + Clear 清除 - + Export 导出 - + Insert Snippet 插入代码段 - - + + Problem Set %1 试题集%1 @@ -4217,73 +4253,73 @@ Are you really want to continue? 或者选择使用其他的网络端口。 - + Red Panda Dev-C++ 小熊猫Dev-C++ - - + + Rebuild Project 重新构建项目 - - + + Project has been modified, do you want to rebuild it? 项目已经被修改过,是否需要重新构建? - + Auto Save Error 自动保存出错 - + Auto save "%1" to "%2" failed:%3 自动保存"%1"到"%2"失败:%3 - + Properties... 试题属性... - + Set Problem Set Name 设置试题集名称 - + Problem Set Name: 试题集名称: - + Remove 删除 - + Remove All Bookmarks 删除全部书签 - + Modify Description 修改描述 - - - + + + Bookmark Description 书签描述 - - - + + + Description: 描述: @@ -4292,460 +4328,460 @@ Are you really want to continue? 在调试主控台中显示调试器输出 - + 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? 需要保存吗? - - + + File Changed 文件已发生变化 - + New Project File? 新建项目文件? - + Do you want to add the new file to the project? 您是否要将新建的文件加入项目? - - - - + + + + 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 无法使用模板创建项目 - + Remove file 删除文件 - + Remove the file from disk? 同时从硬盘上删除文件? - + 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个文件) @@ -5654,175 +5690,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) @@ -5831,84 +5867,84 @@ 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"时遇到了下列问题: - + Would you like Red Panda C++ to remove them for you and add the default paths to the valid paths? 是否让小熊猫C++删除这些配置,并尝试重新建立配置? - + Leaving those directories will lead to problems during compilation.<br /><br />Unless you know exactly what you're doing, it is recommended that you click Yes. 如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果, - + 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 - + Binaries 二进制文件 - + Libraries 库文件 - + C Includes C包含文件 - + C++ Includes C++包含文件 - + No - + Yes @@ -5920,27 +5956,27 @@ Are you really want to continue? 无标题 - + Index %1 out of range 下标"%1"越界 - + bytes 字节 - + KB KB - + MB MB - + GB GB @@ -6229,12 +6265,12 @@ Are you really want to continue? 无标题 - + constructor 构造函数 - + destructor 析构函数 @@ -6597,7 +6633,7 @@ Are you really want to continue? SettingsDialog - + Options 选项 @@ -6623,69 +6659,68 @@ Are you really want to continue? 取消 - + Appearence 外观 - + Environment 环境 - + File Association 文件关联 - + Shortcuts 快捷键 - + Folders 文件夹 - + Performance 性能 - - + + Compiler Set 编译器配置集 - + Compiler 编译器 - + Auto Link 自动链接 - - - - + + + - + + General 通用 - @@ -6696,95 +6731,95 @@ Are you really want to continue? + 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 Options 项目选项 - @@ -6794,56 +6829,57 @@ Are you really want to continue? + 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? 本页中有尚未保存的设置修改,是否保存后再切换到其他页? @@ -6851,12 +6887,12 @@ Are you really want to continue? SettingsWidget - + Load Error 载入失败 - + Save Error 保存失败 diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 531c65af..8c41500b 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -785,12 +785,12 @@ void Editor::keyPressEvent(QKeyEvent *event) void Editor::onGutterPaint(QPainter &painter, int aLine, int X, int Y) { - IconsManager::PIcon icon; + IconsManager::PPixmap icon; if (mActiveBreakpointLine == aLine) { - icon = pIconsManager->getIcon(IconsManager::GUTTER_ACTIVEBREAKPOINT); + icon = pIconsManager->getPixmap(IconsManager::GUTTER_ACTIVEBREAKPOINT); } else if (hasBreakpoint(aLine)) { - icon = pIconsManager->getIcon(IconsManager::GUTTER_BREAKPOINT); + icon = pIconsManager->getPixmap(IconsManager::GUTTER_BREAKPOINT); } else { PSyntaxIssueList lst = getSyntaxIssuesAtLine(aLine); if (lst) { @@ -802,12 +802,12 @@ void Editor::onGutterPaint(QPainter &painter, int aLine, int X, int Y) } } if (hasError) { - icon = pIconsManager->getIcon(IconsManager::GUTTER_SYNTAX_ERROR); + icon = pIconsManager->getPixmap(IconsManager::GUTTER_SYNTAX_ERROR); } else { - icon = pIconsManager->getIcon(IconsManager::GUTTER_SYNTAX_WARNING); + icon = pIconsManager->getPixmap(IconsManager::GUTTER_SYNTAX_WARNING); } } else if (hasBookmark(aLine)) { - icon = pIconsManager->getIcon(IconsManager::GUTTER_BOOKMARK); + icon = pIconsManager->getPixmap(IconsManager::GUTTER_BOOKMARK); } } if (icon) { diff --git a/RedPandaIDE/icons.qrc b/RedPandaIDE/icons.qrc index 06debcdc..b77d9cfc 100644 --- a/RedPandaIDE/icons.qrc +++ b/RedPandaIDE/icons.qrc @@ -205,5 +205,7 @@ images/newlook/05Run-14StepOverInstruction.svg images/newlook/05Run-15StepIntoInstruction.svg images/dark-close.svg + images/newlook/00Misc-10Check.svg + images/newlook/00Misc-11Rename.svg diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index 590957ee..cfb08516 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -3,44 +3,46 @@ #include #include #include +#include +#include IconsManager* pIconsManager; IconsManager::IconsManager(QObject *parent) : QObject(parent) { - mDefaultIcon = PIcon(); + mDefaultIconPixmap = std::make_shared(); } void IconsManager::updateEditorGuttorIcons(const QString& iconSet,int size) { QString iconFolder = QString(":/icons/images/%1/").arg(iconSet); - mIcons.insert(GUTTER_BREAKPOINT, createSVGIcon(iconFolder+"breakpoint.svg",size,size)); - mIcons.insert(GUTTER_SYNTAX_ERROR, createSVGIcon(iconFolder+"syntaxerror.svg",size,size)); - mIcons.insert(GUTTER_SYNTAX_WARNING,createSVGIcon(iconFolder+"syntaxwarning.svg",size,size)); - mIcons.insert(GUTTER_ACTIVEBREAKPOINT,createSVGIcon(iconFolder+"currentline.svg",size,size)); - mIcons.insert(GUTTER_BOOKMARK, createSVGIcon(iconFolder+"bookmark.svg",size,size)); + mIconPixmaps.insert(GUTTER_BREAKPOINT, createSVGIcon(iconFolder+"breakpoint.svg",size,size)); + mIconPixmaps.insert(GUTTER_SYNTAX_ERROR, createSVGIcon(iconFolder+"syntaxerror.svg",size,size)); + mIconPixmaps.insert(GUTTER_SYNTAX_WARNING,createSVGIcon(iconFolder+"syntaxwarning.svg",size,size)); + mIconPixmaps.insert(GUTTER_ACTIVEBREAKPOINT,createSVGIcon(iconFolder+"currentline.svg",size,size)); + mIconPixmaps.insert(GUTTER_BOOKMARK, createSVGIcon(iconFolder+"bookmark.svg",size,size)); } void IconsManager::updateParserIcons(const QString &iconSet, int size) { QString iconFolder = QString(":/icons/images/%1/").arg(iconSet); - mIcons.insert(PARSER_TYPE, createSVGIcon(iconFolder+"type.svg",size,size)); - mIcons.insert(PARSER_CLASS, createSVGIcon(iconFolder+"class.svg",size,size)); - mIcons.insert(PARSER_NAMESPACE, createSVGIcon(iconFolder+"namespace.svg",size,size)); - mIcons.insert(PARSER_DEFINE, createSVGIcon(iconFolder+"define.svg",size,size)); - mIcons.insert(PARSER_ENUM, createSVGIcon(iconFolder+"enum.svg",size,size));; - mIcons.insert(PARSER_GLOBAL_METHOD, createSVGIcon(iconFolder+"global_method.svg",size,size)); - mIcons.insert(PARSER_INHERITED_PROTECTED_METHOD, createSVGIcon(iconFolder+"method_inherited_protected.svg",size,size)); - mIcons.insert(PARSER_INHERITED_METHOD, createSVGIcon(iconFolder+"method_inherited.svg",size,size)); - mIcons.insert(PARSER_PROTECTED_METHOD, createSVGIcon(iconFolder+"method_protected.svg",size,size)); - mIcons.insert(PARSER_PUBLIC_METHOD, createSVGIcon(iconFolder+"method_public.svg",size,size)); - mIcons.insert(PARSER_PRIVATE_METHOD, createSVGIcon(iconFolder+"method_private.svg",size,size)); - mIcons.insert(PARSER_GLOBAL_VAR, createSVGIcon(iconFolder+"global.svg",size,size)); - mIcons.insert(PARSER_INHERITED_PROTECTD_VAR, createSVGIcon(iconFolder+"var_inherited_protected.svg",size,size)); - mIcons.insert(PARSER_INHERITED_VAR, createSVGIcon(iconFolder+"var_inherited.svg",size,size)); - mIcons.insert(PARSER_PROTECTED_VAR, createSVGIcon(iconFolder+"var_protected.svg",size,size)); - mIcons.insert(PARSER_PUBLIC_VAR, createSVGIcon(iconFolder+"var_public.svg",size,size)); - mIcons.insert(PARSER_PRIVATE_VAR, createSVGIcon(iconFolder+"var_private.svg",size,size)); + mIconPixmaps.insert(PARSER_TYPE, createSVGIcon(iconFolder+"type.svg",size,size)); + mIconPixmaps.insert(PARSER_CLASS, createSVGIcon(iconFolder+"class.svg",size,size)); + mIconPixmaps.insert(PARSER_NAMESPACE, createSVGIcon(iconFolder+"namespace.svg",size,size)); + mIconPixmaps.insert(PARSER_DEFINE, createSVGIcon(iconFolder+"define.svg",size,size)); + mIconPixmaps.insert(PARSER_ENUM, createSVGIcon(iconFolder+"enum.svg",size,size));; + mIconPixmaps.insert(PARSER_GLOBAL_METHOD, createSVGIcon(iconFolder+"global_method.svg",size,size)); + mIconPixmaps.insert(PARSER_INHERITED_PROTECTED_METHOD, createSVGIcon(iconFolder+"method_inherited_protected.svg",size,size)); + mIconPixmaps.insert(PARSER_INHERITED_METHOD, createSVGIcon(iconFolder+"method_inherited.svg",size,size)); + mIconPixmaps.insert(PARSER_PROTECTED_METHOD, createSVGIcon(iconFolder+"method_protected.svg",size,size)); + mIconPixmaps.insert(PARSER_PUBLIC_METHOD, createSVGIcon(iconFolder+"method_public.svg",size,size)); + mIconPixmaps.insert(PARSER_PRIVATE_METHOD, createSVGIcon(iconFolder+"method_private.svg",size,size)); + mIconPixmaps.insert(PARSER_GLOBAL_VAR, createSVGIcon(iconFolder+"global.svg",size,size)); + mIconPixmaps.insert(PARSER_INHERITED_PROTECTD_VAR, createSVGIcon(iconFolder+"var_inherited_protected.svg",size,size)); + mIconPixmaps.insert(PARSER_INHERITED_VAR, createSVGIcon(iconFolder+"var_inherited.svg",size,size)); + mIconPixmaps.insert(PARSER_PROTECTED_VAR, createSVGIcon(iconFolder+"var_protected.svg",size,size)); + mIconPixmaps.insert(PARSER_PUBLIC_VAR, createSVGIcon(iconFolder+"var_public.svg",size,size)); + mIconPixmaps.insert(PARSER_PRIVATE_VAR, createSVGIcon(iconFolder+"var_private.svg",size,size)); } @@ -48,101 +50,114 @@ void IconsManager::updateActionIcons(const QString iconSet, int size) { QString iconFolder = QString(":/icons/images/%1/").arg(iconSet); mActionIconSize = QSize(size,size); - mIcons.insert(ACTION_MISC_BACK, createSVGIcon(iconFolder+"00Misc-01Back.svg",size,size)); - mIcons.insert(ACTION_MISC_FORWARD, createSVGIcon(iconFolder+"00Misc-02Forward.svg",size,size)); - mIcons.insert(ACTION_MISC_ADD, createSVGIcon(iconFolder+"00Misc-03Add.svg",size,size)); - mIcons.insert(ACTION_MISC_REMOVE, createSVGIcon(iconFolder+"00Misc-04Remove.svg",size,size)); - mIcons.insert(ACTION_MISC_GEAR, createSVGIcon(iconFolder+"00Misc-05Gear.svg",size,size)); - mIcons.insert(ACTION_MISC_CROSS, createSVGIcon(iconFolder+"00Misc-06Cross.svg",size,size)); - mIcons.insert(ACTION_MISC_FOLDER, createSVGIcon(iconFolder+"00Misc-07Folder.svg",size,size)); - mIcons.insert(ACTION_MISC_TERM, createSVGIcon(iconFolder+"00Misc-08Term.svg",size,size)); - mIcons.insert(ACTION_MISC_CLEAN, createSVGIcon(iconFolder+"00Misc-09Clean.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_BACK, createSVGIcon(iconFolder+"00Misc-01Back.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_FORWARD, createSVGIcon(iconFolder+"00Misc-02Forward.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_ADD, createSVGIcon(iconFolder+"00Misc-03Add.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_REMOVE, createSVGIcon(iconFolder+"00Misc-04Remove.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_GEAR, createSVGIcon(iconFolder+"00Misc-05Gear.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_CROSS, createSVGIcon(iconFolder+"00Misc-06Cross.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_FOLDER, createSVGIcon(iconFolder+"00Misc-07Folder.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_TERM, createSVGIcon(iconFolder+"00Misc-08Term.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_CLEAN, createSVGIcon(iconFolder+"00Misc-09Clean.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_VALIDATE, createSVGIcon(iconFolder+"00Misc-10Check.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_RENAME, createSVGIcon(iconFolder+"00Misc-11Rename.svg",size,size)); - mIcons.insert(ACTION_FILE_NEW, createSVGIcon(iconFolder+"01File-01New.svg",size,size)); - mIcons.insert(ACTION_FILE_OPEN, createSVGIcon(iconFolder+"01File-02Open.svg",size,size)); - mIcons.insert(ACTION_FILE_OPEN_FOLDER, createSVGIcon(iconFolder+"01File-09Open_Folder.svg",size,size)); - mIcons.insert(ACTION_FILE_SAVE, createSVGIcon(iconFolder+"01File-03Save.svg",size,size)); - mIcons.insert(ACTION_FILE_SAVE_AS, createSVGIcon(iconFolder+"01File-04SaveAs.svg",size,size)); - mIcons.insert(ACTION_FILE_SAVE_ALL, createSVGIcon(iconFolder+"01File-05SaveAll.svg",size,size)); - mIcons.insert(ACTION_FILE_CLOSE, createSVGIcon(iconFolder+"01File-06Close.svg",size,size)); - mIcons.insert(ACTION_FILE_CLOSE_ALL, createSVGIcon(iconFolder+"01File-07CloseAll.svg",size,size)); - mIcons.insert(ACTION_FILE_PRINT, createSVGIcon(iconFolder+"01File-08Print.svg",size,size)); - mIcons.insert(ACTION_FILE_PROPERTIES, createSVGIcon(iconFolder+"01File-10FileProperties.svg",size,size)); - mIcons.insert(ACTION_FILE_LOCATE, createSVGIcon(iconFolder+"01File-11Locate.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_NEW, createSVGIcon(iconFolder+"01File-01New.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_OPEN, createSVGIcon(iconFolder+"01File-02Open.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_OPEN_FOLDER, createSVGIcon(iconFolder+"01File-09Open_Folder.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_SAVE, createSVGIcon(iconFolder+"01File-03Save.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_SAVE_AS, createSVGIcon(iconFolder+"01File-04SaveAs.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_SAVE_ALL, createSVGIcon(iconFolder+"01File-05SaveAll.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_CLOSE, createSVGIcon(iconFolder+"01File-06Close.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_CLOSE_ALL, createSVGIcon(iconFolder+"01File-07CloseAll.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_PRINT, createSVGIcon(iconFolder+"01File-08Print.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_PROPERTIES, createSVGIcon(iconFolder+"01File-10FileProperties.svg",size,size)); + mIconPixmaps.insert(ACTION_FILE_LOCATE, createSVGIcon(iconFolder+"01File-11Locate.svg",size,size)); - mIcons.insert(ACTION_PROJECT_NEW, createSVGIcon(iconFolder+"02Project_01New.svg",size,size)); - mIcons.insert(ACTION_PROJECT_SAVE, createSVGIcon(iconFolder+"02Project_02Save.svg",size,size)); - mIcons.insert(ACTION_PROJECT_CLOSE, createSVGIcon(iconFolder+"02Project_03Close.svg",size,size)); - mIcons.insert(ACTION_PROJECT_NEW_FILE, createSVGIcon(iconFolder+"02Project_04NewFile.svg",size,size)); - mIcons.insert(ACTION_PROJECT_ADD_FILE, createSVGIcon(iconFolder+"02Project_05AddFile.svg",size,size)); - mIcons.insert(ACTION_PROJECT_REMOVE_FILE, createSVGIcon(iconFolder+"02Project_06RemoveFile.svg",size,size)); - mIcons.insert(ACTION_PROJECT_PROPERTIES, createSVGIcon(iconFolder+"02Project_07Properties.svg",size,size)); - mIcons.insert(ACTION_EDIT_UNDO, createSVGIcon(iconFolder+"03Edit_01Undo.svg",size,size)); - mIcons.insert(ACTION_EDIT_REDO, createSVGIcon(iconFolder+"03Edit_02Redo.svg",size,size)); - mIcons.insert(ACTION_EDIT_CUT, createSVGIcon(iconFolder+"03Edit_03Cut.svg",size,size)); - mIcons.insert(ACTION_EDIT_COPY, createSVGIcon(iconFolder+"03Edit_04Copy.svg",size,size)); - mIcons.insert(ACTION_EDIT_PASTE, createSVGIcon(iconFolder+"03Edit_05Paste.svg",size,size)); - mIcons.insert(ACTION_EDIT_INDENT, createSVGIcon(iconFolder+"03Edit_06Indent.svg",size,size)); - mIcons.insert(ACTION_EDIT_UNINDENT, createSVGIcon(iconFolder+"03Edit_07Unindent.svg",size,size)); - mIcons.insert(ACTION_EDIT_SEARCH, createSVGIcon(iconFolder+"03Edit_08Search.svg",size,size)); - mIcons.insert(ACTION_EDIT_REPLACE, createSVGIcon(iconFolder+"03Edit_09Replace.svg",size,size)); - mIcons.insert(ACTION_EDIT_SEARCH_IN_FILES, createSVGIcon(iconFolder+"03Edit_10SearchInFiles.svg",size,size)); - mIcons.insert(ACTION_EDIT_SORT_BY_NAME, createSVGIcon(iconFolder+"03Edit-11SortByName.svg",size,size)); - mIcons.insert(ACTION_EDIT_SORT_BY_TYPE, createSVGIcon(iconFolder+"03Edit-12SortByType.svg",size,size)); - mIcons.insert(ACTION_EDIT_SHOW_INHERITED, createSVGIcon(iconFolder+"03Edit-13ShowInherited.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_NEW, createSVGIcon(iconFolder+"02Project_01New.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_SAVE, createSVGIcon(iconFolder+"02Project_02Save.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_CLOSE, createSVGIcon(iconFolder+"02Project_03Close.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_NEW_FILE, createSVGIcon(iconFolder+"02Project_04NewFile.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_ADD_FILE, createSVGIcon(iconFolder+"02Project_05AddFile.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_REMOVE_FILE, createSVGIcon(iconFolder+"02Project_06RemoveFile.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_PROPERTIES, createSVGIcon(iconFolder+"02Project_07Properties.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_UNDO, createSVGIcon(iconFolder+"03Edit_01Undo.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_REDO, createSVGIcon(iconFolder+"03Edit_02Redo.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_CUT, createSVGIcon(iconFolder+"03Edit_03Cut.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_COPY, createSVGIcon(iconFolder+"03Edit_04Copy.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_PASTE, createSVGIcon(iconFolder+"03Edit_05Paste.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_INDENT, createSVGIcon(iconFolder+"03Edit_06Indent.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_UNINDENT, createSVGIcon(iconFolder+"03Edit_07Unindent.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SEARCH, createSVGIcon(iconFolder+"03Edit_08Search.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_REPLACE, createSVGIcon(iconFolder+"03Edit_09Replace.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SEARCH_IN_FILES, createSVGIcon(iconFolder+"03Edit_10SearchInFiles.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SORT_BY_NAME, createSVGIcon(iconFolder+"03Edit-11SortByName.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SORT_BY_TYPE, createSVGIcon(iconFolder+"03Edit-12SortByType.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SHOW_INHERITED, createSVGIcon(iconFolder+"03Edit-13ShowInherited.svg",size,size)); - mIcons.insert(ACTION_CODE_BACK, createSVGIcon(iconFolder+"04Code-01Back.svg",size,size)); - mIcons.insert(ACTION_CODE_FORWARD, createSVGIcon(iconFolder+"04Code-02Forward.svg",size,size)); - mIcons.insert(ACTION_CODE_ADD_BOOKMARK, createSVGIcon(iconFolder+"04Code-03AddBookmark.svg",size,size)); - mIcons.insert(ACTION_CODE_REMOVE_BOOKMARK, createSVGIcon(iconFolder+"04Code-04RemoveBookmark.svg",size,size)); - mIcons.insert(ACTION_CODE_REFORMAT, createSVGIcon(iconFolder+"04Code-05Reformat.svg",size,size)); + mIconPixmaps.insert(ACTION_CODE_BACK, createSVGIcon(iconFolder+"04Code-01Back.svg",size,size)); + mIconPixmaps.insert(ACTION_CODE_FORWARD, createSVGIcon(iconFolder+"04Code-02Forward.svg",size,size)); + mIconPixmaps.insert(ACTION_CODE_ADD_BOOKMARK, createSVGIcon(iconFolder+"04Code-03AddBookmark.svg",size,size)); + mIconPixmaps.insert(ACTION_CODE_REMOVE_BOOKMARK, createSVGIcon(iconFolder+"04Code-04RemoveBookmark.svg",size,size)); + mIconPixmaps.insert(ACTION_CODE_REFORMAT, createSVGIcon(iconFolder+"04Code-05Reformat.svg",size,size)); - mIcons.insert(ACTION_RUN_COMPILE, createSVGIcon(iconFolder+"05Run-01Compile.svg",size,size)); - mIcons.insert(ACTION_RUN_COMPILE_RUN, createSVGIcon(iconFolder+"05Run-02CompileRun.svg",size,size)); - mIcons.insert(ACTION_RUN_RUN, createSVGIcon(iconFolder+"05Run-03Run.svg",size,size)); - mIcons.insert(ACTION_RUN_REBUILD, createSVGIcon(iconFolder+"05Run-04Rebuild.svg",size,size)); - mIcons.insert(ACTION_RUN_OPTIONS, createSVGIcon(iconFolder+"05Run-05Options.svg",size,size)); - mIcons.insert(ACTION_RUN_DEBUG, createSVGIcon(iconFolder+"05Run-06Debug.svg",size,size)); - mIcons.insert(ACTION_RUN_STEP_OVER, createSVGIcon(iconFolder+"05Run-07StepOver.svg",size,size)); - mIcons.insert(ACTION_RUN_STEP_INTO, createSVGIcon(iconFolder+"05Run-08StepInto.svg",size,size)); - mIcons.insert(ACTION_RUN_STEP_OUT, createSVGIcon(iconFolder+"05Run-08StepOut.svg",size,size)); - mIcons.insert(ACTION_RUN_RUN_TO_CURSOR, createSVGIcon(iconFolder+"05Run-09RunToCursor.svg",size,size)); - mIcons.insert(ACTION_RUN_CONTINUE, createSVGIcon(iconFolder+"05Run-10Continue.svg",size,size)); - mIcons.insert(ACTION_RUN_STOP, createSVGIcon(iconFolder+"05Run-11Stop.svg",size,size)); - mIcons.insert(ACTION_RUN_ADD_WATCH, createSVGIcon(iconFolder+"05Run-12AddWatch.svg",size,size)); - mIcons.insert(ACTION_RUN_REMOVE_WATCH, createSVGIcon(iconFolder+"05Run-13RemoveWatch.svg",size,size)); - mIcons.insert(ACTION_RUN_STEP_OVER_INSTRUCTION, createSVGIcon(iconFolder+"05Run-14StepOverInstruction.svg",size,size)); - mIcons.insert(ACTION_RUN_STEP_INTO_INSTRUCTION, createSVGIcon(iconFolder+"05Run-15StepIntoInstruction.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_COMPILE, createSVGIcon(iconFolder+"05Run-01Compile.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_COMPILE_RUN, createSVGIcon(iconFolder+"05Run-02CompileRun.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_RUN, createSVGIcon(iconFolder+"05Run-03Run.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_REBUILD, createSVGIcon(iconFolder+"05Run-04Rebuild.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_OPTIONS, createSVGIcon(iconFolder+"05Run-05Options.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_DEBUG, createSVGIcon(iconFolder+"05Run-06Debug.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_STEP_OVER, createSVGIcon(iconFolder+"05Run-07StepOver.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_STEP_INTO, createSVGIcon(iconFolder+"05Run-08StepInto.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_STEP_OUT, createSVGIcon(iconFolder+"05Run-08StepOut.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_RUN_TO_CURSOR, createSVGIcon(iconFolder+"05Run-09RunToCursor.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_CONTINUE, createSVGIcon(iconFolder+"05Run-10Continue.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_STOP, createSVGIcon(iconFolder+"05Run-11Stop.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_ADD_WATCH, createSVGIcon(iconFolder+"05Run-12AddWatch.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_REMOVE_WATCH, createSVGIcon(iconFolder+"05Run-13RemoveWatch.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_STEP_OVER_INSTRUCTION, createSVGIcon(iconFolder+"05Run-14StepOverInstruction.svg",size,size)); + mIconPixmaps.insert(ACTION_RUN_STEP_INTO_INSTRUCTION, createSVGIcon(iconFolder+"05Run-15StepIntoInstruction.svg",size,size)); - mIcons.insert(ACTION_VIEW_MAXIMUM, createSVGIcon(iconFolder+"06View-01Maximum.svg",size,size)); - mIcons.insert(ACTION_VIEW_CLASSBROWSER, createSVGIcon(iconFolder+"06View-02ClassBrowser.svg",size,size)); - mIcons.insert(ACTION_VIEW_FILES, createSVGIcon(iconFolder+"06View-03Files.svg",size,size)); - mIcons.insert(ACTION_VIEW_COMPILELOG, createSVGIcon(iconFolder+"06View-04CompileLog.svg",size,size)); - mIcons.insert(ACTION_VIEW_BOOKMARK, createSVGIcon(iconFolder+"06View-05Bookmark.svg",size,size)); - mIcons.insert(ACTION_VIEW_TODO, createSVGIcon(iconFolder+"06View-06Todo.svg",size,size)); + mIconPixmaps.insert(ACTION_VIEW_MAXIMUM, createSVGIcon(iconFolder+"06View-01Maximum.svg",size,size)); + mIconPixmaps.insert(ACTION_VIEW_CLASSBROWSER, createSVGIcon(iconFolder+"06View-02ClassBrowser.svg",size,size)); + mIconPixmaps.insert(ACTION_VIEW_FILES, createSVGIcon(iconFolder+"06View-03Files.svg",size,size)); + mIconPixmaps.insert(ACTION_VIEW_COMPILELOG, createSVGIcon(iconFolder+"06View-04CompileLog.svg",size,size)); + mIconPixmaps.insert(ACTION_VIEW_BOOKMARK, createSVGIcon(iconFolder+"06View-05Bookmark.svg",size,size)); + mIconPixmaps.insert(ACTION_VIEW_TODO, createSVGIcon(iconFolder+"06View-06Todo.svg",size,size)); - mIcons.insert(ACTION_HELP_ABOUT, createSVGIcon(iconFolder+"07Help-01About.svg",size,size)); + mIconPixmaps.insert(ACTION_HELP_ABOUT, createSVGIcon(iconFolder+"07Help-01About.svg",size,size)); - mIcons.insert(ACTION_PROBLEM_PROBLEM, createSVGIcon(iconFolder+"08Problem_01Problem.svg",size,size)); - mIcons.insert(ACTION_PROBLEM_SET, createSVGIcon(iconFolder+"08Problem_02ProblemSet.svg",size,size)); - mIcons.insert(ACTION_PROBLEM_PROPERTIES, createSVGIcon(iconFolder+"08Problem_03Properties.svg",size,size)); - mIcons.insert(ACTION_PROBLEM_EDIT_SOURCE, createSVGIcon(iconFolder+"08Problem_04EditSource.svg",size,size)); - mIcons.insert(ACTION_PROBLEM_RUN_CASES, createSVGIcon(iconFolder+"08Problem_05RunCases.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_PROBLEM, createSVGIcon(iconFolder+"08Problem_01Problem.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_SET, createSVGIcon(iconFolder+"08Problem_02ProblemSet.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_PROPERTIES, createSVGIcon(iconFolder+"08Problem_03Properties.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_EDIT_SOURCE, createSVGIcon(iconFolder+"08Problem_04EditSource.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_RUN_CASES, createSVGIcon(iconFolder+"08Problem_05RunCases.svg",size,size)); emit actionIconsUpdated(); } -IconsManager::PIcon IconsManager::getIcon(IconName iconName) const +IconsManager::PPixmap IconsManager::getPixmap(IconName iconName) const { - return mIcons.value(iconName, mDefaultIcon); + return mIconPixmaps.value(iconName, mDefaultIconPixmap); } -IconsManager::PIcon IconsManager::createSVGIcon(const QString &filename, int width, int height) +QIcon IconsManager::getIcon(IconName iconName) const +{ + return QIcon(*getPixmap(iconName)); +} + +void IconsManager::setIcon(QToolButton *btn, IconName iconName) const +{ + btn->setIconSize(mActionIconSize); + btn->setIcon(getIcon(iconName)); +} + +IconsManager::PPixmap IconsManager::createSVGIcon(const QString &filename, int width, int height) { QSvgRenderer renderer(filename); - PIcon icon = std::make_shared(width,height); + PPixmap icon = std::make_shared(width,height); icon->fill(Qt::transparent); QPainter painter(icon.get()); renderer.render(&painter,icon->rect()); diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h index d0e6e9cb..5bef23e0 100644 --- a/RedPandaIDE/iconsmanager.h +++ b/RedPandaIDE/iconsmanager.h @@ -6,11 +6,12 @@ #include #include +class QToolButton; class IconsManager : public QObject { Q_OBJECT public: - using PIcon = std::shared_ptr; + using PPixmap = std::shared_ptr; enum IconName { GUTTER_SYNTAX_ERROR, GUTTER_SYNTAX_WARNING, @@ -45,6 +46,8 @@ public: ACTION_MISC_FOLDER, ACTION_MISC_TERM, ACTION_MISC_CLEAN, + ACTION_MISC_VALIDATE, + ACTION_MISC_RENAME, ACTION_FILE_NEW, ACTION_FILE_OPEN, @@ -124,16 +127,20 @@ public: void updateParserIcons(const QString& iconSet, int size); void updateActionIcons(const QString iconSet, int size); - PIcon getIcon(IconName iconName) const; + PPixmap getPixmap(IconName iconName) const; - PIcon createSVGIcon(const QString& filename, int width, int height); + QIcon getIcon(IconName iconName) const; + + void setIcon(QToolButton* btn, IconName iconName) const; + + PPixmap createSVGIcon(const QString& filename, int width, int height); const QSize &actionIconSize() const; signals: void actionIconsUpdated(); private: - QMap mIcons; - PIcon mDefaultIcon; + QMap mIconPixmaps; + PPixmap mDefaultIconPixmap; QSize mActionIconSize; }; diff --git a/RedPandaIDE/images/newlook/004-addsrc.svg b/RedPandaIDE/images/newlook/004-addsrc.svg deleted file mode 100644 index 3ec54d79..00000000 --- a/RedPandaIDE/images/newlook/004-addsrc.svg +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RedPandaIDE/images/newlook/005-arricon.svg b/RedPandaIDE/images/newlook/005-arricon.svg deleted file mode 100644 index 6a473eb8..00000000 --- a/RedPandaIDE/images/newlook/005-arricon.svg +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RedPandaIDE/images/newlook/00Misc-04Remove.svg b/RedPandaIDE/images/newlook/00Misc-04Remove.svg index a9a130cf..2db83670 100644 --- a/RedPandaIDE/images/newlook/00Misc-04Remove.svg +++ b/RedPandaIDE/images/newlook/00Misc-04Remove.svg @@ -8,7 +8,7 @@ version="1.1" id="svg5" inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)" - sodipodi:docname="00Misc-03Minus.svg" + sodipodi:docname="00Misc-04Remove.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -65,7 +65,7 @@ inkscape:groupmode="layer" id="layer1"> diff --git a/RedPandaIDE/images/newlook/007-bughlp.svg b/RedPandaIDE/images/newlook/00Misc-10Check.svg similarity index 100% rename from RedPandaIDE/images/newlook/007-bughlp.svg rename to RedPandaIDE/images/newlook/00Misc-10Check.svg diff --git a/RedPandaIDE/images/newlook/008-close.svg b/RedPandaIDE/images/newlook/00Misc-11Rename.svg similarity index 55% rename from RedPandaIDE/images/newlook/008-close.svg rename to RedPandaIDE/images/newlook/00Misc-11Rename.svg index decde120..0c42c48a 100644 --- a/RedPandaIDE/images/newlook/008-close.svg +++ b/RedPandaIDE/images/newlook/00Misc-11Rename.svg @@ -8,7 +8,7 @@ version="1.1" id="svg5" inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)" - sodipodi:docname="008-close.svg" + sodipodi:docname="00Misc-11Rename.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -24,8 +24,8 @@ inkscape:document-units="px" showgrid="false" inkscape:zoom="5.786981" - inkscape:cx="6.3936619" - inkscape:cy="68.688665" + inkscape:cx="19.699391" + inkscape:cy="60.91259" inkscape:window-width="1920" inkscape:window-height="1001" inkscape:window-x="-9" @@ -64,10 +64,28 @@ inkscape:label="图层 1" inkscape:groupmode="layer" id="layer1"> - + + + + + diff --git a/RedPandaIDE/images/newlook/011-clrhist.svg b/RedPandaIDE/images/newlook/011-clrhist.svg deleted file mode 100644 index 7a4b71e9..00000000 --- a/RedPandaIDE/images/newlook/011-clrhist.svg +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 9d90af83..93aad18e 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1118,173 +1118,162 @@ void MainWindow::updateActionIcons() ui->EditorTabsLeft->setIconSize(iconSize); ui->EditorTabsRight->setIconSize(iconSize); - ui->actionNew->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_NEW)))); - ui->actionNew_Project->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW)))); - ui->actionOpen->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN)))); - ui->actionSave->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE)))); - ui->actionSaveAs->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE_AS)))); - ui->actionSaveAll->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE_ALL)))); - ui->actionClose->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_CLOSE)))); - ui->actionClose_Project->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_CLOSE)))); - ui->actionClose_All->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_CLOSE_ALL)))); - ui->actionPrint->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_PRINT)))); + ui->actionNew->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_NEW)); + ui->actionNew_Project->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW)); + ui->actionOpen->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN)); + ui->actionSave->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE)); + ui->actionSaveAs->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE_AS)); + ui->actionSaveAll->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE_ALL)); + ui->actionClose->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_CLOSE)); + ui->actionClose_Project->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_CLOSE)); + ui->actionClose_All->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_CLOSE_ALL)); + ui->actionPrint->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_PRINT)); - ui->actionUndo->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_UNDO)))); - ui->actionRedo->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_REDO)))); - ui->actionCut->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_CUT)))); - ui->actionCopy->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)))); - ui->actionPaste->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_PASTE)))); - ui->actionIndent->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_INDENT)))); - ui->actionUnIndent->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_UNINDENT)))); + ui->actionUndo->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_UNDO)); + ui->actionRedo->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_REDO)); + ui->actionCut->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_CUT)); + ui->actionCopy->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)); + ui->actionPaste->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_PASTE)); + ui->actionIndent->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_INDENT)); + ui->actionUnIndent->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_UNINDENT)); - ui->actionFind->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH)))); - ui->actionReplace->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_REPLACE)))); - ui->actionFind_in_files->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH_IN_FILES)))); + ui->actionFind->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH)); + ui->actionReplace->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_REPLACE)); + ui->actionFind_in_files->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH_IN_FILES)); - ui->actionBack->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_CODE_BACK)))); - ui->actionForward->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_CODE_FORWARD)))); - ui->actionAdd_bookmark->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_CODE_ADD_BOOKMARK)))); - ui->actionRemove_Bookmark->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_CODE_REMOVE_BOOKMARK)))); - ui->actionReformat_Code->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_CODE_REFORMAT)))); + ui->actionBack->setIcon(pIconsManager->getIcon(IconsManager::ACTION_CODE_BACK)); + ui->actionForward->setIcon(pIconsManager->getIcon(IconsManager::ACTION_CODE_FORWARD)); + ui->actionAdd_bookmark->setIcon(pIconsManager->getIcon(IconsManager::ACTION_CODE_ADD_BOOKMARK)); + ui->actionRemove_Bookmark->setIcon(pIconsManager->getIcon(IconsManager::ACTION_CODE_REMOVE_BOOKMARK)); + ui->actionReformat_Code->setIcon(pIconsManager->getIcon(IconsManager::ACTION_CODE_REFORMAT)); - ui->actionProject_New_File->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW_FILE)))); - ui->actionAdd_to_project->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_ADD_FILE)))); - ui->actionRemove_from_project->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_REMOVE_FILE)))); - ui->actionProject_Open_Folder_In_Explorer->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)))); - ui->actionProject_Open_In_Terminal->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)))); - ui->actionMakeClean->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); - ui->actionProject_options->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_PROPERTIES)))); + ui->actionProject_New_File->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW_FILE)); + ui->actionAdd_to_project->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_ADD_FILE)); + ui->actionRemove_from_project->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_REMOVE_FILE)); + ui->actionProject_Open_Folder_In_Explorer->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)); + ui->actionProject_Open_In_Terminal->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)); + ui->actionMakeClean->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); + ui->actionProject_options->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_PROPERTIES)); - ui->actionCompile->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE)))); - ui->actionCompile_Run->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE_RUN)))); - ui->actionRun->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_RUN)))); - ui->actionRebuild->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_REBUILD)))); - ui->actionRun_Parameters->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_OPTIONS)))); - ui->actionDebug->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_DEBUG)))); - ui->actionStep_Over->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_OVER)))); - ui->actionStep_Into->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_INTO)))); - ui->actionStep_Out->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_OUT)))); - ui->actionRun_To_Cursor->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_RUN_TO_CURSOR)))); - ui->actionContinue->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_CONTINUE)))); - ui->actionStop_Execution->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_STOP)))); - ui->actionAdd_Watch->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_ADD_WATCH)))); - ui->actionRemove_Watch->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_REMOVE_WATCH)))); - ui->actionRemove_All_Watches->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); + ui->actionCompile->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE)); + ui->actionCompile_Run->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE_RUN)); + ui->actionRun->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_RUN)); + ui->actionRebuild->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_REBUILD)); + ui->actionRun_Parameters->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_OPTIONS)); + ui->actionDebug->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_DEBUG)); + ui->actionStep_Over->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_OVER)); + ui->actionStep_Into->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_INTO)); + ui->actionStep_Out->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_OUT)); + ui->actionRun_To_Cursor->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_RUN_TO_CURSOR)); + ui->actionContinue->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_CONTINUE)); + ui->actionStop_Execution->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_STOP)); + ui->actionAdd_Watch->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_ADD_WATCH)); + ui->actionRemove_Watch->setIcon(pIconsManager->getIcon(IconsManager::ACTION_RUN_REMOVE_WATCH)); + ui->actionRemove_All_Watches->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); - ui->actionOptions->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_GEAR)))); + ui->actionOptions->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_GEAR)); - ui->actionMaximize_Editor->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_MAXIMUM)))); - ui->actionNext_Editor->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_FORWARD)))); - ui->actionPrevious_Editor->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_BACK)))); + ui->actionMaximize_Editor->setIcon(pIconsManager->getIcon(IconsManager::ACTION_VIEW_MAXIMUM)); + ui->actionNext_Editor->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FORWARD)); + ui->actionPrevious_Editor->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_BACK)); - ui->actionAbout->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_HELP_ABOUT)))); + ui->actionAbout->setIcon(pIconsManager->getIcon(IconsManager::ACTION_HELP_ABOUT)); //editor context menu - ui->actionOpen_Containing_Folder->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)))); - ui->actionOpen_Terminal->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)))); - ui->actionFile_Properties->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_PROPERTIES)))); - ui->actionLocate_in_Files_View->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_LOCATE)))); + ui->actionOpen_Containing_Folder->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)); + ui->actionOpen_Terminal->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)); + ui->actionFile_Properties->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_PROPERTIES)); + ui->actionLocate_in_Files_View->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_LOCATE)); //bookmark context menu - mBookmark_Remove->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_CODE_REMOVE_BOOKMARK)))); - mBookmark_RemoveAll->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); + mBookmark_Remove->setIcon(pIconsManager->getIcon(IconsManager::ACTION_CODE_REMOVE_BOOKMARK)); + mBookmark_RemoveAll->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); //issues context menu - mTableIssuesCopyAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)))); - mTableIssuesClearAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); + mTableIssuesCopyAction->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)); + mTableIssuesClearAction->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); //search context menu - mSearchViewClearAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)))); - mSearchViewClearAllAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); + mSearchViewClearAction->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)); + mSearchViewClearAllAction->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); //breakpoint context menu //mBreakpointViewPropertyAction - mBreakpointViewRemoveAllAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); - mBreakpointViewRemoveAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)))); + mBreakpointViewRemoveAllAction->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); + mBreakpointViewRemoveAction->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)); //classbrowser - mClassBrowser_Sort_By_Name->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SORT_BY_NAME)))); - mClassBrowser_Sort_By_Type->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SORT_BY_TYPE)))); - mClassBrowser_Show_Inherited->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SHOW_INHERITED)))); + mClassBrowser_Sort_By_Name->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SORT_BY_NAME)); + mClassBrowser_Sort_By_Type->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SORT_BY_TYPE)); + mClassBrowser_Show_Inherited->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SHOW_INHERITED)); //debug console - mDebugConsole_Copy->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)))); - mDebugConsole_Paste->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_PASTE)))); - mDebugConsole_Clear->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); + mDebugConsole_Copy->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)); + mDebugConsole_Paste->setIcon(pIconsManager->getIcon(IconsManager::ACTION_EDIT_PASTE)); + mDebugConsole_Clear->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)); //file view - mFilesView_Open->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN)))); - mFilesView_OpenInTerminal->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)))); - mFilesView_OpenInExplorer->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)))); + mFilesView_Open->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN)); + mFilesView_OpenInTerminal->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)); + mFilesView_OpenInExplorer->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)); //problem view - ui->btnNewProblemSet->setIconSize(iconSize); - ui->btnNewProblemSet->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_SET)))); - ui->btnAddProblem->setIconSize(iconSize); - ui->btnAddProblem->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_ADD)))); - ui->btnRemoveProblem->setIconSize(iconSize); - ui->btnRemoveProblem->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)))); - ui->btnSaveProblemSet->setIconSize(iconSize); - ui->btnSaveProblemSet->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE_AS)))); - ui->btnLoadProblemSet->setIconSize(iconSize); - ui->btnLoadProblemSet->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN_FOLDER)))); + pIconsManager->setIcon(ui->btnNewProblemSet, IconsManager::ACTION_PROBLEM_SET); + pIconsManager->setIcon(ui->btnAddProblem, IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnRemoveProblem, IconsManager::ACTION_MISC_CROSS); + pIconsManager->setIcon(ui->btnSaveProblemSet, IconsManager::ACTION_FILE_SAVE_AS); + pIconsManager->setIcon(ui->btnLoadProblemSet, IconsManager::ACTION_FILE_OPEN_FOLDER); - ui->btnAddProblemCase->setIconSize(iconSize); - ui->btnAddProblemCase->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_ADD)))); - ui->btnRemoveProblemCase->setIconSize(iconSize); - ui->btnRemoveProblemCase->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_REMOVE)))); - ui->btnOpenProblemAnswer->setIconSize(iconSize); - ui->btnOpenProblemAnswer->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_EDIT_SOURCE)))); - ui->btnRunAllProblemCases->setIconSize(iconSize); - ui->btnRunAllProblemCases->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_RUN_CASES)))); - ui->btnCaseValidateOptions->setIconSize(iconSize); - ui->btnCaseValidateOptions->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_GEAR)))); + pIconsManager->setIcon(ui->btnAddProblemCase, IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnRemoveProblemCase, IconsManager::ACTION_MISC_REMOVE); + pIconsManager->setIcon(ui->btnOpenProblemAnswer, IconsManager::ACTION_PROBLEM_EDIT_SOURCE); + pIconsManager->setIcon(ui->btnRunAllProblemCases, IconsManager::ACTION_PROBLEM_RUN_CASES); + pIconsManager->setIcon(ui->btnCaseValidateOptions, IconsManager::ACTION_MISC_GEAR); - mProblem_Properties->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PROPERTIES)))); + mProblem_Properties->setIcon(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PROPERTIES)); int idx = ui->tabInfos->indexOf(ui->tabWatch); if (idx>=0) - ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_ADD_WATCH)))); + ui->tabInfos->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_RUN_ADD_WATCH)); idx = ui->tabInfos->indexOf(ui->tabProject); if (idx>=0) - ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW)))); + ui->tabInfos->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW)); idx = ui->tabInfos->indexOf(ui->tabFiles); if (idx>=0) - ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_FILES)))); + ui->tabInfos->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_VIEW_FILES)); idx = ui->tabInfos->indexOf(ui->tabStructure); if (idx>=0) - ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_CLASSBROWSER)))); + ui->tabInfos->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_VIEW_CLASSBROWSER)); idx = ui->tabInfos->indexOf(ui->tabProblemSet); if (idx>=0) - ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_SET)))); + ui->tabInfos->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_SET)); idx = ui->tabMessages->indexOf(ui->tabIssues); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE)))); + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE)); idx = ui->tabMessages->indexOf(ui->tabDebug); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_DEBUG)))); + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_RUN_DEBUG)); idx = ui->tabMessages->indexOf(ui->tabSearch); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH)))); + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH)); idx = ui->tabMessages->indexOf(ui->tabCompilerOutput); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_COMPILELOG)))); + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_VIEW_COMPILELOG)); idx = ui->tabMessages->indexOf(ui->tabTODO); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_TODO)))); + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_VIEW_TODO)); idx = ui->tabMessages->indexOf(ui->tabBookmark); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_BOOKMARK)))); + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_VIEW_BOOKMARK)); idx = ui->tabMessages->indexOf(ui->tabProblem); if (idx>=0) - ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PROBLEM)))); - + ui->tabMessages->setTabIcon(idx,pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PROBLEM)); } void MainWindow::checkSyntaxInBack(Editor *e) diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 4b6c5b52..8e2fd4e4 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -1869,7 +1869,7 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const } else { QIcon icon = provider.icon(QFileIconProvider::Folder); if (icon.isNull()) - return *(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)); + return pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER); return icon; } } diff --git a/RedPandaIDE/settingsdialog/compilerautolinkwidget.cpp b/RedPandaIDE/settingsdialog/compilerautolinkwidget.cpp index bb4dc463..f18b596e 100644 --- a/RedPandaIDE/settingsdialog/compilerautolinkwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilerautolinkwidget.cpp @@ -2,6 +2,7 @@ #include "ui_compilerautolinkwidget.h" #include "../mainwindow.h" #include "../settings.h" +#include "../iconsmanager.h" #include @@ -210,3 +211,9 @@ void CompilerAutolinkWidget::on_btnRemove_pressed() mModel.removeRow(index.row(),index.parent()); } +void CompilerAutolinkWidget::updateIcons(const QSize &) +{ + pIconsManager->setIcon(ui->btnAdd, IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnRemove, IconsManager::ACTION_MISC_REMOVE); +} + diff --git a/RedPandaIDE/settingsdialog/compilerautolinkwidget.h b/RedPandaIDE/settingsdialog/compilerautolinkwidget.h index 7ee71bb0..51b941b7 100644 --- a/RedPandaIDE/settingsdialog/compilerautolinkwidget.h +++ b/RedPandaIDE/settingsdialog/compilerautolinkwidget.h @@ -57,6 +57,10 @@ protected: private slots: void on_btnAdd_pressed(); void on_btnRemove_pressed(); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // COMPILERAUTOLINKWIDGET_H diff --git a/RedPandaIDE/settingsdialog/compilerautolinkwidget.ui b/RedPandaIDE/settingsdialog/compilerautolinkwidget.ui index c91a6c4a..babf675f 100644 --- a/RedPandaIDE/settingsdialog/compilerautolinkwidget.ui +++ b/RedPandaIDE/settingsdialog/compilerautolinkwidget.ui @@ -40,8 +40,11 @@ + + Add + - ... + Add @@ -51,8 +54,11 @@ + + Remove + - ... + Remove diff --git a/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.cpp b/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.cpp index bb9a7b76..ad14502b 100644 --- a/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.cpp @@ -1,5 +1,6 @@ #include "compilersetdirectorieswidget.h" #include "ui_compilersetdirectorieswidget.h" +#include "../iconsmanager.h" #include #include @@ -16,6 +17,8 @@ CompilerSetDirectoriesWidget::CompilerSetDirectoriesWidget(QWidget *parent) : connect(ui->listView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &CompilerSetDirectoriesWidget::selectionChanged); ui->listView->setSelectionMode(QAbstractItemView::SingleSelection); + connect(pIconsManager, &IconsManager::actionIconsUpdated, + this, &CompilerSetDirectoriesWidget::updateIcons); } CompilerSetDirectoriesWidget::~CompilerSetDirectoriesWidget() @@ -83,3 +86,10 @@ void CompilerSetDirectoriesWidget::on_btnRemoveInvalid_pressed() } setDirList(lst); } + +void CompilerSetDirectoriesWidget::updateIcons() +{ + pIconsManager->setIcon(ui->btnAdd,IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnDelete, IconsManager::ACTION_MISC_REMOVE); + pIconsManager->setIcon(ui->btnRemoveInvalid, IconsManager::ACTION_MISC_VALIDATE); +} diff --git a/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.h b/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.h index 102c8b05..8b7d06cf 100644 --- a/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.h +++ b/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.h @@ -34,6 +34,8 @@ private slots: void on_btnRemoveInvalid_pressed(); + void updateIcons(); + private: Ui::CompilerSetDirectoriesWidget *ui; ListModel* mModel; diff --git a/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.ui b/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.ui index 03eb77e2..3146ae60 100644 --- a/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.ui +++ b/RedPandaIDE/settingsdialog/compilersetdirectorieswidget.ui @@ -56,10 +56,10 @@ - Delete + Remove - Delete + Remove diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp index bf207b24..690eb274 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp @@ -5,6 +5,7 @@ #include "compilersetdirectorieswidget.h" #include #include "../utils.h" +#include "../iconsmanager.h" #include #include #include @@ -28,6 +29,10 @@ CompilerSetOptionWidget::CompilerSetOptionWidget(const QString& name, const QStr ui->txtCustomCompileParams, &QPlainTextEdit::setEnabled); connect(ui->chkUseCustomLinkParams, &QCheckBox::stateChanged, ui->txtCustomLinkParams, &QPlainTextEdit::setEnabled); + + connect(pIconsManager, &IconsManager::actionIconsUpdated, + this, &CompilerSetOptionWidget::updateIcons); + updateIcons(); } CompilerSetOptionWidget::~CompilerSetOptionWidget() @@ -263,3 +268,13 @@ void CompilerSetOptionWidget::on_btnRemoveCompilerSet_pressed() pSettings->compilerSets().deleteSet(ui->cbCompilerSet->currentIndex()); doLoad(); } + +void CompilerSetOptionWidget::updateIcons() +{ + pIconsManager->setIcon(ui->btnFindCompilers, IconsManager::ACTION_EDIT_SEARCH); + pIconsManager->setIcon(ui->btnAddCompilerSetByFolder, IconsManager::ACTION_MISC_FOLDER); + pIconsManager->setIcon(ui->btnAddBlankCompilerSet, IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnRemoveCompilerSet, IconsManager::ACTION_MISC_REMOVE); + pIconsManager->setIcon(ui->btnRenameCompilerSet, IconsManager::ACTION_MISC_RENAME); + +} diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.h b/RedPandaIDE/settingsdialog/compilersetoptionwidget.h index ae1a5438..db09da9d 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.h +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.h @@ -40,6 +40,7 @@ private slots: void on_btnAddCompilerSetByFolder_pressed(); void on_btnRenameCompilerSet_pressed(); void on_btnRemoveCompilerSet_pressed(); + void updateIcons(); }; #endif // COMPILERSETOPTIONWIDGET_H diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui index c5cf1119..236d283a 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui @@ -31,8 +31,11 @@ + + Auto Find Compilers + - ... + Auto Find Compilers @@ -41,22 +44,13 @@ - - - - ... - - - - :/icons/images/newlook24/050-newsrc.png - - - - + + Find Compiler in the Folder + - ... + Find Compiler in the Folder @@ -66,9 +60,27 @@ - + + + Add Blank Compiler Set + - ... + Add Blank Compiler Set + + + + :/icons/images/newlook24/050-newsrc.png + + + + + + + + Rename + + + Rename @@ -79,8 +91,11 @@ + + Remove + - ... + Remove diff --git a/RedPandaIDE/settingsdialog/settingswidget.cpp b/RedPandaIDE/settingsdialog/settingswidget.cpp index 04ca5ad7..b40258ed 100644 --- a/RedPandaIDE/settingsdialog/settingswidget.cpp +++ b/RedPandaIDE/settingsdialog/settingswidget.cpp @@ -12,6 +12,7 @@ #include #include "../widgets/coloredit.h" #include "../utils.h" +#include "../iconsmanager.h" SettingsWidget::SettingsWidget(const QString &name, const QString &group, QWidget *parent): QWidget(parent), @@ -19,11 +20,13 @@ SettingsWidget::SettingsWidget(const QString &name, const QString &group, QWidge mName(name), mGroup(group) { - } void SettingsWidget::init() { + connect(pIconsManager,&IconsManager::actionIconsUpdated, + this, &SettingsWidget::onUpdateIcons); + onUpdateIcons(); load(); connectInputs(); } @@ -71,6 +74,11 @@ void SettingsWidget::disconnectAbstractItemView(QAbstractItemView *pView) } +void SettingsWidget::updateIcons(const QSize &) +{ + +} + void SettingsWidget::connectInputs() { for (QLineEdit* p:findChildren()) { @@ -148,3 +156,8 @@ void SettingsWidget::clearSettingsChanged() mSettingsChanged = false; emit settingsChanged(false); } + +void SettingsWidget::onUpdateIcons() +{ + updateIcons(pIconsManager->actionIconSize()); +} diff --git a/RedPandaIDE/settingsdialog/settingswidget.h b/RedPandaIDE/settingsdialog/settingswidget.h index ce43956f..6096268a 100644 --- a/RedPandaIDE/settingsdialog/settingswidget.h +++ b/RedPandaIDE/settingsdialog/settingswidget.h @@ -22,6 +22,7 @@ protected: virtual void doSave() = 0; void connectAbstractItemView(QAbstractItemView* pView); void disconnectAbstractItemView(QAbstractItemView* pView); + virtual void updateIcons(const QSize& size); public: const QString& group(); const QString& name(); @@ -32,6 +33,8 @@ public slots: void setSettingsChanged(); void clearSettingsChanged(); private: +private slots: + void onUpdateIcons(); private: bool mSettingsChanged; diff --git a/RedPandaIDE/widgets/classbrowser.cpp b/RedPandaIDE/widgets/classbrowser.cpp index 5d9f9720..74c87100 100644 --- a/RedPandaIDE/widgets/classbrowser.cpp +++ b/RedPandaIDE/widgets/classbrowser.cpp @@ -160,57 +160,57 @@ QVariant ClassBrowserModel::data(const QModelIndex &index, int role) const } switch (kind) { case StatementKind::skTypedef: - return *(pIconsManager->getIcon(IconsManager::PARSER_TYPE)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_TYPE)); case StatementKind::skClass: - return *(pIconsManager->getIcon(IconsManager::PARSER_CLASS)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_CLASS)); case StatementKind::skNamespace: case StatementKind::skNamespaceAlias: - return *(pIconsManager->getIcon(IconsManager::PARSER_NAMESPACE)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_NAMESPACE)); case StatementKind::skPreprocessor: - return *(pIconsManager->getIcon(IconsManager::PARSER_DEFINE)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_DEFINE)); case StatementKind::skEnumClassType: case StatementKind::skEnumType: case StatementKind::skEnum: - return *(pIconsManager->getIcon(IconsManager::PARSER_ENUM)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_ENUM)); case StatementKind::skFunction: case StatementKind::skConstructor: case StatementKind::skDestructor: if (statement->scope == StatementScope::ssGlobal) - return *(pIconsManager->getIcon(IconsManager::PARSER_GLOBAL_METHOD)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_GLOBAL_METHOD)); if (statement->isInherited) { if (statement->classScope == StatementClassScope::scsProtected) { - return *(pIconsManager->getIcon(IconsManager::PARSER_INHERITED_PROTECTED_METHOD)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_PROTECTED_METHOD)); } else if (statement->classScope == StatementClassScope::scsPublic) { - return *(pIconsManager->getIcon(IconsManager::PARSER_INHERITED_METHOD)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_METHOD)); } } else { if (statement->classScope == StatementClassScope::scsProtected) { - return *(pIconsManager->getIcon(IconsManager::PARSER_PROTECTED_METHOD)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_PROTECTED_METHOD)); } else if (statement->classScope == StatementClassScope::scsPublic) { - return *(pIconsManager->getIcon(IconsManager::PARSER_PUBLIC_METHOD)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_PUBLIC_METHOD)); } else { - return *(pIconsManager->getIcon(IconsManager::PARSER_PRIVATE_METHOD)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_PRIVATE_METHOD)); } } break; case StatementKind::skGlobalVariable: - return *(pIconsManager->getIcon(IconsManager::PARSER_GLOBAL_VAR)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_GLOBAL_VAR)); case StatementKind::skVariable: // if (statement->scope == StatementScope::ssGlobal) // return QIcon(":/icons/images/classparser/global.ico"); if (statement->isInherited) { if (statement->classScope == StatementClassScope::scsProtected) { - return *(pIconsManager->getIcon(IconsManager::PARSER_INHERITED_PROTECTD_VAR)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_PROTECTD_VAR)); } else if (statement->classScope == StatementClassScope::scsPublic) { - return *(pIconsManager->getIcon(IconsManager::PARSER_INHERITED_VAR)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_VAR)); } } else { if (statement->classScope == StatementClassScope::scsProtected) { - return *(pIconsManager->getIcon(IconsManager::PARSER_PROTECTED_VAR)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_PROTECTED_VAR)); } else if (statement->classScope == StatementClassScope::scsPublic) { - return *(pIconsManager->getIcon(IconsManager::PARSER_PUBLIC_VAR)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_PUBLIC_VAR)); } else { - return *(pIconsManager->getIcon(IconsManager::PARSER_PRIVATE_VAR)); + return *(pIconsManager->getPixmap(IconsManager::PARSER_PRIVATE_VAR)); } } break; diff --git a/RedPandaIDE/widgets/cpudialog.cpp b/RedPandaIDE/widgets/cpudialog.cpp index c84b5bf3..39c0dad6 100644 --- a/RedPandaIDE/widgets/cpudialog.cpp +++ b/RedPandaIDE/widgets/cpudialog.cpp @@ -141,10 +141,7 @@ void CPUDialog::on_btnStepIntoInstruction_clicked() void CPUDialog::updateIcons() { - QSize size = pIconsManager->actionIconSize(); - ui->btnStepIntoInstruction->setIconSize(size); - ui->btnStepIntoInstruction->setIcon(QIcon(*pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_INTO_INSTRUCTION))); - ui->btnStepOverInstruction->setIconSize(size); - ui->btnStepOverInstruction->setIcon(QIcon(*pIconsManager->getIcon(IconsManager::ACTION_RUN_STEP_OVER_INSTRUCTION))); + pIconsManager->setIcon(ui->btnStepIntoInstruction, IconsManager::ACTION_RUN_STEP_INTO_INSTRUCTION); + pIconsManager->setIcon(ui->btnStepOverInstruction, IconsManager::ACTION_RUN_STEP_OVER_INSTRUCTION); }