From e54fbb97d42315f9880fe2aaedbcb5e074456bdd Mon Sep 17 00:00:00 2001 From: mrdude2478 Date: Sun, 24 Sep 2023 05:52:02 +0100 Subject: [PATCH] added percentage info to theme download --- source/ui/ThemeInstPage.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/ui/ThemeInstPage.cpp b/source/ui/ThemeInstPage.cpp index cd1ddd6..bd0f82b 100644 --- a/source/ui/ThemeInstPage.cpp +++ b/source/ui/ThemeInstPage.cpp @@ -12,6 +12,7 @@ #include "ui/instPage.hpp" #include #include +#include #define COLOR(hex) pu::ui::Color::FromHex(hex) @@ -125,6 +126,19 @@ namespace inst::ui { void ThemeInstPage::setInstBarPerc(double ourPercent) { mainApp->ThemeinstPage->installBar->SetVisible(true); mainApp->ThemeinstPage->installBar->SetProgress(ourPercent); + // + if (installing == 1){ + std::stringstream x; + x << ourPercent; + inst::ui::mainApp->ThemeinstPage->pageInfoText->SetText("Downloading theme: " + x.str() + " % complete"); + if (x.str() == "100"){ + inst::ui::mainApp->ThemeinstPage->pageInfoText->SetText("Extracting theme - please wait!"); + } + } + else{ + inst::ui::mainApp->ThemeinstPage->pageInfoText->SetText("inst.net.theme_top_info"_lang); + } + // mainApp->CallForRender(); } @@ -160,7 +174,6 @@ namespace inst::ui { void ThemeInstPage::selectTitle(int selectedIndex) { if (installing != 1) { for (long unsigned int i = 0; i < this->selectedUrls.size(); i++) { - inst::ui::mainApp->ThemeinstPage->pageInfoText->SetText("Downloading theme, Please wait!"); inst::ui::mainApp->ThemeinstPage->setInstBarPerc(0); ourPath = inst::config::appDir + "/temp_download.zip"; installing = 1;