- enhancement: show custom theme folder in options dialog -> enviroment -> folders

This commit is contained in:
royqh1979@gmail.com 2022-01-28 23:38:35 +08:00
parent 4a06534d39
commit 2cac889c92
4 changed files with 66 additions and 20 deletions

View File

@ -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)

View File

@ -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));
}

View File

@ -47,6 +47,8 @@ private slots:
// SettingsWidget interface
void on_btnOpenIconSetFolderInFileBrowser_clicked();
void on_btnOpenThemeFolderInFileBrowser_clicked();
protected:
void updateIcons(const QSize &size) override;
};

View File

@ -14,14 +14,21 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="txtConfigFolder">
<property name="readOnly">
<bool>true</bool>
<item row="2" column="2">
<widget class="QToolButton" name="btnOpenIconSetFolderInFileBrowser">
<property name="toolTip">
<string>Open in browser</string>
</property>
<property name="text">
<string>Open in browser</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/images/newlook24/053-open.png</normaloff>:/icons/images/newlook24/053-open.png</iconset>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="5" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -34,7 +41,21 @@
</property>
</spacer>
</item>
<item row="2" column="0" colspan="3">
<item row="0" column="1">
<widget class="QLineEdit" name="txtConfigFolder">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Custom icon sets folder:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@ -60,13 +81,6 @@
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Configuration folder:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="btnOpenConfigFolderInBrowser">
<property name="toolTip">
@ -81,24 +95,34 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Custom icon sets folder:</string>
<string>Configuration folder:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QLineEdit" name="txtIconSetFolder">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Custom theme folder:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtThemeFolder"/>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="btnOpenIconSetFolderInFileBrowser">
<widget class="QToolButton" name="btnOpenThemeFolderInFileBrowser">
<property name="toolTip">
<string>Open in browser</string>
<string>Open custom theme folder in file browser</string>
</property>
<property name="text">
<string>Open in browser</string>