finish refactor, add docs and CI
CI / Build NRO (push) Failing after 3s
CI / Format check (push) Successful in 34s
CI / Layering check (push) Successful in 1s

This commit is contained in:
2026-04-27 01:49:41 +03:00
parent dc65a4c8a9
commit b4ab3e6463
47 changed files with 1964 additions and 1470 deletions
+48 -44
View File
@@ -1,59 +1,63 @@
#pragma once
#include <pu/Plutonium>
#include <nxst/ui/const.h>
#include <nxst/domain/title.hpp>
#include <nxst/domain/account.hpp>
#include <memory>
#include <unordered_map>
#include <vector>
#include <memory>
#include <pu/Plutonium>
#include <nxst/domain/account.hpp>
#include <nxst/domain/title.hpp>
#include <nxst/ui/const.h>
#include <nxst/ui/header_bar.hpp>
#include <nxst/ui/hint_bar.hpp>
namespace ui {
enum class TitlesFocus { List, Actions };
enum class TitlesAction { Transfer, Receive };
enum class TitlesFocus { List, Actions };
enum class TitlesAction { Transfer, Receive };
class TitlesLayout : public pu::ui::Layout {
private:
class TitlesLayout : public pu::ui::Layout {
private:
pu::ui::elm::Menu::Ref titlesMenu;
std::unordered_map<AccountUid, std::vector<pu::ui::elm::MenuItem::Ref>> menuCache;
bool m_inputLocked = false;
std::unique_ptr<HeaderBar> header;
std::unique_ptr<HintBar> hints;
pu::ui::elm::Menu::Ref titlesMenu;
std::unordered_map<AccountUid, std::vector<pu::ui::elm::MenuItem::Ref>> menuCache;
bool m_inputLocked = false;
std::unique_ptr<HeaderBar> header;
std::unique_ptr<HintBar> hints;
pu::ui::elm::Rectangle::Ref panelBg;
pu::ui::elm::TextBlock::Ref panelTitle;
pu::ui::elm::TextBlock::Ref panelHint;
pu::ui::elm::Rectangle::Ref btnTransferBg;
pu::ui::elm::TextBlock::Ref btnTransferText;
pu::ui::elm::Rectangle::Ref btnReceiveBg;
pu::ui::elm::TextBlock::Ref btnReceiveText;
pu::ui::elm::TextBlock::Ref panelFooter;
pu::ui::elm::TextBlock::Ref emptyText;
pu::ui::elm::TextBlock::Ref emptySub;
pu::ui::elm::Rectangle::Ref panelBg;
pu::ui::elm::TextBlock::Ref panelTitle;
pu::ui::elm::TextBlock::Ref panelHint;
pu::ui::elm::Rectangle::Ref btnTransferBg;
pu::ui::elm::TextBlock::Ref btnTransferText;
pu::ui::elm::Rectangle::Ref btnReceiveBg;
pu::ui::elm::TextBlock::Ref btnReceiveText;
pu::ui::elm::TextBlock::Ref panelFooter;
pu::ui::elm::TextBlock::Ref emptyText;
pu::ui::elm::TextBlock::Ref emptySub;
AccountUid current_uid{};
TitlesFocus focus = TitlesFocus::List;
TitlesAction action = TitlesAction::Transfer;
int lockedListIndex = 0;
AccountUid current_uid{};
TitlesFocus focus = TitlesFocus::List;
TitlesAction action = TitlesAction::Transfer;
int lockedListIndex = 0;
void refreshPanel();
void refreshButtons();
void updateHints();
void runTransfer(int index, Title& title);
void runReceive(int index, Title& title);
void refreshPanel();
void refreshButtons();
void updateHints();
void runTransfer(int index, Title& title);
void runReceive(int index, Title& title);
public:
TitlesLayout();
void InitTitles(AccountUid uid);
void LockInput() {
m_inputLocked = true;
}
void UnlockInput() {
m_inputLocked = false;
}
public:
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::TouchPoint Pos);
TitlesLayout();
void InitTitles(AccountUid uid);
void LockInput() { m_inputLocked = true; }
void UnlockInput() { m_inputLocked = false; }
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::TouchPoint Pos);
PU_SMART_CTOR(TitlesLayout)
};
}
PU_SMART_CTOR(TitlesLayout)
};
} // namespace ui