arch codereview

This commit is contained in:
2026-04-25 09:55:34 +03:00
parent 3e19149cb4
commit 7515e0334b
12 changed files with 579 additions and 487 deletions
+51
View File
@@ -0,0 +1,51 @@
#pragma once
#include <pu/Plutonium>
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);
}
};
}