mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-08 03:57:33 +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:
@@ -1,21 +1,26 @@
|
||||
#include "common.h"
|
||||
#include "gui/IVramManager.h"
|
||||
#include "gui/GraphicsContext.h"
|
||||
#include "gui/input/InputProvider.h"
|
||||
#include "BannerListItemView.h"
|
||||
|
||||
BannerListItemView::BannerListItemView(std::unique_ptr<LabelView> firstLine,
|
||||
std::unique_ptr<LabelView> secondLine, std::unique_ptr<LabelView> thirdLine)
|
||||
: _firstLine(std::move(firstLine))
|
||||
BannerListItemView::BannerListItemView(std::unique_ptr<RomBrowserItemViewModel> viewModel,
|
||||
SharedPtr<LabelView> firstLine, SharedPtr<LabelView> secondLine, SharedPtr<LabelView> thirdLine)
|
||||
: _viewModel(std::move(viewModel))
|
||||
, _firstLine(std::move(firstLine))
|
||||
, _secondLine(std::move(secondLine))
|
||||
, _thirdLine(std::move(thirdLine))
|
||||
, _inputHandler(this, _viewModel.get())
|
||||
{
|
||||
AddChildTail(_firstLine.get());
|
||||
AddChildTail(_secondLine.get());
|
||||
AddChildTail(_thirdLine.get());
|
||||
AddChildTail(_firstLine.GetPointer());
|
||||
AddChildTail(_secondLine.GetPointer());
|
||||
AddChildTail(_thirdLine.GetPointer());
|
||||
}
|
||||
|
||||
void BannerListItemView::Update()
|
||||
{
|
||||
_viewModel->DisposeQueueTaskWhenComplete();
|
||||
|
||||
ViewContainer::Update();
|
||||
|
||||
if (_icon)
|
||||
@@ -23,3 +28,24 @@ void BannerListItemView::Update()
|
||||
_icon->Update();
|
||||
}
|
||||
}
|
||||
|
||||
bool BannerListItemView::HandleInput(const InputProvider& inputProvider, FocusManager& focusManager)
|
||||
{
|
||||
return _inputHandler.HandleInput(inputProvider, focusManager)
|
||||
|| View::HandleInput(inputProvider, focusManager);
|
||||
}
|
||||
|
||||
void BannerListItemView::HandlePenDown(const Point& touchPoint, FocusManager& focusManager)
|
||||
{
|
||||
_inputHandler.HandlePenDown(touchPoint, focusManager);
|
||||
}
|
||||
|
||||
void BannerListItemView::HandlePenMove(const Point& touchPoint, FocusManager& focusManager)
|
||||
{
|
||||
_inputHandler.HandlePenMove(touchPoint, focusManager);
|
||||
}
|
||||
|
||||
void BannerListItemView::HandlePenUp(const Point& lastTouchPoint, FocusManager& focusManager)
|
||||
{
|
||||
_inputHandler.HandlePenUp(lastTouchPoint, focusManager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user