#pragma once #include namespace ui { class TransferOverlay : public pu::ui::Overlay { private: pu::ui::elm::TextBlock::Ref titleText; pu::ui::elm::TextBlock::Ref statusText; pu::ui::elm::ProgressBar::Ref progressBar; pu::ui::elm::TextBlock::Ref hintText; public: static constexpr int OvlX = 200; static constexpr int OvlY = 240; static constexpr int OvlW = 880; static constexpr int OvlH = 240; TransferOverlay(const std::string &title) : Overlay(OvlX, OvlY, OvlW, OvlH, pu::ui::Color(30, 30, 30, 220)) { titleText = pu::ui::elm::TextBlock::New(OvlX + 40, OvlY + 30, title); titleText->SetColor(pu::ui::Color(255, 255, 255, 255)); statusText = pu::ui::elm::TextBlock::New(OvlX + 40, OvlY + 90, ""); statusText->SetColor(pu::ui::Color(180, 180, 180, 255)); progressBar = pu::ui::elm::ProgressBar::New(OvlX + 40, OvlY + 140, OvlW - 80, 20, 100.0); progressBar->SetProgressColor(pu::ui::Color(100, 180, 255, 255)); progressBar->SetBackgroundColor(pu::ui::Color(70, 70, 70, 255)); hintText = pu::ui::elm::TextBlock::New(OvlX + 40, OvlY + 195, "Press B to cancel"); hintText->SetColor(pu::ui::Color(130, 130, 130, 255)); this->Add(titleText); this->Add(statusText); this->Add(progressBar); this->Add(hintText); } PU_SMART_CTOR(TransferOverlay) void SetStatus(const std::string &status) { statusText->SetText(status); } void SetProgress(double val) { progressBar->SetProgress(val); } }; }