mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 00:56:55 +02:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user