From 2cac889c92aaa79f73553b0ec977662173497ed1 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Fri, 28 Jan 2022 23:38:35 +0800 Subject: [PATCH] - enhancement: show custom theme folder in options dialog -> enviroment -> folders --- NEWS.md | 1 + .../environmentfolderswidget.cpp | 21 ++++++- .../settingsdialog/environmentfolderswidget.h | 2 + .../environmentfolderswidget.ui | 62 +++++++++++++------ 4 files changed, 66 insertions(+), 20 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2ed0d86f..b57ae830 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Red Panda C++ Version 0.14.1 - enhancement: custom theme - fix: failed to show function tip, when there are parameters having '[' and ']' - enhancement: display localized theme name in the option dialog + - enhancement: show custom theme folder in options dialog -> enviroment -> folders Red Panda C++ Version 0.14.0 - enhancement: custom icon set ( in the configuration folder) diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp b/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp index 240d5c75..012c56ed 100644 --- a/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp @@ -40,7 +40,16 @@ EnvironmentFoldersWidget::~EnvironmentFoldersWidget() void EnvironmentFoldersWidget::doLoad() { ui->txtConfigFolder->setText(pSettings->dirs().config()); - ui->txtIconSetFolder->setText(pSettings->dirs().config(Settings::Dirs::DataType::IconSet)); + ui->txtIconSetFolder->setEnabled(pSettings->environment().useCustomIconSet()); + ui->btnOpenIconSetFolderInFileBrowser->setEnabled(pSettings->environment().useCustomIconSet()); + if (pSettings->environment().useCustomIconSet()) { + ui->txtIconSetFolder->setText(pSettings->dirs().config(Settings::Dirs::DataType::IconSet)); + } + ui->txtThemeFolder->setEnabled(pSettings->environment().useCustomTheme()); + ui->btnOpenThemeFolderInFileBrowser->setEnabled(pSettings->environment().useCustomTheme()); + if (pSettings->environment().useCustomTheme()) { + ui->txtThemeFolder->setText(pSettings->dirs().config(Settings::Dirs::DataType::Theme)); + } } void EnvironmentFoldersWidget::doSave() @@ -75,6 +84,7 @@ void EnvironmentFoldersWidget::on_btnResetDefault_clicked() void EnvironmentFoldersWidget::updateIcons(const QSize &size) { pIconsManager->setIcon(ui->btnOpenConfigFolderInBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER); + pIconsManager->setIcon(ui->btnOpenThemeFolderInFileBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER); pIconsManager->setIcon(ui->btnOpenIconSetFolderInFileBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER); } @@ -87,3 +97,12 @@ void EnvironmentFoldersWidget::on_btnOpenIconSetFolderInFileBrowser_clicked() } + +void EnvironmentFoldersWidget::on_btnOpenThemeFolderInFileBrowser_clicked() +{ + QDesktopServices::openUrl( + QUrl("file:///"+ + includeTrailingPathDelimiter(pSettings->dirs().config(Settings::Dirs::DataType::Theme)),QUrl::TolerantMode)); + +} + diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.h b/RedPandaIDE/settingsdialog/environmentfolderswidget.h index fdea57fe..22539098 100644 --- a/RedPandaIDE/settingsdialog/environmentfolderswidget.h +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.h @@ -47,6 +47,8 @@ private slots: // SettingsWidget interface void on_btnOpenIconSetFolderInFileBrowser_clicked(); + void on_btnOpenThemeFolderInFileBrowser_clicked(); + protected: void updateIcons(const QSize &size) override; }; diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.ui b/RedPandaIDE/settingsdialog/environmentfolderswidget.ui index 3efa737c..73c891d1 100644 --- a/RedPandaIDE/settingsdialog/environmentfolderswidget.ui +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.ui @@ -14,14 +14,21 @@ Form - - - - true + + + + Open in browser + + + Open in browser + + + + :/icons/images/newlook24/053-open.png:/icons/images/newlook24/053-open.png - + Qt::Vertical @@ -34,7 +41,21 @@ - + + + + true + + + + + + + Custom icon sets folder: + + + + @@ -60,13 +81,6 @@ - - - - Configuration folder: - - - @@ -81,24 +95,34 @@ - - + + - Custom icon sets folder: + Configuration folder: - + true + + + + Custom theme folder: + + + + + + - + - Open in browser + Open custom theme folder in file browser Open in browser