summaryrefslogtreecommitdiff
path: root/lib/nes/app/ui/screen-browser.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-04 19:25:03 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-04 19:25:03 +0100
commite791ac9a46095e0241181da89c35a7c702982c21 (patch)
treed959c79c24ae03282f1b00ec9bcb2ccf86d9c96c /lib/nes/app/ui/screen-browser.hh
parent0f22ed2ef160eef2da6080782943b22c9539650d (diff)
clean up path logic a bit
Diffstat (limited to 'lib/nes/app/ui/screen-browser.hh')
-rw-r--r--lib/nes/app/ui/screen-browser.hh10
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