From b64f0a2d9e8748f11031f5627a60602b521daec6 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 29 Mar 2023 23:34:32 +0200 Subject: [PATCH] New themes are now flagged as such in GuiThemeDownloader --- es-app/src/guis/GuiThemeDownloader.cpp | 18 +++++++++++------- es-app/src/views/ViewController.h | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index 26121405d..b4624d775 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -113,9 +113,7 @@ GuiThemeDownloader::GuiThemeDownloader() mGrid.setEntry(mScrollDown, glm::ivec2 {7, 1}, false, false, glm::ivec2 {1, 1}); std::vector> buttons; - // buttons.push_back( - // std::make_shared("Update all", "Update all", [&] { delete this; })); - buttons.push_back(std::make_shared("Exit", "Exit", [&] { delete this; })); + buttons.push_back(std::make_shared("CLOSE", "CLOSE", [&] { delete this; })); mButtons = makeButtonGrid(buttons); mGrid.setEntry(mButtons, glm::ivec2 {0, 7}, true, false, glm::ivec2 {8, 1}, GridFlags::BORDER_TOP); @@ -376,7 +374,6 @@ void GuiThemeDownloader::makeInventory() { for (auto& theme : mThemeSets) { const std::string path {mThemeDirectory + theme.reponame}; - theme.newEntry = false; theme.invalidRepository = false; theme.manuallyDownloaded = false; theme.hasLocalChanges = false; @@ -530,7 +527,8 @@ void GuiThemeDownloader::parseThemesList() } } - LOG(LogInfo) << "GuiThemeDownloader: Parsed " << mThemeSets.size() << " theme sets"; + LOG(LogDebug) << "GuiThemeDownloader::parseThemesList(): Parsed " << mThemeSets.size() + << " theme sets"; } void GuiThemeDownloader::populateGUI() @@ -540,6 +538,8 @@ void GuiThemeDownloader::populateGUI() for (auto& theme : mThemeSets) { std::string themeName {Utils::String::toUpper(theme.name)}; + if (theme.newEntry && !theme.isCloned) + themeName.append(" ").append(ViewController::BRANCH_CHAR); if (theme.isCloned) themeName.append(" ").append(ViewController::TICKMARK_CHAR); if (theme.manuallyDownloaded || theme.invalidRepository) @@ -634,6 +634,8 @@ void GuiThemeDownloader::updateGUI() for (size_t i {0}; i < mThemeSets.size(); ++i) { std::string themeName {Utils::String::toUpper(mThemeSets[i].name)}; + if (mThemeSets[i].newEntry && !mThemeSets[i].isCloned) + themeName.append(" ").append(ViewController::BRANCH_CHAR); if (mThemeSets[i].isCloned) themeName.append(" ").append(ViewController::TICKMARK_CHAR); if (mThemeSets[i].manuallyDownloaded || mThemeSets[i].invalidRepository) @@ -662,10 +664,12 @@ void GuiThemeDownloader::updateInfoPane() mDownloadStatus->setColor(0x992222FF); } else { - mDownloadStatus->setText("NOT INSTALLED"); + if (mThemeSets[mList->getCursorId()].newEntry) + mDownloadStatus->setText("NOT INSTALLED (NEW)"); + else + mDownloadStatus->setText("NOT INSTALLED"); mDownloadStatus->setColor(0x999999FF); } - if (mThemeSets[mList->getCursorId()].hasLocalChanges) { mLocalChanges->setText(ViewController::EXCLAMATION_CHAR + " LOCAL CHANGES"); mLocalChanges->setColor(0x992222FF); diff --git a/es-app/src/views/ViewController.h b/es-app/src/views/ViewController.h index 65fa0244a..974017acb 100644 --- a/es-app/src/views/ViewController.h +++ b/es-app/src/views/ViewController.h @@ -134,6 +134,7 @@ public: // Font Awesome symbols. #if defined(_MSC_VER) // MSVC compiler. + static inline const std::string BRANCH_CHAR {Utils::String::wideStringToString(L"\uf18c")}; static inline const std::string CONTROLLER_CHAR {Utils::String::wideStringToString(L"\uf11b")}; static inline const std::string CROSSEDCIRCLE_CHAR { Utils::String::wideStringToString(L"\uf05e")}; @@ -146,6 +147,7 @@ public: static inline const std::string KEYBOARD_CHAR {Utils::String::wideStringToString(L"\uf11c")}; static inline const std::string TICKMARK_CHAR {Utils::String::wideStringToString(L"\uf14A")}; #else + static inline const std::string BRANCH_CHAR {"\uf18c"}; static inline const std::string CONTROLLER_CHAR {"\uf11b"}; static inline const std::string CROSSEDCIRCLE_CHAR {"\uf05e"}; static inline const std::string EXCLAMATION_CHAR {"\uf06a"};