From f6a07804546cb0ee0e1a243929dbe7ec25214c9e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 9 May 2021 15:59:09 +0200 Subject: Redesign login, refactor keyboard movement --- include/Body.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/Body.hpp') diff --git a/include/Body.hpp b/include/Body.hpp index 39ad19d..b50b695 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -218,7 +218,7 @@ namespace QuickMedia { void clamp_selection(); // Returns true if the event was handled - bool on_event(const sf::RenderWindow &window, const sf::Event &event); + bool on_event(const sf::RenderWindow &window, const sf::Event &event, bool keyboard_navigation = true); void draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size); void draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, const Json::Value &content_progress); // |size| is the clip size, another outside this will be cut off. @@ -262,6 +262,9 @@ namespace QuickMedia { sf::Shader *thumbnail_mask_shader; AttachSide attach_side = AttachSide::TOP; bool title_mark_urls = false; + + std::function on_top_reached = nullptr; + std::function on_bottom_reached = nullptr; private: void draw_item(sf::RenderWindow &window, BodyItem *item, const sf::Vector2f &pos, const sf::Vector2f &size, const float item_height, const int item_index, const Json::Value &content_progress, bool include_embedded_item = true, bool merge_with_previous = false); void update_dirty_state(BodyItem *body_item, float width); -- cgit v1.2.3