diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index 35bc406f5..b1008dd08 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // GuiThemeDownloader.cpp // // Theme downloader. @@ -663,6 +663,9 @@ void GuiThemeDownloader::parseThemesList() if (theme.HasMember("newEntry") && theme["newEntry"].IsBool()) themeEntry.newEntry = theme["newEntry"].GetBool(); + if (theme.HasMember("deprecated") && theme["deprecated"].IsBool()) + themeEntry.deprecated = theme["deprecated"].GetBool(); + if (theme.HasMember("variants") && theme["variants"].IsArray()) { const rapidjson::Value& variants {theme["variants"]}; for (int i {0}; i < static_cast(variants.Size()); ++i) @@ -746,6 +749,11 @@ void GuiThemeDownloader::populateGUI() std::shared_ptr themeNameElement {std::make_shared( themeName, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; + if (theme.deprecated) + themeNameElement->setOpacity(0.4f); + else + themeNameElement->setOpacity(1.0f); + ThemeGUIEntry guiEntry; guiEntry.themeName = themeNameElement; mThemeGUIEntries.emplace_back(guiEntry); @@ -907,11 +915,21 @@ void GuiThemeDownloader::updateGUI() void GuiThemeDownloader::updateInfoPane() { assert(static_cast(mList->size()) == mThemes.size()); - if (!mThemes[mList->getCursorId()].screenshots.empty()) + if (!mThemes[mList->getCursorId()].screenshots.empty()) { mScreenshot->setImage(mThemeDirectory + "themes-list/" + mThemes[mList->getCursorId()].screenshots.front().image); - else + if (mThemes[mList->getCursorId()].deprecated) { + mScreenshot->setSaturation(0.0f); + mScreenshot->setBrightness(-0.2f); + } + else { + mScreenshot->setSaturation(1.0f); + mScreenshot->setBrightness(0.0f); + } + } + else { mScreenshot->setImage(""); + } if (mThemes[mList->getCursorId()].isCloned) { mDownloadStatus->setText(ViewController::TICKMARK_CHAR + " INSTALLED"); @@ -954,7 +972,11 @@ void GuiThemeDownloader::updateInfoPane() mColorSchemesCount->setText(std::to_string(mThemes[mList->getCursorId()].colorSchemes.size())); mAspectRatiosCount->setText(std::to_string(mThemes[mList->getCursorId()].aspectRatios.size())); mFontSizesCount->setText(std::to_string(mThemes[mList->getCursorId()].fontSizes.size())); - mAuthor->setText("CREATED BY " + Utils::String::toUpper(mThemes[mList->getCursorId()].author)); + if (mThemes[mList->getCursorId()].deprecated) + mAuthor->setText("THIS THEME ENTRY WILL BE REMOVED IN THE NEAR FUTURE"); + else + mAuthor->setText("CREATED BY " + + Utils::String::toUpper(mThemes[mList->getCursorId()].author)); } void GuiThemeDownloader::setupFullscreenViewer() diff --git a/es-app/src/guis/GuiThemeDownloader.h b/es-app/src/guis/GuiThemeDownloader.h index 2a807756e..f56a2fe68 100644 --- a/es-app/src/guis/GuiThemeDownloader.h +++ b/es-app/src/guis/GuiThemeDownloader.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // GuiThemeDownloader.h // // Theme downloader. @@ -68,6 +68,7 @@ private: std::vector transitions; std::vector screenshots; bool newEntry; + bool deprecated; bool invalidRepository; bool corruptRepository; bool shallowRepository; @@ -76,6 +77,7 @@ private: bool isCloned; ThemeEntry() : newEntry {false} + , deprecated {false} , invalidRepository {false} , corruptRepository {false} , shallowRepository {false}