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:
@@ -6,37 +6,13 @@
|
||||
class ViewContainer : public View
|
||||
{
|
||||
public:
|
||||
void InitVram(const VramContext& vramContext) override
|
||||
{
|
||||
for (auto& view : _children)
|
||||
{
|
||||
view.InitVram(vramContext);
|
||||
}
|
||||
}
|
||||
|
||||
void Update() override
|
||||
{
|
||||
for (auto& view : _children)
|
||||
{
|
||||
view.Update();
|
||||
}
|
||||
}
|
||||
|
||||
void Draw(GraphicsContext& graphicsContext) override
|
||||
{
|
||||
for (auto& view : _children)
|
||||
{
|
||||
view.Draw(graphicsContext);
|
||||
}
|
||||
}
|
||||
|
||||
void VBlank() override
|
||||
{
|
||||
for (auto& view : _children)
|
||||
{
|
||||
view.VBlank();
|
||||
}
|
||||
}
|
||||
void InitVram(const VramContext& vramContext) override;
|
||||
void Update() override;
|
||||
void Draw(GraphicsContext& graphicsContext) override;
|
||||
void VBlank() override;
|
||||
void HandlePenDown(const Point& touchPoint, FocusManager& focusManager) override;
|
||||
void HandlePenMove(const Point& touchPoint, FocusManager& focusManager) override;
|
||||
void HandlePenUp(const Point& lastTouchPoint, FocusManager& focusManager) override;
|
||||
|
||||
protected:
|
||||
/// @brief Adds a child to the head of the list.
|
||||
@@ -55,6 +31,14 @@ protected:
|
||||
view->SetParent(this);
|
||||
}
|
||||
|
||||
/// @brief Removes a child from the list.
|
||||
/// @param view The child to remove.
|
||||
void RemoveChild(View* view)
|
||||
{
|
||||
_children.Remove(view);
|
||||
view->SetParent(nullptr);
|
||||
}
|
||||
|
||||
private:
|
||||
LinkedList<View, &View::listLink> _children;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user