Improve theme editor usability so themes can be set from it

This commit is contained in:
luisangelsm
2026-03-06 15:06:20 +01:00
parent 86b5003f07
commit 0ceba0ea74
3 changed files with 35 additions and 3 deletions

View File

@ -189,6 +189,22 @@ AppearanceTabWidget::AppearanceTabWidget(
themeEditor->setAttribute(Qt::WA_DeleteOnClose);
connect(themeEditor, &ThemeEditorDialog::themeJsonChanged, this,
[this](const QJsonObject &json) { this->applyTheme(json); });
connect(themeEditor, &ThemeEditorDialog::saveToLibraryRequested, this,
[this](const QJsonObject &json) {
if (!this->repository)
return;
const QString id = this->repository->saveUserTheme(json);
this->repopulateCombos();
const bool isLight = (json["meta"].toObject()["variant"].toString() == "light");
if (isLight)
selectInCombo(this->lightCombo, id);
else
selectInCombo(this->darkCombo, id);
if (this->config && this->config->selection().mode == ThemeMode::ForcedTheme)
selectInCombo(this->customCombo, id);
if (this->themeEditor)
this->themeEditor->updateSavedId(id);
});
}
themeEditor->show();
themeEditor->raise();