- enhancement: Improve how to manage themes in Options → general → appearance.

This commit is contained in:
Roy Qu 2024-04-23 17:21:32 +08:00
parent d3db8e2b4d
commit 198ff102ac
8 changed files with 44 additions and 39 deletions

View File

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

View File

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

View File

@ -46,6 +46,7 @@ public:
private slots:
void on_cbTheme_currentIndexChanged(int index);
void on_btnCustomize_clicked();
void on_btnOpenCustomThemeFolder_clicked();
};
#endif // ENVIRONMENTAPPEARANCEWIDGET_H

View File

@ -142,6 +142,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnOpenCustomThemeFolder">
<property name="text">
<string>Open custom themes folder</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">

View File

@ -2357,7 +2357,12 @@
<translation>Fonte:</translation>
</message>
<message>
<location line="+179"/>
<location line="+83"/>
<source>Open custom themes folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+103"/>
<source>*Needs restart</source>
<translation>*Necessário reiniciar</translation>
</message>
@ -2367,12 +2372,12 @@
<translation>Tema:</translation>
</message>
<message>
<location line="-23"/>
<location line="-30"/>
<source>Create a customized copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+78"/>
<location line="+85"/>
<source>Language:</source>
<translation>Idioma:</translation>
</message>
@ -2386,12 +2391,12 @@
<translation type="vanished">Usar tema personalizado</translation>
</message>
<message>
<location line="-151"/>
<location line="-158"/>
<source>Icon Set:</source>
<translation>Conjunto de ícones:</translation>
</message>
<message>
<location line="+176"/>
<location line="+183"/>
<source>Use custom icon set</source>
<translation>Usar conjunto de ícones personalizado</translation>
</message>
@ -2415,16 +2420,6 @@
<source>Traditional Chinese</source>
<translation>Chinês tradicional</translation>
</message>
<message>
<location line="+32"/>
<source>Confirm Overwrite</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Custom Theme file %1 already exists.&lt;br /&gt;Do you want to overwrite it?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="+71"/>
<source>Icon Zoom:</source>

View File

@ -2643,7 +2643,7 @@ p, li { white-space: pre-wrap; }
<translation></translation>
</message>
<message>
<location line="+150"/>
<location line="+157"/>
<source>Theme:</source>
<translation>:</translation>
</message>
@ -2652,12 +2652,12 @@ p, li { white-space: pre-wrap; }
<translation type="vanished">使</translation>
</message>
<message>
<location line="-144"/>
<location line="-151"/>
<source>Icon Set:</source>
<translation></translation>
</message>
<message>
<location line="+176"/>
<location line="+183"/>
<source>Use custom icon set</source>
<translation>使</translation>
</message>
@ -2667,7 +2667,7 @@ p, li { white-space: pre-wrap; }
<translation></translation>
</message>
<message>
<location line="-202"/>
<location line="-209"/>
<source>Font:</source>
<translation>:</translation>
</message>
@ -2676,6 +2676,11 @@ p, li { white-space: pre-wrap; }
<source>Create a customized copy</source>
<translation></translation>
</message>
<message>
<location line="+7"/>
<source>Open custom themes folder</source>
<translation></translation>
</message>
<message>
<location line="+78"/>
<source>Language:</source>
@ -2712,14 +2717,8 @@ p, li { white-space: pre-wrap; }
<translation></translation>
</message>
<message>
<location line="+32"/>
<source>Confirm Overwrite</source>
<translation></translation>
</message>
<message>
<location line="+1"/>
<source>Custom Theme file %1 already exists.&lt;br /&gt;Do you want to overwrite it?</source>
<translation type="unfinished"></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>

View File

@ -2130,7 +2130,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+179"/>
<location line="+186"/>
<source>*Needs restart</source>
<translation type="unfinished"></translation>
</message>
@ -2150,7 +2150,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-151"/>
<location line="-158"/>
<source>Icon Set:</source>
<translation type="unfinished"></translation>
</message>
@ -2159,6 +2159,11 @@
<source>Create a customized copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Open custom themes folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+55"/>
<source>Use custom icon set</source>
@ -2184,16 +2189,6 @@
<source>Traditional Chinese</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+32"/>
<source>Confirm Overwrite</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Custom Theme file %1 already exists.&lt;br /&gt;Do you want to overwrite it?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="+71"/>
<source>Icon Zoom:</source>

View File

@ -545,7 +545,6 @@ void openFileFolderInExplorer(const QString &path)
QUrl("file:///"+
includeTrailingPathDelimiter(path),QUrl::TolerantMode));
}
}
QColor alphaBlend(const QColor &lower, const QColor &upper) {