From 198ff102ac36561d29ec7bd82b7a043227d54d00 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 23 Apr 2024 17:21:32 +0800 Subject: [PATCH] =?UTF-8?q?-=20enhancement:=20Improve=20how=20to=20manage?= =?UTF-8?q?=20themes=20in=20Options=20=E2=86=92=20general=20=E2=86=92=20ap?= =?UTF-8?q?pearance.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NEWS.md | 1 + .../environmentappearancewidget.cpp | 8 ++++++ .../environmentappearancewidget.h | 1 + .../environmentappearancewidget.ui | 7 ++++++ RedPandaIDE/translations/RedPandaIDE_pt_BR.ts | 25 ++++++++----------- RedPandaIDE/translations/RedPandaIDE_zh_CN.ts | 21 ++++++++-------- RedPandaIDE/translations/RedPandaIDE_zh_TW.ts | 19 ++++++-------- RedPandaIDE/utils.cpp | 1 - 8 files changed, 44 insertions(+), 39 deletions(-) diff --git a/NEWS.md b/NEWS.md index ce7f3d90..84ed192a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -149,6 +149,7 @@ Red Panda C++ Version 2.27 - fix: In sdcc project, sdcc keywords are not in completion suggest list. - fix: In sdcc project, parser are not correctly inited as sdcc parser. - fix: Temp object + member function call is wrongly parsed as constructor. + - enhancement: Improve how to manage themes in Options → general → appearance. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/settingsdialog/environmentappearancewidget.cpp b/RedPandaIDE/settingsdialog/environmentappearancewidget.cpp index d8b9e192..64d85b78 100644 --- a/RedPandaIDE/settingsdialog/environmentappearancewidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentappearancewidget.cpp @@ -111,6 +111,7 @@ void EnvironmentAppearanceWidget::on_cbTheme_currentIndexChanged(int /* index */ ThemeManager themeManager; PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString()); ui->btnCustomize->setVisible(appTheme->category() == AppTheme::ThemeCategory::BuiltIn); + ui->btnOpenCustomThemeFolder->setVisible(appTheme->category() == AppTheme::ThemeCategory::Custom); if(!appTheme->defaultIconSet().isEmpty()) { for (int i=0; icbIconSet->count();i++) { if (ui->cbIconSet->itemData(i) == appTheme->defaultIconSet()) { @@ -143,3 +144,10 @@ void EnvironmentAppearanceWidget::on_btnCustomize_clicked() } } + +void EnvironmentAppearanceWidget::on_btnOpenCustomThemeFolder_clicked() +{ + QString customThemeFolder = pSettings->dirs().config(Settings::Dirs::DataType::Theme); + openFileFolderInExplorer(customThemeFolder); +} + diff --git a/RedPandaIDE/settingsdialog/environmentappearancewidget.h b/RedPandaIDE/settingsdialog/environmentappearancewidget.h index 32d43426..b86acedc 100644 --- a/RedPandaIDE/settingsdialog/environmentappearancewidget.h +++ b/RedPandaIDE/settingsdialog/environmentappearancewidget.h @@ -46,6 +46,7 @@ public: private slots: void on_cbTheme_currentIndexChanged(int index); void on_btnCustomize_clicked(); + void on_btnOpenCustomThemeFolder_clicked(); }; #endif // ENVIRONMENTAPPEARANCEWIDGET_H diff --git a/RedPandaIDE/settingsdialog/environmentappearancewidget.ui b/RedPandaIDE/settingsdialog/environmentappearancewidget.ui index 73b9f6e4..0b6aaa3e 100644 --- a/RedPandaIDE/settingsdialog/environmentappearancewidget.ui +++ b/RedPandaIDE/settingsdialog/environmentappearancewidget.ui @@ -142,6 +142,13 @@ + + + + Open custom themes folder + + + diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts index de1919b3..68d07b52 100644 --- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts +++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts @@ -2357,7 +2357,12 @@ Fonte: - + + Open custom themes folder + + + + *Needs restart *Necessário reiniciar @@ -2367,12 +2372,12 @@ Tema: - + Create a customized copy - + Language: Idioma: @@ -2386,12 +2391,12 @@ Usar tema personalizado - + Icon Set: Conjunto de ícones: - + Use custom icon set Usar conjunto de ícones personalizado @@ -2415,16 +2420,6 @@ Traditional Chinese Chinês tradicional - - - Confirm Overwrite - - - - - Custom Theme file %1 already exists.<br />Do you want to overwrite it? - - Icon Zoom: diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts index 884b75ce..5fb503fd 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts @@ -2643,7 +2643,7 @@ p, li { white-space: pre-wrap; } 表单 - + Theme: 主题: @@ -2652,12 +2652,12 @@ p, li { white-space: pre-wrap; } 使用自定义主题 - + Icon Set: 图标集: - + Use custom icon set 使用自定义图标 @@ -2667,7 +2667,7 @@ p, li { white-space: pre-wrap; } 图标缩放: - + Font: 字体: @@ -2676,6 +2676,11 @@ p, li { white-space: pre-wrap; } Create a customized copy 自定义 + + + Open custom themes folder + 打开自定义主题文件夹 + Language: @@ -2712,14 +2717,8 @@ p, li { white-space: pre-wrap; } 繁体中文 - Confirm Overwrite - 确认覆盖 - - - - Custom Theme file %1 already exists.<br />Do you want to overwrite it? - + 确认覆盖 diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts index 1c466c1d..43d7371a 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts @@ -2130,7 +2130,7 @@ - + *Needs restart @@ -2150,7 +2150,7 @@ - + Icon Set: @@ -2159,6 +2159,11 @@ Create a customized copy + + + Open custom themes folder + + Use custom icon set @@ -2184,16 +2189,6 @@ Traditional Chinese - - - Confirm Overwrite - - - - - Custom Theme file %1 already exists.<br />Do you want to overwrite it? - - Icon Zoom: diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index 4cf84fe2..dcc0bcd5 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -545,7 +545,6 @@ void openFileFolderInExplorer(const QString &path) QUrl("file:///"+ includeTrailingPathDelimiter(path),QUrl::TolerantMode)); } - } QColor alphaBlend(const QColor &lower, const QColor &upper) {