Files
sphaira/sphaira/include/ui/menus/file_viewer.hpp
ITotalJustice 78bda75985 add touch support (#77)
* initial work on touch support

* add touch support to all objects

* add touch scrolling, fix scrollbar, fix appstore search

- when fireing an action, the action array may change. so the loop should break early as soon as an action is handled.
  this fixes the appstore search when pressing B.
- scrollbar no longer goes oob. fixes #76

currently, scrolling has no acceleration.
2025-01-06 22:37:38 +00:00

31 lines
674 B
C++

#pragma once
#include "ui/menus/menu_base.hpp"
#include "ui/scrollable_text.hpp"
#include "fs.hpp"
namespace sphaira::ui::menu::fileview {
struct Menu final : MenuBase {
Menu(const fs::FsPath& path);
~Menu();
void Update(Controller* controller, TouchInfo* touch) override;
void Draw(NVGcontext* vg, Theme* theme) override;
void OnFocusGained() override;
private:
const fs::FsPath m_path;
fs::FsNativeSd m_fs;
FsFile m_file;
s64 m_file_size{};
s64 m_file_offset{};
std::unique_ptr<ScrollableText> m_scroll_text;
s64 m_start{};
s64 m_index{}; // where i am in the array
};
} // namespace sphaira::ui::menu::fileview