You've already forked pico-launcher
mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-01-09 16:28:48 -08:00
76 lines
2.3 KiB
C++
76 lines
2.3 KiB
C++
#pragma once
|
|
#include "core/task/TaskQueue.h"
|
|
#include "gui/views/Label2DView.h"
|
|
#include "../../views/BannerView.h"
|
|
|
|
class FileIcon;
|
|
class MaterialColorScheme;
|
|
class IFontRepository;
|
|
|
|
class MaterialFileInfoCardView : public BannerView
|
|
{
|
|
public:
|
|
MaterialFileInfoCardView(const MaterialColorScheme* materialColorScheme,
|
|
const IFontRepository* fontRepository);
|
|
|
|
void InitVram(const VramContext& vramContext) override;
|
|
void Update() override;
|
|
void Draw(GraphicsContext& graphicsContext) override;
|
|
|
|
void SetFirstLineAsync(TaskQueueBase* taskQueue, const char* firstLine, bool ellipsis) override
|
|
{
|
|
_firstLine.SetEllipsis(ellipsis);
|
|
if (taskQueue)
|
|
_firstLine.SetTextAsync(taskQueue, firstLine);
|
|
else
|
|
_firstLine.SetText(firstLine);
|
|
}
|
|
|
|
void SetFirstLineAsync(TaskQueueBase* taskQueue, const char16_t* firstLine, u32 length, bool ellipsis) override
|
|
{
|
|
_firstLine.SetEllipsis(ellipsis);
|
|
if (taskQueue)
|
|
_firstLine.SetTextAsync(taskQueue, firstLine, length);
|
|
else
|
|
_firstLine.SetText(firstLine, length);
|
|
}
|
|
|
|
void SetSecondLineAsync(TaskQueueBase* taskQueue, const char16_t* secondLine, u32 length) override
|
|
{
|
|
if (taskQueue)
|
|
_secondLine.SetTextAsync(taskQueue, secondLine, length);
|
|
else
|
|
_secondLine.SetText(secondLine, length);
|
|
}
|
|
|
|
void SetThirdLineAsync(TaskQueueBase* taskQueue, const char16_t* thirdLine, u32 length) override
|
|
{
|
|
if (taskQueue)
|
|
_thirdLine.SetTextAsync(taskQueue, thirdLine, length);
|
|
else
|
|
_thirdLine.SetText(thirdLine, length);
|
|
}
|
|
|
|
void SetFileNameAsync(TaskQueueBase* taskQueue, const TCHAR* fileName, bool useAsTitle) override
|
|
{
|
|
BannerView::SetFileNameAsync(taskQueue, fileName, useAsTitle);
|
|
if (taskQueue)
|
|
_filenameLabelView.SetTextAsync(taskQueue, fileName);
|
|
else
|
|
_filenameLabelView.SetText(fileName);
|
|
}
|
|
|
|
Rectangle GetBounds() const override
|
|
{
|
|
return Rectangle(_position, 236, 60);
|
|
}
|
|
|
|
private:
|
|
Label2DView _firstLine;
|
|
Label2DView _secondLine;
|
|
Label2DView _thirdLine;
|
|
Label2DView _filenameLabelView;
|
|
u32 _iconCellVramOffset;
|
|
const MaterialColorScheme* _materialColorScheme;
|
|
};
|