diff options
Diffstat (limited to 'lib/nes/app/ui/screen-browser.hh')
| -rw-r--r-- | lib/nes/app/ui/screen-browser.hh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/nes/app/ui/screen-browser.hh b/lib/nes/app/ui/screen-browser.hh index 7a711c5..3870f02 100644 --- a/lib/nes/app/ui/screen-browser.hh +++ b/lib/nes/app/ui/screen-browser.hh @@ -11,13 +11,15 @@ namespace nes::app /// An interface which allows the user to browse the filesystem for a game. class screen_browser final : public screen { + static constexpr auto page_size = u32{ 8 }; + struct item { bool is_parent{ false }; file_browser::item data{ file_browser::item_type::directory, "" }; }; - class selection_impl final : public selection<item, 8> + class selection_impl final : public selection<item, page_size> { file_browser& file_browser_; @@ -30,17 +32,21 @@ namespace nes::app protected: auto render_item(renderer&, item const&, i32 x, i32 y, u32 width, color) const -> void override; - auto load_page(item(&)[8], u32 page) -> u32 override; + auto load_page(item(&)[page_size], u32 page) -> u32 override; }; input_device_keyboard& keyboard_; file_browser& file_browser_; selection_impl selection_; + u32 navigation_steps_{ 0 }; public: explicit screen_browser(input_device_keyboard&, file_browser&); auto render(renderer&) -> void override; auto process_events() -> action override; + + private: + auto refresh() -> void; }; } // namespace nes::app
\ No newline at end of file |
