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

@@ -15,7 +15,7 @@ public:
/// @brief Requests to show the given dialog.
/// @param dialog The dialog to show.
void ShowDialog(std::unique_ptr<DialogView> dialog);
void ShowDialog(SharedPtr<DialogView> dialog);
/// @brief Closes the current dialog.
void CloseDialog();
@@ -42,6 +42,21 @@ public:
/// @brief Initializes vram that is needed for showing dialogs.
void InitVram();
/// @brief Handles a pen down event.
/// @param touchPoint The touch point.
/// @param focusManager The focus manager.
void HandlePenDown(const Point& touchPoint, FocusManager& focusManager);
/// @brief Handles a pen move event.
/// @param touchPoint The touch point.
/// @param focusManager The focus manager.
void HandlePenMove(const Point& touchPoint, FocusManager& focusManager);
/// @brief Handles a pen up event.
/// @param lastTouchPoint The last touch point.
/// @param focusManager The focus manager.
void HandlePenUp(const Point& lastTouchPoint, FocusManager& focusManager);
/// @brief Clears the focus that was stored when a dialog was opened.
void ClearOldFocus()
{
@@ -55,6 +70,11 @@ public:
return _oldFocus;
}
bool IsBottomSheetVisible() const
{
return _curState != State::Idle;
}
private:
enum class State
{
@@ -66,8 +86,8 @@ private:
FocusManager* _focusManager;
StackVramManager* _vramManager;
u32 _baseVramState;
std::unique_ptr<DialogView> _currentDialog;
std::unique_ptr<DialogView> _nextDialog;
SharedPtr<DialogView> _currentDialog;
SharedPtr<DialogView> _nextDialog;
bool _initVram = false;
SharedPtr<View> _oldFocus = nullptr;
Animator<int> _scrimAnimator;