- 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, sdcc keywords are not in completion suggest list.
- fix: In sdcc project, parser are not correctly inited as sdcc parser. - fix: In sdcc project, parser are not correctly inited as sdcc parser.
- fix: Temp object + member function call is wrongly parsed as constructor. - 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 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -111,6 +111,7 @@ void EnvironmentAppearanceWidget::on_cbTheme_currentIndexChanged(int /* index */
ThemeManager themeManager; ThemeManager themeManager;
PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString()); PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString());
ui->btnCustomize->setVisible(appTheme->category() == AppTheme::ThemeCategory::BuiltIn); ui->btnCustomize->setVisible(appTheme->category() == AppTheme::ThemeCategory::BuiltIn);
ui->btnOpenCustomThemeFolder->setVisible(appTheme->category() == AppTheme::ThemeCategory::Custom);
if(!appTheme->defaultIconSet().isEmpty()) { if(!appTheme->defaultIconSet().isEmpty()) {
for (int i=0; i<ui->cbIconSet->count();i++) { for (int i=0; i<ui->cbIconSet->count();i++) {
if (ui->cbIconSet->itemData(i) == appTheme->defaultIconSet()) { 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: private slots:
void on_cbTheme_currentIndexChanged(int index); void on_cbTheme_currentIndexChanged(int index);
void on_btnCustomize_clicked(); void on_btnCustomize_clicked();
void on_btnOpenCustomThemeFolder_clicked();
}; };
#endif // ENVIRONMENTAPPEARANCEWIDGET_H #endif // ENVIRONMENTAPPEARANCEWIDGET_H

View File

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

View File

@ -2357,7 +2357,12 @@
<translation>Fonte:</translation> <translation>Fonte:</translation>
</message> </message>
<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> <source>*Needs restart</source>
<translation>*Necessário reiniciar</translation> <translation>*Necessário reiniciar</translation>
</message> </message>
@ -2367,12 +2372,12 @@
<translation>Tema:</translation> <translation>Tema:</translation>
</message> </message>
<message> <message>
<location line="-23"/> <location line="-30"/>
<source>Create a customized copy</source> <source>Create a customized copy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+78"/> <location line="+85"/>
<source>Language:</source> <source>Language:</source>
<translation>Idioma:</translation> <translation>Idioma:</translation>
</message> </message>
@ -2386,12 +2391,12 @@
<translation type="vanished">Usar tema personalizado</translation> <translation type="vanished">Usar tema personalizado</translation>
</message> </message>
<message> <message>
<location line="-151"/> <location line="-158"/>
<source>Icon Set:</source> <source>Icon Set:</source>
<translation>Conjunto de ícones:</translation> <translation>Conjunto de ícones:</translation>
</message> </message>
<message> <message>
<location line="+176"/> <location line="+183"/>
<source>Use custom icon set</source> <source>Use custom icon set</source>
<translation>Usar conjunto de ícones personalizado</translation> <translation>Usar conjunto de ícones personalizado</translation>
</message> </message>
@ -2415,16 +2420,6 @@
<source>Traditional Chinese</source> <source>Traditional Chinese</source>
<translation>Chinês tradicional</translation> <translation>Chinês tradicional</translation>
</message> </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> <message>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="+71"/> <location filename="../settingsdialog/environmentappearancewidget.ui" line="+71"/>
<source>Icon Zoom:</source> <source>Icon Zoom:</source>

View File

@ -2643,7 +2643,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+150"/> <location line="+157"/>
<source>Theme:</source> <source>Theme:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
@ -2652,12 +2652,12 @@ p, li { white-space: pre-wrap; }
<translation type="vanished">使</translation> <translation type="vanished">使</translation>
</message> </message>
<message> <message>
<location line="-144"/> <location line="-151"/>
<source>Icon Set:</source> <source>Icon Set:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+176"/> <location line="+183"/>
<source>Use custom icon set</source> <source>Use custom icon set</source>
<translation>使</translation> <translation>使</translation>
</message> </message>
@ -2667,7 +2667,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="-202"/> <location line="-209"/>
<source>Font:</source> <source>Font:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
@ -2676,6 +2676,11 @@ p, li { white-space: pre-wrap; }
<source>Create a customized copy</source> <source>Create a customized copy</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location line="+7"/>
<source>Open custom themes folder</source>
<translation></translation>
</message>
<message> <message>
<location line="+78"/> <location line="+78"/>
<source>Language:</source> <source>Language:</source>
@ -2712,14 +2717,8 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+32"/>
<source>Confirm Overwrite</source> <source>Confirm Overwrite</source>
<translation></translation> <translation type="vanished"></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>
</context> </context>
<context> <context>

View File

@ -2130,7 +2130,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+179"/> <location line="+186"/>
<source>*Needs restart</source> <source>*Needs restart</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2150,7 +2150,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="-151"/> <location line="-158"/>
<source>Icon Set:</source> <source>Icon Set:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2159,6 +2159,11 @@
<source>Create a customized copy</source> <source>Create a customized copy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location line="+7"/>
<source>Open custom themes folder</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location line="+55"/> <location line="+55"/>
<source>Use custom icon set</source> <source>Use custom icon set</source>
@ -2184,16 +2189,6 @@
<source>Traditional Chinese</source> <source>Traditional Chinese</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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> <message>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="+71"/> <location filename="../settingsdialog/environmentappearancewidget.ui" line="+71"/>
<source>Icon Zoom:</source> <source>Icon Zoom:</source>

View File

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