From 6d7bfcd62ae0318ef8e7cb36cf41e893504b8976 Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Sat, 19 Jun 2021 22:58:35 +0800 Subject: [PATCH] * work save: editor color scheme option --- RedPandaIDE/RedPandaIDE_zh_CN.ts | 431 +++++++++++++----- RedPandaIDE/colorscheme.cpp | 221 +++++++-- RedPandaIDE/colorscheme.h | 14 +- RedPandaIDE/colorschemes.qrc | 14 +- RedPandaIDE/colorschemes/Borland.scheme | 184 ++++++++ RedPandaIDE/colorschemes/Classic.scheme | 184 ++++++++ RedPandaIDE/colorschemes/Classic_Plus.scheme | 184 ++++++++ RedPandaIDE/colorschemes/GSS_Hacker.scheme | 202 ++++++++ .../colorschemes/Intellij_Classic.scheme | 184 ++++++++ RedPandaIDE/colorschemes/Matrix.scheme | 185 ++++++++ RedPandaIDE/colorschemes/Obsidian.scheme | 184 ++++++++ RedPandaIDE/colorschemes/Obvilion.scheme | 195 ++++++++ .../colorschemes/Plastic_Code_Wrap.scheme | 184 ++++++++ RedPandaIDE/colorschemes/Twilight.scheme | 185 ++++++++ RedPandaIDE/colorschemes/VS_Code.scheme | 182 ++++++++ RedPandaIDE/colorschemes/Visual_Studio.scheme | 182 ++++++++ .../{vs_code.scheme => vs_code1.scheme} | 0 RedPandaIDE/editor.cpp | 64 ++- RedPandaIDE/editor.h | 4 + RedPandaIDE/qsynedit/Constants.h | 2 + RedPandaIDE/qsynedit/MiscClasses.cpp | 2 +- RedPandaIDE/qsynedit/TextPainter.cpp | 2 + RedPandaIDE/qsynedit/highlighter/cpp.cpp | 2 +- RedPandaIDE/settings.cpp | 2 +- .../editorcolorschemewidget.cpp | 171 +++++++ .../settingsdialog/editorcolorschemewidget.h | 19 + .../settingsdialog/editorcolorschemewidget.ui | 313 +++++++------ 27 files changed, 3200 insertions(+), 296 deletions(-) create mode 100644 RedPandaIDE/colorschemes/Borland.scheme create mode 100644 RedPandaIDE/colorschemes/Classic.scheme create mode 100644 RedPandaIDE/colorschemes/Classic_Plus.scheme create mode 100644 RedPandaIDE/colorschemes/GSS_Hacker.scheme create mode 100644 RedPandaIDE/colorschemes/Intellij_Classic.scheme create mode 100644 RedPandaIDE/colorschemes/Matrix.scheme create mode 100644 RedPandaIDE/colorschemes/Obsidian.scheme create mode 100644 RedPandaIDE/colorschemes/Obvilion.scheme create mode 100644 RedPandaIDE/colorschemes/Plastic_Code_Wrap.scheme create mode 100644 RedPandaIDE/colorschemes/Twilight.scheme create mode 100644 RedPandaIDE/colorschemes/VS_Code.scheme create mode 100644 RedPandaIDE/colorschemes/Visual_Studio.scheme rename RedPandaIDE/colorschemes/{vs_code.scheme => vs_code1.scheme} (100%) diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index c7a6a34c..80f59fb6 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -63,30 +63,30 @@ Form - + 表单 Add - + 添加 Delete - + 删除 Remove Invalid - + 删除非法文件夹 Choose Folder - + 选择文件夹 @@ -94,12 +94,12 @@ Form - + 表单 Compiler set to config - + 编译器配置方案 @@ -114,52 +114,52 @@ ... - + ... General - 通用 + 基本选项 Add the following arguments when calling the compiler - + 编译时加入下列选项: Add the following arguments when calling the linker - + 链接时加入下列选项 Add Charset arguments when calling the compiler - + 编译时自动加入字符编码选项 Settings - + 编译/链接选项 Directories - + 文件夹 Programs - + 程序 TextLabel - 选项 + 选项 Resource Compiler(windres) - + 资源编辑器(winres) @@ -370,48 +370,46 @@ Are you really want to continue? Scheme - + 配色方案 ... - + - - TextLabel - 选项 + 选项 + + + + Foreground: + 前景色 + + + + Font Styles + 字体样式 + + + + Bold + 加粗 + + + + Italic + 斜体 + + + + Underlined + 下划线 - Foreground: - - - - - Font Styles - - - - - Bold - - - - - Italic - - - - - Underlined - - - - Background: - + 背景色 @@ -419,7 +417,7 @@ Are you really want to continue? Form - + 表单 @@ -902,7 +900,7 @@ Are you really want to continue? Save changes to %1? - + 将修改保存到"%1"? Save changes to %s? @@ -916,264 +914,469 @@ Are you really want to continue? C files - + C语言文件 C++ files - + C++语言文件 Header files - + 头文件 Text files - + 文本文件 All files - + 所有文件 + Error - + 错误 Can't create configuration folder %1 - + 无法创建配置文件夹"%1" Can't write to configuration file %1 - + 无法写入配置文件夹"%1" - + C options - + C语言选项 - + Code Generation - + 代码生成 Binaries - + 二进制文件 Libraries - + 库文件 C Includes - + C包含文件 C++ Includes - + C++包含文件 No - + Yes - + untitled - 无标题 + 无标题 Index %1 out of range - + 下标"%1"越界 - + Can't open file '%1' for read - + 无法打开文件"%1"进行读取 - + Can't parse json file '%1' at offset %2! Error Code: %3 - + JSON文件"%1"在位置"%2"处无法解析 - + Can't parse json file '%1' is not a color schema config file! - + "%1"不是一个合法的颜色配置文件,无法解析! - + Can't open file '%1' for write - + 无法打开文件"%1"写入内容 + + + + Assembler + 汇编 + + + + + + + + + + + + + + + + + + + + + + + + + + + Syntax + 语法 + + + + Character + 字符 + + + + Comment + 注释 + + + + Class + + + + + Float + 浮点数 + + + + Function + 函数 + + + + Gloabal Variable + 全局变量 + + + + Hexadecimal Integer + 十六进制数 + + + + Identifier + 标识符 + + + + Illegal Char + 非法字符 + + + + Local Variable + 局部变量 + + + + Integer + 整数 + + + + Octal Integer + 八进制整数 + + + + Preprocessor + 预处理指令 + + + + Reserve Word + 保留字(关键字) + + + + Space + 空格字符 + + + + String + 字符串 + + + + Escape Sequences + 转义序列 + + + + Symbol + 符号 + + + + Variable + 变量 + + + + Brace/Bracket/Parenthesis Level 1 + 1级括号 + + + + Brace/Bracket/Parenthesis Level 2 + 2级括号 + + + + Brace/Bracket/Parenthesis Level 3 + 3级括号 + + + + Brace/Bracket/Parenthesis Level 4 + 4级括号 + + + + Gutter + 装订线 + + + + + + + + + Editor + 编辑器 + + + + Active Line + 当前行 + + + + Breakpoint + 断点 + + + + Active Breakpoint + 活动断点 + + + + Folding Line + 代码折叠线 + + + + Selection + 选中文字 + + + + + Syntax Check + 语法检查 + + + + Warning + 警告 + + + + default + 缺省 Untitled - + 无标题 Settings::CompilerSet - - - Support all ANSI standard C programs (-ansi) - - - Do not recognize asm,inline or typeof as a keyword (-fno-asm) - + Support all ANSI standard C programs (-ansi) + 支持所有ANSI标准C程序(-ansi) - Imitate traditional C preprocessors (-traditional-cpp) - + 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) + + + Optimize for the following machine (-march) - + Optimize less, while maintaining full compatibility (-tune) - + Enable use of specific instructions (-mx) - + Optimization level (-Ox) - + Compile with the following pointer size (-mx) - + Language standard (-std) - + Generate debugging information (-g3) - + Generate profiling info for analysis (-pg) - + Warnings - + Inhibit all warning messages (-w) - + Show most warnings (-Wall) - + Show some more warnings (-Wextra) - + Check ISO C/C++/C++0x conformance (-pedantic) - + Only check the code for syntax errors (-fsyntax-only) - + Make all warnings into errors (-Werror) - + Abort compilation on first error (-Wfatal-errors) - + Linker - + Link an Objective C program (-lobjc) - + Do not use standard system libraries (-nostdlib) - + Do not create a console window (-mwindows) - + Strip executable (-s) - + Link libraries statically (-static) - + Output - + -fverbose-asm - + Use pipes instead of temporary files during compilation (-pipe) - + Do not assemble, compile and generate the assemble code (-S) diff --git a/RedPandaIDE/colorscheme.cpp b/RedPandaIDE/colorscheme.cpp index 02f3b5d7..4a655d57 100644 --- a/RedPandaIDE/colorscheme.cpp +++ b/RedPandaIDE/colorscheme.cpp @@ -59,6 +59,11 @@ PColorScheme ColorScheme::load(const QString &filename) return ColorScheme::fromJson(doc.object()); } +QMap ColorScheme::items() +{ + return mItems; +} + void ColorScheme::save(const QString &filename) { QFile file(filename); @@ -265,6 +270,11 @@ QStringList ColorManager::getSchemes(const QString &themeType) return lst; } +QStringList ColorManager::getDefines() +{ + return mSchemeItemDefines.keys(); +} + bool ColorManager::exists(const QString name) { return mSchemes.contains(name); @@ -312,8 +322,8 @@ void ColorManager::loadSchemesInDir(const QString &dirName, bool isCustomed) } for (int i=0;iitems().contains(itemName)) + return PColorSchemeItem(); + return scheme->items()[itemName]; +} + bool ColorManager::isValidName(const QString &name) { for (QChar ch:name) { @@ -405,24 +523,26 @@ bool ColorManager::isValidName(const QString &name) return true; } -void ColorManager::addDefine(const QString &name, bool hasForeground, bool hasBackground, bool hasFontStyle) +void ColorManager::addDefine(const QString &name, const QString &displayName, const QString &group, bool hasForeground, bool hasBackground, bool hasFontStyle) { PColorSchemeItemDefine define = std::make_shared(); + define->setDisplayName(displayName); + define->setGroup(group); define->setHasForeground(hasForeground); define->setHasBackground(hasBackground); define->setHasFontStyle(hasFontStyle); - mSchemeItemDefine[name]=define; + mSchemeItemDefines[name]=define; } bool ColorManager::removeDefine(const QString &name) { - return mSchemeItemDefine.remove(name)==1; + return mSchemeItemDefines.remove(name)==1; } PColorSchemeItemDefine ColorManager::getDefine(const QString &name) { - if (mSchemeItemDefine.contains(name)) - return mSchemeItemDefine[name]; + if (mSchemeItemDefines.contains(name)) + return mSchemeItemDefines[name]; return PColorSchemeItemDefine(); } @@ -441,6 +561,7 @@ ColorSchemeItemDefine::ColorSchemeItemDefine() mHasBackground = true; mHasForeground = true; mHasFontStyle = true; + mGroup = QObject::tr("default"); } bool ColorSchemeItemDefine::hasBackground() const @@ -472,3 +593,23 @@ void ColorSchemeItemDefine::setHasFontStyle(bool value) { mHasFontStyle = value; } + +QString ColorSchemeItemDefine::group() const +{ + return mGroup; +} + +void ColorSchemeItemDefine::setGroup(const QString &group) +{ + mGroup = group; +} + +QString ColorSchemeItemDefine::displayName() const +{ + return mDisplayName; +} + +void ColorSchemeItemDefine::setDisplayName(const QString &displayName) +{ + mDisplayName = displayName; +} diff --git a/RedPandaIDE/colorscheme.h b/RedPandaIDE/colorscheme.h index 493a268f..b76849c1 100644 --- a/RedPandaIDE/colorscheme.h +++ b/RedPandaIDE/colorscheme.h @@ -104,10 +104,18 @@ public: bool hasFontStyle() const; void setHasFontStyle(bool value); + QString group() const; + void setGroup(const QString &group); + + QString displayName() const; + void setDisplayName(const QString &displayName); + private: bool mHasBackground; bool mHasForeground; bool mHasFontStyle; + QString mGroup; + QString mDisplayName; }; using PColorSchemeItemDefine = std::shared_ptr; @@ -118,14 +126,16 @@ public: void init(); void reload(); QStringList getSchemes(const QString& themeType = QString()); + QStringList getDefines(); bool exists(const QString name); PColorScheme copy(const QString& source); bool rename(const QString& oldName, const QString& newName); PColorScheme remove(const QString& name); PColorScheme get(const QString& name); + PColorSchemeItem getItem(const QString& schemeName, const QString& itemName); bool isValidName(const QString& name); - void addDefine(const QString& name, bool hasForeground, bool hasBackground, bool hasFontStyle); + void addDefine(const QString& name, const QString& displayName, const QString& group, bool hasForeground, bool hasBackground, bool hasFontStyle); bool removeDefine(const QString &name); PColorSchemeItemDefine getDefine(const QString& name); private: @@ -134,7 +144,7 @@ private: void loadSchemesInDir(const QString& dirName, bool isCustomed); void initItemDefines(); private: - QMap mSchemeItemDefine; + QMap mSchemeItemDefines; QMap mSchemes; PColorSchemeItemDefine mDefaultSchemeItemDefine; }; diff --git a/RedPandaIDE/colorschemes.qrc b/RedPandaIDE/colorschemes.qrc index 915dd176..e6faef78 100644 --- a/RedPandaIDE/colorschemes.qrc +++ b/RedPandaIDE/colorschemes.qrc @@ -1,5 +1,17 @@ - colorschemes/vs_code.scheme + colorschemes/Borland.scheme + colorschemes/Classic.scheme + colorschemes/Classic_Plus.scheme + colorschemes/GSS_Hacker.scheme + colorschemes/Intellij_Classic.scheme + colorschemes/Matrix.scheme + colorschemes/Obsidian.scheme + colorschemes/Obvilion.scheme + colorschemes/Plastic_Code_Wrap.scheme + colorschemes/Twilight.scheme + colorschemes/Visual_Studio.scheme + colorschemes/VS_Code.scheme + colorschemes/vs_code1.scheme diff --git a/RedPandaIDE/colorschemes/Borland.scheme b/RedPandaIDE/colorschemes/Borland.scheme new file mode 100644 index 00000000..4c2ab152 --- /dev/null +++ b/RedPandaIDE/colorschemes/Borland.scheme @@ -0,0 +1,184 @@ +{ + "Assembler" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#C0C0C0", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#1313FF", + "background" : "#000080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#000000", + "background" : "#C0C0C0" + }, + "Gutter" : { + "foreground" : "#FFFF00", + "background" : "#000080" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#800000" + }, + "Active Breakpoint" : { + "foreground" : "#000000", + "background" : "#00FFFF" + }, + "Active Line" : { + "background" : "#000050" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#FFFFFF" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#FFFF00" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#FFFF00" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#FFFF00" + } +} diff --git a/RedPandaIDE/colorschemes/Classic.scheme b/RedPandaIDE/colorschemes/Classic.scheme new file mode 100644 index 00000000..54af015c --- /dev/null +++ b/RedPandaIDE/colorschemes/Classic.scheme @@ -0,0 +1,184 @@ +{ + "Assembler" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#0078D7", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#000000", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#C0C0C0", + "background" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#000080" + }, + "Gutter" : { + "foreground" : "#000000", + "background" : "#F0F0F0" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#800000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#0000FF" + }, + "Active Line" : { + "background" : "#CCFFFF" + }, + "Warning" : { + "foreground" : "#9B6900" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#000000" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#000000" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#FF0000" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#000000" + } +} diff --git a/RedPandaIDE/colorschemes/Classic_Plus.scheme b/RedPandaIDE/colorschemes/Classic_Plus.scheme new file mode 100644 index 00000000..e2b132df --- /dev/null +++ b/RedPandaIDE/colorschemes/Classic_Plus.scheme @@ -0,0 +1,184 @@ +{ + "Assembler" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#0078D7", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#800080", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#008080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#400080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#400080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#000000", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#C0C0C0", + "background" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#0000FF", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#C10000", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#400080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#000080" + }, + "Gutter" : { + "foreground" : "#000000", + "background" : "#F0F0F0" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#800000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#0000FF" + }, + "Active Line" : { + "background" : "#CCFFFF" + }, + "Warning" : { + "foreground" : "#9B6900" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#000000" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#C10000" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#0000FF" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#000000" + } +} diff --git a/RedPandaIDE/colorschemes/GSS_Hacker.scheme b/RedPandaIDE/colorschemes/GSS_Hacker.scheme new file mode 100644 index 00000000..d8393394 --- /dev/null +++ b/RedPandaIDE/colorschemes/GSS_Hacker.scheme @@ -0,0 +1,202 @@ +{ + "Assembler" : { + "foreground" : "#009CFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#C732FB", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#009CFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#577A57", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#EEDEC9", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#EEDEC9", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#FFFFFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#FFFFFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#EEDEC9", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#FFFFFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#F44747", + "background" : "#056109", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#FFFFFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#EEDEC9", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#EEDEC9", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#009CFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#AFFF80", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#1667CA", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#FFFFFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#FFFFFF", + "background" : "#171717", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#4E5F1C" + }, + "Gutter" : { + "foreground" : "#06ED02", + "background" : "#000000" + }, + "Breakpoint" : { + "foreground" : "#000000", + "background" : "#41AD00" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#C22026" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#008E99" + }, + "Active Line" : { + "background" : "#323232" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#AFFF80" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#FFFFFF" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#1667CA" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#FFFFFF" + } +} diff --git a/RedPandaIDE/colorschemes/Intellij_Classic.scheme b/RedPandaIDE/colorschemes/Intellij_Classic.scheme new file mode 100644 index 00000000..83022258 --- /dev/null +++ b/RedPandaIDE/colorschemes/Intellij_Classic.scheme @@ -0,0 +1,184 @@ +{ + "Assembler" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#008080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#8C8C8C", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#00627A", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#660E7A", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#080808", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#1750EB", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#800080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#1F542E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#0033B3", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#C0C0C0", + "background" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#007D17", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#C10000", + "bold" : true, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#400080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#000080" + }, + "Gutter" : { + "foreground" : "#000000", + "background" : "#F0F0F0" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#800000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#0000FF" + }, + "Active Line" : { + "background" : "#CCFFFF" + }, + "Warning" : { + "foreground" : "#9B6900" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#0033B3" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#C10000" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#007D17" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#080808" + } +} diff --git a/RedPandaIDE/colorschemes/Matrix.scheme b/RedPandaIDE/colorschemes/Matrix.scheme new file mode 100644 index 00000000..94bfc495 --- /dev/null +++ b/RedPandaIDE/colorschemes/Matrix.scheme @@ -0,0 +1,185 @@ +{ + "Assembler" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#3366FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#33CCCC", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#3366FF", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#F44747", + "background" : "#800000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#33CCCC", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#C3C3C3", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#000080" + }, + "Gutter" : { + "foreground" : "#00FF00", + "background" : "#000000" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#808080" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#0000FF" + }, + "Active Line" : { + "background" : "#202020" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#008000" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#FF0000" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#C3C3C3" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#00FF00" + } +} diff --git a/RedPandaIDE/colorschemes/Obsidian.scheme b/RedPandaIDE/colorschemes/Obsidian.scheme new file mode 100644 index 00000000..0425cce9 --- /dev/null +++ b/RedPandaIDE/colorschemes/Obsidian.scheme @@ -0,0 +1,184 @@ +{ + "Assembler" : { + "foreground" : "#93C763", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#FF8409", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#A082BD", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#66747B", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#FFCD22", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#FFCD22", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#E0E2E4", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#E0E2E4", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#FFCD22", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#E0E2E4", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#E0E2E4", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#FFCD22", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#FFCD22", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#A082BD", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#678CB1", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#293134", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#EC7600", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#E8E2B7", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#E0E2E4", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#404E51" + }, + "Gutter" : { + "foreground" : "#6A8088", + "background" : "#2F383C" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#99CC00" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#D51212" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#00CCFF" + }, + "Active Line" : { + "background" : "#323232" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#678CB1" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#E8E2B7" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#EC7600" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#E0E2E4" + } +} diff --git a/RedPandaIDE/colorschemes/Obvilion.scheme b/RedPandaIDE/colorschemes/Obvilion.scheme new file mode 100644 index 00000000..f7c8fbda --- /dev/null +++ b/RedPandaIDE/colorschemes/Obvilion.scheme @@ -0,0 +1,195 @@ +{ + "Assembler" : { + "foreground" : "#79ABFF", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#D25252", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#79ABFF", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#C7DD0C", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#7FB347", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#7FB347", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#BED6FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#BED6FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#7FB347", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#BED6FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#F44747", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#BED6FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#7FB347", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#7FB347", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#79ABFF", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#FFFFFF", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#FFC600", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#D9E577", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#BED6FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#D0D0D0", + "background" : "#000000" + }, + "Gutter" : { + "foreground" : "#D0D0D0", + "background" : "#323232" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#808000" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#FF2A55" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#33CCCC" + }, + "Active Line" : { + "background" : "#323232" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#FFFFFF" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#D9E577" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#FFC600" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#BED6FF" + } +} diff --git a/RedPandaIDE/colorschemes/Plastic_Code_Wrap.scheme b/RedPandaIDE/colorschemes/Plastic_Code_Wrap.scheme new file mode 100644 index 00000000..0bef601e --- /dev/null +++ b/RedPandaIDE/colorschemes/Plastic_Code_Wrap.scheme @@ -0,0 +1,184 @@ +{ + "Assembler" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#55E439", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#FFAA00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#1E9AE0", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#FF3A83", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#FF3A83", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#9CDCFE", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#FF3A83", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#BFBFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#F44747", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#9CDCFE", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#FF3A83", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#FF3A83", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#FFAA00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#F6F080", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#0B161D", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#55E439", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#FFAA00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#9CDCFE", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#00FFFF", + "background" : "#000000" + }, + "Gutter" : { + "foreground" : "#FFFFFF", + "background" : "#2E3436" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#99CC00" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#D51212" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#00CCFF" + }, + "Active Line" : { + "background" : "#323232" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#F6F080" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#FFAA00" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#55E439" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#BFBFFF" + } +} diff --git a/RedPandaIDE/colorschemes/Twilight.scheme b/RedPandaIDE/colorschemes/Twilight.scheme new file mode 100644 index 00000000..bb11d7e0 --- /dev/null +++ b/RedPandaIDE/colorschemes/Twilight.scheme @@ -0,0 +1,185 @@ +{ + "Assembler" : { + "foreground" : "#00FF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#C0C0C0", + "bold" : false, + "italic" : true, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#F44747", + "background" : "#800000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#00FFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#FFFF00", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#00FFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#000080" + }, + "Gutter" : { + "foreground" : "#FFFFFF", + "background" : "#000000" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Error" : { + "foreground" : "#FFFFFF", + "background" : "#800000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#0000FF" + }, + "Active Line" : { + "background" : "#221111" + }, + "Warning" : { + "foreground" : "#FFAA00" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#00FFFF" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#00FFFF" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#FFFF00" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#FFFFFF" + } +} diff --git a/RedPandaIDE/colorschemes/VS_Code.scheme b/RedPandaIDE/colorschemes/VS_Code.scheme new file mode 100644 index 00000000..c5a9da22 --- /dev/null +++ b/RedPandaIDE/colorschemes/VS_Code.scheme @@ -0,0 +1,182 @@ +{ + "Assembler" : { + "foreground" : "#FF00FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#D69D85", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#4EC9B0", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#6A9955", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#B5CEA8", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#B5CEA8", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#BFBFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#E2C8B8", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#B5CEA8", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#DCDCAA", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF3C3C", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#9CDCFE", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#B5CEA8", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#B5CEA8", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#C586C0", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#569CD6", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#505050", + "background" : "#1E1E1E", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#D69D85", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#D4D4D4", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#9CDCFE", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#000000", + "background" : "#808080" + }, + "Gutter" : { + "foreground" : "#858585", + "background" : "#1E1E1E" + }, + "Breakpoint" : { + }, + "Error" : { + "foreground" : "#C0C0C0", + "background" : "#800000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFCE", + "background" : "#00376F" + }, + "Active Line" : { + "background" : "#323232" + }, + "Warning" : { + "foreground" : "#FF8040" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#569CD6" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#D4D4D4" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#D69D85" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#DCDCAA" + } +} diff --git a/RedPandaIDE/colorschemes/Visual_Studio.scheme b/RedPandaIDE/colorschemes/Visual_Studio.scheme new file mode 100644 index 00000000..fc9abccb --- /dev/null +++ b/RedPandaIDE/colorschemes/Visual_Studio.scheme @@ -0,0 +1,182 @@ +{ + "Assembler" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Character" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Class" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Comment" : { + "foreground" : "#008000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Escape sequences" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Float" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Function" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Global variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Hexadecimal" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Identifier" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Illegal Char" : { + "foreground" : "#FF0000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Local Variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Number" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Octal" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Preprocessor" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Reserved Word" : { + "foreground" : "#0000FF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Space" : { + "foreground" : "#C0C0C0", + "background" : "#FFFFFF", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "String" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Symbol" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Variable" : { + "foreground" : "#000000", + "bold" : false, + "italic" : false, + "underlined" : false, + "strikeout" : false + }, + "Selected text" : { + "foreground" : "#FFFFFF", + "background" : "#000080" + }, + "Gutter" : { + "background" : "#FFFFFF" + }, + "Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#FF0000" + }, + "Error" : { + "foreground" : "#FF0000" + }, + "Active Breakpoint" : { + "foreground" : "#FFFFFF", + "background" : "#0000FF" + }, + "Active Line" : { + "background" : "#CCFFFF" + }, + "Warning" : { + "foreground" : "#AA7300" + }, + "Indent Guide Line" : { + "foreground" : "#C0C0C0" + }, + "brace/parenthesis/bracket level 1" : { + "foreground" : "#0000FF" + }, + "brace/parenthesis/bracket level 2" : { + "foreground" : "#000000" + }, + "brace/parenthesis/bracket level 3" : { + "foreground" : "#000000" + }, + "brace/parenthesis/bracket level 4" : { + "foreground" : "#000000" + } +} diff --git a/RedPandaIDE/colorschemes/vs_code.scheme b/RedPandaIDE/colorschemes/vs_code1.scheme similarity index 100% rename from RedPandaIDE/colorschemes/vs_code.scheme rename to RedPandaIDE/colorschemes/vs_code1.scheme diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 3336aeb1..cd5baac6 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -17,6 +17,7 @@ #include "HighlighterManager.h" #include "qsynedit/exporter/synrtfexporter.h" #include "qsynedit/exporter/synhtmlexporter.h" +#include "qsynedit/Constants.h" #include #include @@ -38,6 +39,11 @@ const char *SaveException::what() const noexcept { int Editor::newfileCount=0; +Editor::Editor(QWidget *parent): + Editor(parent,QObject::tr("untitled"),ENCODING_SYSTEM_DEFAULT,false,true,nullptr) +{ +} + Editor::Editor(QWidget *parent, const QString& filename, const QByteArray& encoding, bool inProject, bool isNew, @@ -54,7 +60,7 @@ Editor::Editor(QWidget *parent, const QString& filename, mFilename = tr("untitled%1").arg(newfileCount); } QFileInfo fileInfo(mFilename); - if (mParentPageControl!=NULL) { + if (mParentPageControl!=nullptr) { mParentPageControl->addTab(this,QString()); updateCaption(); } @@ -83,7 +89,7 @@ Editor::Editor(QWidget *parent, const QString& filename, } Editor::~Editor() { - if (mParentPageControl!=NULL) { + if (mParentPageControl!=nullptr) { int index = mParentPageControl->indexOf(this); mParentPageControl->removeTab(index); } @@ -172,8 +178,9 @@ bool Editor::saveAs(){ void Editor::activate() { - this->mParentPageControl->setCurrentWidget(this); - this->setFocus(); + if (mParentPageControl!=nullptr) + mParentPageControl->setCurrentWidget(this); + setFocus(); } const QByteArray& Editor::encodingOption() const noexcept{ @@ -454,8 +461,55 @@ void Editor::applySettings() } +void Editor::applyColorScheme(const QString& schemeName) +{ + if (highlighter()) { + if (highlighter()->getName() == SYN_HIGHLIGHTER_CPP) { + for (QString name: highlighter()->attributes().keys()) { + PColorSchemeItem item = pColorManager->getItem(schemeName,name); + if (item) { + PSynHighlighterAttribute attr = highlighter()->attributes()[name]; + attr->setBackground(item->background()); + attr->setForeground(item->foreground()); + SynFontStyles styles = SynFontStyle::fsNone; + if (item->bold()) { + styles.setFlag(SynFontStyle::fsBold); + } + if (item->italic()) { + styles.setFlag(SynFontStyle::fsItalic); + } + if (item->underlined()) { + styles.setFlag(SynFontStyle::fsUnderline); + } + if (item->strikeout()) { + styles.setFlag(SynFontStyle::fsStrikeOut); + } + } + } + } + } + PColorSchemeItem item = pColorManager->getItem(schemeName,COLOR_SCHEME_ACTIVE_LINE); + if (item) { + setActiveLineColor(item->background()); + } + item = pColorManager->getItem(schemeName,COLOR_SCHEME_GUTTER); + if (item) { + gutter().setTextColor(item->foreground()); + gutter().setColor(item->background()); + } + item = pColorManager->getItem(schemeName,COLOR_SCHEME_FOLD_LINE); + if (item) { + //todo + } + item = pColorManager->getItem(schemeName,COLOR_SCHEME_INDENT_GUIDE_LINE); + if (item) { + //todo + } + this->invalidate(); +} + void Editor::updateCaption(const QString& newCaption) { - if (mParentPageControl==NULL) { + if (mParentPageControl==nullptr) { return; } int index = mParentPageControl->indexOf(this); diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h index 96a0ae8d..22bd668d 100644 --- a/RedPandaIDE/editor.h +++ b/RedPandaIDE/editor.h @@ -5,6 +5,7 @@ #include #include #include "qsynedit/SynEdit.h" +#include "colorscheme.h" class SaveException: public std::exception { @@ -35,6 +36,8 @@ public: WarningMarker }; + explicit Editor(QWidget *parent); + explicit Editor(QWidget *parent, const QString& filename, const QByteArray& encoding, bool inProject, bool isNew,QTabWidget* parentPageControl); @@ -65,6 +68,7 @@ public: void updateCaption(const QString& newCaption=QString()); void applySettings(); + void applyColorScheme(const QString& schemeName); void copyToClipboard() override; void cutToClipboard() override; void copyAsHTML(); diff --git a/RedPandaIDE/qsynedit/Constants.h b/RedPandaIDE/qsynedit/Constants.h index ccd6380a..52cf2597 100644 --- a/RedPandaIDE/qsynedit/Constants.h +++ b/RedPandaIDE/qsynedit/Constants.h @@ -164,4 +164,6 @@ extern const QChar SynSoftBreakGlyph; #define SYNS_ExporterFormatHTML "HTML" #define SYNS_ExporterFormatRTF "RTF" #define SYNS_ExporterFormatTeX "TeX" + +#define SYN_HIGHLIGHTER_CPP "SynCppHighlighter" #endif // CONSTANTS_H diff --git a/RedPandaIDE/qsynedit/MiscClasses.cpp b/RedPandaIDE/qsynedit/MiscClasses.cpp index 6d1a0382..19abf811 100644 --- a/RedPandaIDE/qsynedit/MiscClasses.cpp +++ b/RedPandaIDE/qsynedit/MiscClasses.cpp @@ -15,7 +15,7 @@ SynGutter::SynGutter(QObject *parent): mLeftOffset = 16; mRightOffset = 2; mVisible = true; - mUseFontStyle = false; + mUseFontStyle = true; mAutoSize = true; mAutoSizeDigitCount = mDigitCount; mBorderStyle = SynGutterBorderStyle::Middle; diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp index 81686b5d..367769a5 100644 --- a/RedPandaIDE/qsynedit/TextPainter.cpp +++ b/RedPandaIDE/qsynedit/TextPainter.cpp @@ -102,6 +102,8 @@ void SynEditTextPainter::paintGutter(const QRect& clip) if (edit->mGutter.useFontStyle()) { painter->setFont(edit->mGutter.font()); + } + if (edit->mGutter.textColor().isValid()) { painter->setPen(edit->mGutter.textColor()); } else { painter->setPen(edit->palette().color(QPalette::Text)); diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.cpp b/RedPandaIDE/qsynedit/highlighter/cpp.cpp index 21f124f5..9a8a33eb 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.cpp +++ b/RedPandaIDE/qsynedit/highlighter/cpp.cpp @@ -1572,7 +1572,7 @@ SynHighlighterClass SynEditCppHighlighter::getClass() const QString SynEditCppHighlighter::getName() const { - return "SynCppHighlighter"; + return SYN_HIGHLIGHTER_CPP; } QString SynEditCppHighlighter::languageName() diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index a8b525e8..914ed047 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -1819,7 +1819,7 @@ void Settings::Environment::doLoad() //Appearence mTheme = stringValue("theme","default"); mInterfaceFont = stringValue("interface font","Segoe UI"); - mInterfaceFontSize = intValue("interface font size",9); + mInterfaceFontSize = intValue("interface font size",11); } int Settings::Environment::interfaceFontSize() const diff --git a/RedPandaIDE/settingsdialog/editorcolorschemewidget.cpp b/RedPandaIDE/settingsdialog/editorcolorschemewidget.cpp index f44bf714..a626bc1b 100644 --- a/RedPandaIDE/settingsdialog/editorcolorschemewidget.cpp +++ b/RedPandaIDE/settingsdialog/editorcolorschemewidget.cpp @@ -12,6 +12,81 @@ EditorColorSchemeWidget::EditorColorSchemeWidget(const QString& name, const QStr for (QString schemeName: pColorManager->getSchemes()) { ui->cbScheme->addItem(schemeName); } + ui->treeItems->setModel(&mDefinesModel); + mDefinesModel.setHorizontalHeaderLabels(QStringList()); + for (QString defineName : pColorManager->getDefines()) { + addDefine(defineName, pColorManager->getDefine(defineName)); + } + ui->treeItems->expandAll(); + connect(ui->treeItems->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &EditorColorSchemeWidget::onItemSelectionChanged); + connect(this, &SettingsWidget::settingsChanged,this, + &EditorColorSchemeWidget::onSettingChanged); + connect(ui->cbBackground,&QCheckBox::stateChanged, + this, &EditorColorSchemeWidget::onBackgroundChanged); + connect(ui->colorBackground,&ColorEdit::colorChanged, + this, &EditorColorSchemeWidget::onBackgroundChanged); + connect(ui->cbForeground,&QCheckBox::stateChanged, + this, &EditorColorSchemeWidget::onForegroundChanged); + connect(ui->colorForeground,&ColorEdit::colorChanged, + this, &EditorColorSchemeWidget::onForegroundChanged); + connect(ui->cbBold,&QCheckBox::stateChanged, + this, &EditorColorSchemeWidget::onFontStyleChanged); + connect(ui->cbItalic,&QCheckBox::stateChanged, + this, &EditorColorSchemeWidget::onFontStyleChanged); + connect(ui->cbStrikeout,&QCheckBox::stateChanged, + this, &EditorColorSchemeWidget::onFontStyleChanged); + connect(ui->cbUnderlined,&QCheckBox::stateChanged, + this, &EditorColorSchemeWidget::onFontStyleChanged); + QModelIndex groupIndex = mDefinesModel.index(0,0); + QModelIndex index = mDefinesModel.index(0,0,groupIndex); + ui->treeItems->setCurrentIndex(index); + ui->editDemo->lines()->setText( + "#include \n" + "#include \n" + "\n" + "int x=10;\n" + "\n" + "int main(int argc, char **argv)\n" + "{\n" + " int numbers[20];\n" + " float average, total; //breakpoint\n" + " for (int i = 0; i <= 19; i++)\n" + " { // active breakpoint\n" + " numbers[i] = i+x;\n" + " Total += i; // error line\n" + " }\n" + " average = total / 20; // comment\n" + " cout << \"total: \" << total << \"\nAverage: \" << average;\n" + " getch();\n" + "}\n" + ); + ui->editDemo->setReadOnly(true); +} + +void EditorColorSchemeWidget::addDefine(const QString& name, PColorSchemeItemDefine define) +{ + QList items = mDefinesModel.findItems(define->group()); + QStandardItem* pGroupItem; + if (items.count() == 0 ) { + pGroupItem = new QStandardItem(define->group()); + pGroupItem->setData("", NameRole); + mDefinesModel.appendRow(pGroupItem); + } else { + pGroupItem = items[0]; + } + QStandardItem* pWidgetItem = new QStandardItem(define->displayName()); + pWidgetItem->setData(name, NameRole); + pGroupItem->appendRow(pWidgetItem); +} + +PColorSchemeItem EditorColorSchemeWidget::getCurrentItem() +{ + QItemSelectionModel * selectionModel = ui->treeItems->selectionModel(); + QString name =mDefinesModel.data(selectionModel->currentIndex(),NameRole).toString(); + if (name.isEmpty()) + return PColorSchemeItem(); + return pColorManager->getItem(ui->cbScheme->currentText(), name); } EditorColorSchemeWidget::~EditorColorSchemeWidget() @@ -19,6 +94,102 @@ EditorColorSchemeWidget::~EditorColorSchemeWidget() delete ui; } +static void setColorProp(ColorEdit* ce, QCheckBox* cb, const QColor& color) { + if (color.isValid()) { + cb->setChecked(true); + ce->setColor(color); + ce->setVisible(true); + } else { + cb->setChecked(false); + ce->setVisible(false); + } +} + +void EditorColorSchemeWidget::onItemSelectionChanged() +{ + QItemSelectionModel * selectionModel = ui->treeItems->selectionModel(); + QString name =mDefinesModel.data(selectionModel->currentIndex(),NameRole).toString(); + bool found = false; + if (!name.isEmpty()) { + PColorSchemeItemDefine define = pColorManager->getDefine(name); + if (define) { + found = true; + ui->cbBackground->setEnabled(define->hasBackground()); + ui->colorBackground->setEnabled(define->hasBackground()); + ui->cbForeground->setEnabled(define->hasForeground()); + ui->colorForeground->setEnabled(define->hasForeground()); + ui->grpFontStyles->setEnabled(define->hasFontStyle()); + PColorSchemeItem item = pColorManager->getItem(ui->cbScheme->currentText(), name); + if (item) { + if (define->hasBackground()) { + setColorProp(ui->colorBackground, ui->cbBackground,item->background()); + } else { + setColorProp(ui->colorBackground, ui->cbBackground,QColor()); + } + if (define->hasForeground()) { + setColorProp(ui->colorForeground, ui->cbForeground,item->foreground()); + } else { + setColorProp(ui->colorForeground, ui->cbForeground,QColor()); + } + if (define->hasFontStyle()) { + ui->cbBold->setChecked(item->bold()); + ui->cbItalic->setChecked(item->italic()); + ui->cbUnderlined->setChecked(item->underlined()); + ui->cbStrikeout->setChecked(item->strikeout()); + } else { + ui->cbBold->setChecked(false); + ui->cbItalic->setChecked(false); + ui->cbUnderlined->setChecked(false); + ui->cbStrikeout->setChecked(false); + } + } + } + } + // not found + ui->widgetSchemeItem->setEnabled(found); +} + +void EditorColorSchemeWidget::onSettingChanged() +{ + ui->editDemo->applyColorScheme(ui->cbScheme->currentText()); +} + +void EditorColorSchemeWidget::onForegroundChanged() +{ + PColorSchemeItem item = getCurrentItem(); + if (!item) + return; + if (ui->cbForeground->isChecked()) { + item->setForeground(ui->colorForeground->color()); + } else { + item->setForeground(QColor()); + } +} + +void EditorColorSchemeWidget::onBackgroundChanged() +{ + PColorSchemeItem item = getCurrentItem(); + if (!item) + return; + if (ui->cbBackground->isChecked()) { + item->setBackground(ui->colorBackground->color()); + } else { + item->setBackground(QColor()); + } + +} + +void EditorColorSchemeWidget::onFontStyleChanged() +{ + PColorSchemeItem item = getCurrentItem(); + if (!item) + return; + item->setBold(ui->cbBold->isChecked()); + item->setItalic(ui->cbItalic->isChecked()); + item->setStrikeout(ui->cbStrikeout->isChecked()); + item->setUnderlined(ui->cbUnderlined->isChecked()); +} + void EditorColorSchemeWidget::doLoad() { diff --git a/RedPandaIDE/settingsdialog/editorcolorschemewidget.h b/RedPandaIDE/settingsdialog/editorcolorschemewidget.h index a720557b..e7475803 100644 --- a/RedPandaIDE/settingsdialog/editorcolorschemewidget.h +++ b/RedPandaIDE/settingsdialog/editorcolorschemewidget.h @@ -2,6 +2,9 @@ #define EDITORCOLORSCHEMEWIDGET_H #include "settingswidget.h" +#include "../colorscheme.h" + +#include namespace Ui { class EditorColorSchemeWidget; @@ -12,16 +15,32 @@ class EditorColorSchemeWidget : public SettingsWidget Q_OBJECT public: + enum { + NameRole = Qt::UserRole+1 + }; explicit EditorColorSchemeWidget(const QString& name, const QString& group, QWidget *parent = nullptr); ~EditorColorSchemeWidget(); +public slots: + void onItemSelectionChanged(); + void onSettingChanged(); + void onForegroundChanged(); + void onBackgroundChanged(); + void onFontStyleChanged(); + +private: + void addDefine(const QString& name, PColorSchemeItemDefine define); + PColorSchemeItem getCurrentItem(); + private: Ui::EditorColorSchemeWidget *ui; + QStandardItemModel mDefinesModel; // SettingsWidget interface protected: void doLoad() override; void doSave() override; + }; #endif // EDITORCOLORSCHEMEWIDGET_H diff --git a/RedPandaIDE/settingsdialog/editorcolorschemewidget.ui b/RedPandaIDE/settingsdialog/editorcolorschemewidget.ui index 99ffbc85..65a8050e 100644 --- a/RedPandaIDE/settingsdialog/editorcolorschemewidget.ui +++ b/RedPandaIDE/settingsdialog/editorcolorschemewidget.ui @@ -23,6 +23,21 @@ + + 7 + + + 0 + + + 0 + + + 0 + + + 0 + @@ -71,137 +86,167 @@ 0 - - - 0 - - - 0 - - - 0 - - - 0 - + - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - Foreground: - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Font Styles - - - - - - Bold - - - - - - - Italic - - - - - - - Underlined - - - - - - - - - - Background: - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised + + + Qt::Vertical + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QAbstractItemView::NoEditTriggers + + + false + + + + + + + true + + + + + + Background: + + + + + + + Foreground: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Font Styles + + + + + + Bold + + + + + + + Italic + + + + + + + Strikeout + + + + + + + Underlined + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + @@ -211,9 +256,15 @@ - SynEdit + ColorEdit QFrame -
qsynedit/SynEdit.h
+
widgets/coloredit.h
+ 1 +
+ + Editor + QFrame +
editor.h
1