58 lines
1.7 KiB
C++
58 lines
1.7 KiB
C++
#include <pu/Plutonium>
|
|
#include <const.h>
|
|
#include <title.hpp>
|
|
#include <account.hpp>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
#include <memory>
|
|
#include <ui/HeaderBar.hpp>
|
|
#include <ui/HintBar.hpp>
|
|
|
|
namespace ui {
|
|
|
|
enum class TitlesFocus { List, Actions };
|
|
enum class TitlesAction { Transfer, Receive };
|
|
|
|
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::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;
|
|
|
|
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);
|
|
|
|
public:
|
|
|
|
TitlesLayout();
|
|
void InitTitles();
|
|
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)
|
|
};
|
|
}
|