Add touch input support, add fast scrolling support for coverflow display mode, fix use after free bug in banner list mode

This commit is contained in:
Gericom
2026-04-04 19:24:39 +02:00
parent 21a8790ebc
commit 97762b14d3
119 changed files with 2251 additions and 762 deletions

View File

@@ -52,18 +52,18 @@ DisplaySettingsBottomSheetView::DisplaySettingsBottomSheetView(
DisplaySettingsViewModel* viewModel, const MaterialColorScheme* materialColorScheme,
const IFontRepository* fontRepository)
: _viewModel(viewModel)
, _titleLabel(128, 16, 25, fontRepository->GetFont(FontType::Medium11))
, _layoutLabel(64, 16, 25, fontRepository->GetFont(FontType::Regular10))
, _sortingLabel(64, 16, 25, fontRepository->GetFont(FontType::Regular10))
, _titleLabel(Label2DView::CreateShared(128, 16, 25, fontRepository->GetFont(FontType::Medium11)))
, _layoutLabel(Label2DView::CreateShared(64, 16, 25, fontRepository->GetFont(FontType::Regular10)))
, _sortingLabel(Label2DView::CreateShared(64, 16, 25, fontRepository->GetFont(FontType::Regular10)))
, _materialColorScheme(materialColorScheme)
// , _filtersLabel(64, 16, 25, fontRepository->GetFont(FontType::Regular10))
{
_titleLabel.SetText(u"Display Settings");
AddChildTail(&_titleLabel);
_layoutLabel.SetText(u"Layout");
AddChildTail(&_layoutLabel);
_sortingLabel.SetText(u"Sorting");
AddChildTail(&_sortingLabel);
_titleLabel->SetText(u"Display Settings");
AddChildTail(_titleLabel.GetPointer());
_layoutLabel->SetText(u"Layout");
AddChildTail(_layoutLabel.GetPointer());
_sortingLabel->SetText(u"Sorting");
AddChildTail(_sortingLabel.GetPointer());
// _filtersLabel.SetText(u"Filters");
// AddChildTail(&_filtersLabel);
@@ -90,7 +90,7 @@ DisplaySettingsBottomSheetView::DisplaySettingsBottomSheetView(
SharedPtr<IconButton2DView> DisplaySettingsBottomSheetView::CreateLayoutOptionIconButton()
{
auto layoutOption = SharedPtr<IconButton2DView>::MakeShared(
auto layoutOption = IconButton2DView::CreateShared(
IconButtonView::Type::Tonal,
IconButtonView::State::ToggleUnselected,
md::sys::color::surfaceContainerLow,
@@ -113,7 +113,7 @@ SharedPtr<IconButton2DView> DisplaySettingsBottomSheetView::CreateLayoutOptionIc
SharedPtr<IconButton2DView> DisplaySettingsBottomSheetView::CreateSortOptionIconButton()
{
auto sortOption = SharedPtr<IconButton2DView>::MakeShared(
auto sortOption = IconButton2DView::CreateShared(
IconButtonView::Type::Tonal,
IconButtonView::State::ToggleUnselected,
md::sys::color::surfaceContainerLow,
@@ -175,9 +175,9 @@ void DisplaySettingsBottomSheetView::InitVram(const VramContext& vramContext)
void DisplaySettingsBottomSheetView::UpdateLabels()
{
_titleLabel.SetPosition(TITLE_LABEL_X, _position.y + TITLE_LABEL_Y);
_layoutLabel.SetPosition(LAYOUT_LABEL_X, _position.y + LAYOUT_LABEL_Y);
_sortingLabel.SetPosition(SORTING_LABEL_X, _position.y + SORTING_LABEL_Y);
_titleLabel->SetPosition(TITLE_LABEL_X, _position.y + TITLE_LABEL_Y);
_layoutLabel->SetPosition(LAYOUT_LABEL_X, _position.y + LAYOUT_LABEL_Y);
_sortingLabel->SetPosition(SORTING_LABEL_X, _position.y + SORTING_LABEL_Y);
// _filtersLabel.SetPosition(FILTERS_LABEL_X, _position.y + FILTERS_LABEL_Y);
}
@@ -222,12 +222,12 @@ void DisplaySettingsBottomSheetView::Draw(GraphicsContext& graphicsContext)
graphicsContext.SetClipArea(GetBounds());
u32 oldPrio = graphicsContext.SetPriority(1);
{
_titleLabel.SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
_titleLabel.SetForegroundColor(_materialColorScheme->onSurface);
_layoutLabel.SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
_layoutLabel.SetForegroundColor(_materialColorScheme->onSurfaceVariant);
_sortingLabel.SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
_sortingLabel.SetForegroundColor(_materialColorScheme->onSurfaceVariant);
_titleLabel->SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
_titleLabel->SetForegroundColor(_materialColorScheme->onSurface);
_layoutLabel->SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
_layoutLabel->SetForegroundColor(_materialColorScheme->onSurfaceVariant);
_sortingLabel->SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
_sortingLabel->SetForegroundColor(_materialColorScheme->onSurfaceVariant);
// _filtersLabel.SetBackgroundColor(_materialColorScheme->GetColor(md::sys::color::surfaceContainerLow));
// _filtersLabel.SetForegroundColor(_materialColorScheme->onSurfaceVariant);
BottomSheetView::Draw(graphicsContext);
@@ -364,6 +364,11 @@ void DisplaySettingsBottomSheetView::SetGraphics(
// filterOption.SetGraphics(iconButtonVramToken);
}
void DisplaySettingsBottomSheetView::Close()
{
_viewModel->Close();
}
u32 DisplaySettingsBottomSheetView::LoadIcon(IVramManager& vramManager,
const unsigned int* tiles, u32 tilesLength) const
{