From 71b869b1866c578591c22a9892d44bd861581a4c Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 28 Mar 2024 20:23:50 +0800 Subject: [PATCH] fix: scroller not correctly updated with font size change: reduce pen size of wave underline --- RedPandaIDE/RedPandaIDE.pro | 6 +++--- RedPandaIDE/editor.cpp | 5 +++-- RedPandaIDE/project.cpp | 2 ++ .../{ => resources}/colorschemes/Adaptive.scheme | 0 .../{ => resources}/colorschemes/Borland.scheme | 0 .../{ => resources}/colorschemes/Classic.scheme | 0 .../colorschemes/Classic_Plus.scheme | 0 .../{ => resources}/colorschemes/E-ink.scheme | 0 .../{ => resources}/colorschemes/GSS_Hacker.scheme | 0 .../colorschemes/Intellij_Classic.scheme | 0 .../{ => resources}/colorschemes/Matrix.scheme | 0 .../colorschemes/MoLo_CBLight.scheme | 0 .../colorschemes/MoLo_CodeBlack.scheme | 0 .../{ => resources}/colorschemes/Monokai.scheme | 0 .../{ => resources}/colorschemes/Obsidian.scheme | 0 .../{ => resources}/colorschemes/Obvilion.scheme | 0 .../colorschemes/Ochre_Butter.scheme | 0 .../{ => resources}/colorschemes/One_Dark.scheme | 0 .../colorschemes/Plastic_Code_Wrap.scheme | 0 .../{ => resources}/colorschemes/Sea_Lite.scheme | 0 .../{ => resources}/colorschemes/Twilight.scheme | 0 .../{ => resources}/colorschemes/VS_Code.scheme | 0 .../colorschemes/Visual_Studio.scheme | 0 RedPandaIDE/{ => resources}/themes/One_Dark.json | 0 RedPandaIDE/{ => resources}/themes/One_Dark.lua | 0 RedPandaIDE/{ => resources}/themes/contrast.json | 0 RedPandaIDE/{ => resources}/themes/contrast.lua | 0 .../{ => resources}/themes/contrast_close.png | Bin RedPandaIDE/{ => resources}/themes/dark.json | 0 RedPandaIDE/{ => resources}/themes/dark.lua | 0 RedPandaIDE/{ => resources}/themes/dark_close.png | Bin RedPandaIDE/{ => resources}/themes/default.json | 0 RedPandaIDE/{ => resources}/themes/default.lua | 0 RedPandaIDE/{ => resources}/themes/molo.json | 0 RedPandaIDE/{ => resources}/themes/molo.lua | 0 RedPandaIDE/{ => resources}/themes/random_light.lua | 0 RedPandaIDE/{ => resources}/themes/system.lua | 0 RedPandaIDE/settings.cpp | 4 ++-- RedPandaIDE/thememanager.h | 2 ++ 39 files changed, 12 insertions(+), 7 deletions(-) rename RedPandaIDE/{ => resources}/colorschemes/Adaptive.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Borland.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Classic.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Classic_Plus.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/E-ink.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/GSS_Hacker.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Intellij_Classic.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Matrix.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/MoLo_CBLight.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/MoLo_CodeBlack.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Monokai.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Obsidian.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Obvilion.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Ochre_Butter.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/One_Dark.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Plastic_Code_Wrap.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Sea_Lite.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Twilight.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/VS_Code.scheme (100%) rename RedPandaIDE/{ => resources}/colorschemes/Visual_Studio.scheme (100%) rename RedPandaIDE/{ => resources}/themes/One_Dark.json (100%) rename RedPandaIDE/{ => resources}/themes/One_Dark.lua (100%) rename RedPandaIDE/{ => resources}/themes/contrast.json (100%) rename RedPandaIDE/{ => resources}/themes/contrast.lua (100%) rename RedPandaIDE/{ => resources}/themes/contrast_close.png (100%) rename RedPandaIDE/{ => resources}/themes/dark.json (100%) rename RedPandaIDE/{ => resources}/themes/dark.lua (100%) rename RedPandaIDE/{ => resources}/themes/dark_close.png (100%) rename RedPandaIDE/{ => resources}/themes/default.json (100%) rename RedPandaIDE/{ => resources}/themes/default.lua (100%) rename RedPandaIDE/{ => resources}/themes/molo.json (100%) rename RedPandaIDE/{ => resources}/themes/molo.lua (100%) rename RedPandaIDE/{ => resources}/themes/random_light.lua (100%) rename RedPandaIDE/{ => resources}/themes/system.lua (100%) diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index a16f0f72..f910c833 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -611,11 +611,11 @@ iconsets_files.files += $$files(resources/iconsets/*.json, true) ENABLE_LUA_ADDON { theme_files.files += $$files(themes/*.lua, false) } else { - theme_files.files += $$files(themes/*.json, false) + theme_files.files += $$files(resources/themes/*.json, false) } -theme_files.files += $$files(themes/*.png, false) +theme_files.files += $$files(resources/themes/*.png, false) -colorscheme_files.files += $$files(colorschemes/*.scheme, false) +colorscheme_files.files += $$files(resources/colorschemes/*.scheme, false) RESOURCES += qmake_qm_files RESOURCES += iconsets_files diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index c100ce73..a60b8cee 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -1886,8 +1886,9 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes) || (attri->tokenType() == QSynedit::TokenType::Keyword) || (attri->tokenType() == QSynedit::TokenType::Preprocessor) || (attri->tokenType() == QSynedit::TokenType::String) - || (attri->tokenType() == QSynedit::TokenType::Comment) - )) { + || (attri->tokenType() == QSynedit::TokenType::Comment)) + && !token.isEmpty() + && isIdentStartChar(token[0])) { mCurrentHighlightedWord = token; } else { mCurrentHighlightedWord = ""; diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 90e8fb7a..d9191567 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -1481,6 +1481,8 @@ void Project::buildPrivateResource() case ProjectType::DynamicLib: contents.append("FILETYPE VFT_DLL"); break; + default: + break; } contents.append("{"); contents.append(" BLOCK \"StringFileInfo\""); diff --git a/RedPandaIDE/colorschemes/Adaptive.scheme b/RedPandaIDE/resources/colorschemes/Adaptive.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Adaptive.scheme rename to RedPandaIDE/resources/colorschemes/Adaptive.scheme diff --git a/RedPandaIDE/colorschemes/Borland.scheme b/RedPandaIDE/resources/colorschemes/Borland.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Borland.scheme rename to RedPandaIDE/resources/colorschemes/Borland.scheme diff --git a/RedPandaIDE/colorschemes/Classic.scheme b/RedPandaIDE/resources/colorschemes/Classic.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Classic.scheme rename to RedPandaIDE/resources/colorschemes/Classic.scheme diff --git a/RedPandaIDE/colorschemes/Classic_Plus.scheme b/RedPandaIDE/resources/colorschemes/Classic_Plus.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Classic_Plus.scheme rename to RedPandaIDE/resources/colorschemes/Classic_Plus.scheme diff --git a/RedPandaIDE/colorschemes/E-ink.scheme b/RedPandaIDE/resources/colorschemes/E-ink.scheme similarity index 100% rename from RedPandaIDE/colorschemes/E-ink.scheme rename to RedPandaIDE/resources/colorschemes/E-ink.scheme diff --git a/RedPandaIDE/colorschemes/GSS_Hacker.scheme b/RedPandaIDE/resources/colorschemes/GSS_Hacker.scheme similarity index 100% rename from RedPandaIDE/colorschemes/GSS_Hacker.scheme rename to RedPandaIDE/resources/colorschemes/GSS_Hacker.scheme diff --git a/RedPandaIDE/colorschemes/Intellij_Classic.scheme b/RedPandaIDE/resources/colorschemes/Intellij_Classic.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Intellij_Classic.scheme rename to RedPandaIDE/resources/colorschemes/Intellij_Classic.scheme diff --git a/RedPandaIDE/colorschemes/Matrix.scheme b/RedPandaIDE/resources/colorschemes/Matrix.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Matrix.scheme rename to RedPandaIDE/resources/colorschemes/Matrix.scheme diff --git a/RedPandaIDE/colorschemes/MoLo_CBLight.scheme b/RedPandaIDE/resources/colorschemes/MoLo_CBLight.scheme similarity index 100% rename from RedPandaIDE/colorschemes/MoLo_CBLight.scheme rename to RedPandaIDE/resources/colorschemes/MoLo_CBLight.scheme diff --git a/RedPandaIDE/colorschemes/MoLo_CodeBlack.scheme b/RedPandaIDE/resources/colorschemes/MoLo_CodeBlack.scheme similarity index 100% rename from RedPandaIDE/colorschemes/MoLo_CodeBlack.scheme rename to RedPandaIDE/resources/colorschemes/MoLo_CodeBlack.scheme diff --git a/RedPandaIDE/colorschemes/Monokai.scheme b/RedPandaIDE/resources/colorschemes/Monokai.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Monokai.scheme rename to RedPandaIDE/resources/colorschemes/Monokai.scheme diff --git a/RedPandaIDE/colorschemes/Obsidian.scheme b/RedPandaIDE/resources/colorschemes/Obsidian.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Obsidian.scheme rename to RedPandaIDE/resources/colorschemes/Obsidian.scheme diff --git a/RedPandaIDE/colorschemes/Obvilion.scheme b/RedPandaIDE/resources/colorschemes/Obvilion.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Obvilion.scheme rename to RedPandaIDE/resources/colorschemes/Obvilion.scheme diff --git a/RedPandaIDE/colorschemes/Ochre_Butter.scheme b/RedPandaIDE/resources/colorschemes/Ochre_Butter.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Ochre_Butter.scheme rename to RedPandaIDE/resources/colorschemes/Ochre_Butter.scheme diff --git a/RedPandaIDE/colorschemes/One_Dark.scheme b/RedPandaIDE/resources/colorschemes/One_Dark.scheme similarity index 100% rename from RedPandaIDE/colorschemes/One_Dark.scheme rename to RedPandaIDE/resources/colorschemes/One_Dark.scheme diff --git a/RedPandaIDE/colorschemes/Plastic_Code_Wrap.scheme b/RedPandaIDE/resources/colorschemes/Plastic_Code_Wrap.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Plastic_Code_Wrap.scheme rename to RedPandaIDE/resources/colorschemes/Plastic_Code_Wrap.scheme diff --git a/RedPandaIDE/colorschemes/Sea_Lite.scheme b/RedPandaIDE/resources/colorschemes/Sea_Lite.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Sea_Lite.scheme rename to RedPandaIDE/resources/colorschemes/Sea_Lite.scheme diff --git a/RedPandaIDE/colorschemes/Twilight.scheme b/RedPandaIDE/resources/colorschemes/Twilight.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Twilight.scheme rename to RedPandaIDE/resources/colorschemes/Twilight.scheme diff --git a/RedPandaIDE/colorschemes/VS_Code.scheme b/RedPandaIDE/resources/colorschemes/VS_Code.scheme similarity index 100% rename from RedPandaIDE/colorschemes/VS_Code.scheme rename to RedPandaIDE/resources/colorschemes/VS_Code.scheme diff --git a/RedPandaIDE/colorschemes/Visual_Studio.scheme b/RedPandaIDE/resources/colorschemes/Visual_Studio.scheme similarity index 100% rename from RedPandaIDE/colorschemes/Visual_Studio.scheme rename to RedPandaIDE/resources/colorschemes/Visual_Studio.scheme diff --git a/RedPandaIDE/themes/One_Dark.json b/RedPandaIDE/resources/themes/One_Dark.json similarity index 100% rename from RedPandaIDE/themes/One_Dark.json rename to RedPandaIDE/resources/themes/One_Dark.json diff --git a/RedPandaIDE/themes/One_Dark.lua b/RedPandaIDE/resources/themes/One_Dark.lua similarity index 100% rename from RedPandaIDE/themes/One_Dark.lua rename to RedPandaIDE/resources/themes/One_Dark.lua diff --git a/RedPandaIDE/themes/contrast.json b/RedPandaIDE/resources/themes/contrast.json similarity index 100% rename from RedPandaIDE/themes/contrast.json rename to RedPandaIDE/resources/themes/contrast.json diff --git a/RedPandaIDE/themes/contrast.lua b/RedPandaIDE/resources/themes/contrast.lua similarity index 100% rename from RedPandaIDE/themes/contrast.lua rename to RedPandaIDE/resources/themes/contrast.lua diff --git a/RedPandaIDE/themes/contrast_close.png b/RedPandaIDE/resources/themes/contrast_close.png similarity index 100% rename from RedPandaIDE/themes/contrast_close.png rename to RedPandaIDE/resources/themes/contrast_close.png diff --git a/RedPandaIDE/themes/dark.json b/RedPandaIDE/resources/themes/dark.json similarity index 100% rename from RedPandaIDE/themes/dark.json rename to RedPandaIDE/resources/themes/dark.json diff --git a/RedPandaIDE/themes/dark.lua b/RedPandaIDE/resources/themes/dark.lua similarity index 100% rename from RedPandaIDE/themes/dark.lua rename to RedPandaIDE/resources/themes/dark.lua diff --git a/RedPandaIDE/themes/dark_close.png b/RedPandaIDE/resources/themes/dark_close.png similarity index 100% rename from RedPandaIDE/themes/dark_close.png rename to RedPandaIDE/resources/themes/dark_close.png diff --git a/RedPandaIDE/themes/default.json b/RedPandaIDE/resources/themes/default.json similarity index 100% rename from RedPandaIDE/themes/default.json rename to RedPandaIDE/resources/themes/default.json diff --git a/RedPandaIDE/themes/default.lua b/RedPandaIDE/resources/themes/default.lua similarity index 100% rename from RedPandaIDE/themes/default.lua rename to RedPandaIDE/resources/themes/default.lua diff --git a/RedPandaIDE/themes/molo.json b/RedPandaIDE/resources/themes/molo.json similarity index 100% rename from RedPandaIDE/themes/molo.json rename to RedPandaIDE/resources/themes/molo.json diff --git a/RedPandaIDE/themes/molo.lua b/RedPandaIDE/resources/themes/molo.lua similarity index 100% rename from RedPandaIDE/themes/molo.lua rename to RedPandaIDE/resources/themes/molo.lua diff --git a/RedPandaIDE/themes/random_light.lua b/RedPandaIDE/resources/themes/random_light.lua similarity index 100% rename from RedPandaIDE/themes/random_light.lua rename to RedPandaIDE/resources/themes/random_light.lua diff --git a/RedPandaIDE/themes/system.lua b/RedPandaIDE/resources/themes/system.lua similarity index 100% rename from RedPandaIDE/themes/system.lua rename to RedPandaIDE/resources/themes/system.lua diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 7ba4aa56..fcec2f24 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -251,11 +251,11 @@ QString Settings::Dirs::data(Settings::Dirs::DataType dataType) const case DataType::None: return dataDir; case DataType::ColorScheme: - return ":/colorschemes"; + return ":/resources/colorschemes"; case DataType::IconSet: return ":/resources/iconsets"; case DataType::Theme: - return ":/themes"; + return ":/resources/themes"; case DataType::Template: return includeTrailingPathDelimiter(appResourceDir()) + "templates"; } diff --git a/RedPandaIDE/thememanager.h b/RedPandaIDE/thememanager.h index dbb1d9e3..41bd591a 100644 --- a/RedPandaIDE/thememanager.h +++ b/RedPandaIDE/thememanager.h @@ -75,7 +75,9 @@ public: enum class ThemeType { JSON, +#ifdef ENABLE_LUA_ADDON Lua, +#endif }; AppTheme(const QString& filename, ThemeType type, QObject* parent=nullptr);