From 888fba907eba13ee6a30bf7169d4d96af5b443a5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Sep 2020 11:02:06 +0200 Subject: Implement pgup/pgdown/home/end keys --- include/Body.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/Body.hpp') diff --git a/include/Body.hpp b/include/Body.hpp index 9f7c2d8..4887582 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -85,6 +85,11 @@ namespace QuickMedia { Body(Program *program, sf::Font *font, sf::Font *bold_font, sf::Font *cjk_font); ~Body(); + // Select previous page, ignoring invisible items. Returns true if the item was changed. This can be used to check if the top was hit when wrap_around is set to false + bool select_previous_page(); + // Select next page, ignoring invisible items. Returns true if the item was changed. This can be used to check if the bottom was hit when wrap_around is set to false + bool select_next_page(); + // Select previous item, ignoring invisible items. Returns true if the item was changed. This can be used to check if the top was hit when wrap_around is set to false bool select_previous_item(); @@ -93,6 +98,7 @@ namespace QuickMedia { void set_selected_item(int item); void select_first_item(); + void select_last_item(); void reset_selected(); void clear_items(); void prepend_items(BodyItems new_items); @@ -161,5 +167,6 @@ namespace QuickMedia { sf::RoundedRectangleShape item_background; sf::Sprite image; std::future load_thumbnail_future; + int num_visible_items; }; } \ No newline at end of file -- cgit v1.2.3