diff --git a/app/core/skin_manager.cpp b/app/core/skin_manager.cpp index 62d21f7..3d300ea 100644 --- a/app/core/skin_manager.cpp +++ b/app/core/skin_manager.cpp @@ -14,6 +14,7 @@ struct SkinManager::Impl { QHash loaders; + QSet user_skins; void reload(); }; @@ -26,6 +27,7 @@ void SkinManager::Impl::reload() std::reverse(data_paths.begin(), data_paths.end()); for (const auto& p : std::as_const(data_paths)) { + bool is_user = p == QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); QDir d(p); if (!d.exists() || !d.cd("skins")) @@ -37,6 +39,9 @@ void SkinManager::Impl::reload() iter->addOverlay(d.absoluteFilePath(sd)); else loaders.emplace(sd, d.absoluteFilePath(sd)); + + if (is_user) + user_skins.insert(sd); } } @@ -81,6 +86,11 @@ SkinManager::Metadata SkinManager::metadata(const QString& id) const return {}; } +bool SkinManager::isUserSkin(const QString& id) const +{ + return _impl->user_skins.contains(id); +} + void SkinManager::setSkinBaseSize(int sz) { for (auto& l : _impl->loaders) diff --git a/app/core/skin_manager.hpp b/app/core/skin_manager.hpp index 4217732..02c2639 100644 --- a/app/core/skin_manager.hpp +++ b/app/core/skin_manager.hpp @@ -26,6 +26,8 @@ class SkinManager { using Metadata = QHash; Metadata metadata(const QString& id) const; + bool isUserSkin(const QString& id) const; + // skin base size (affects not all skins) void setSkinBaseSize(int sz); diff --git a/app/gui/settings_dialog.cpp b/app/gui/settings_dialog.cpp index b353c5d..3ef291a 100644 --- a/app/gui/settings_dialog.cpp +++ b/app/gui/settings_dialog.cpp @@ -811,6 +811,14 @@ void SettingsDialog::initAppearanceTab(int idx) for (const auto& [t, s] : std::as_const(sorted_skins)) ui->skin_cbox->addItem(t, s); + auto user_fnt = ui->skin_cbox->font(); + user_fnt.setItalic(true); + for (int i = 0; i < ui->skin_cbox->count(); i++) { + auto s = ui->skin_cbox->itemData(i).toString(); + if (app->skinManager().isUserSkin(s)) + ui->skin_cbox->setItemData(i, user_fnt, Qt::FontRole); + } + ui->skin_cbox->setCurrentIndex(-1); // if skin is available, next line will update the index ui->skin_cbox->setCurrentText(app->skinManager().metadata(acfg.getSkin())["name"]);