aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-24 03:33:13 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-24 03:33:13 +0200
commitf0f6d45cd3aa39f1eea4e8fd1518edeee50689ef (patch)
tree3a9e0d978cfe4851d884efdb069df9cb8d636f7e /include
parentfdeb82815db468ac7e99e9646f57bed2bf1832de (diff)
Add scrollbar
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index 4126697..d4eb49f 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -103,8 +103,10 @@ namespace QuickMedia {
// Returns true if the event was handled
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);
+ // Returns the the body total height
+ double draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size);
+ // Returns the the body total height
+ double 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.
// Note: this should be called after |draw|, or thumbnails will be messed up. TODO: find a way to solve this issue in a clean way.
// This happens because of |draw| sets thumbnails as unreferenced at the beginning and cleans them up at the end if they are not drawn in the same function call.
@@ -152,9 +154,10 @@ namespace QuickMedia {
void draw_drop_shadow(sf::RenderWindow &window);
void filter_search_fuzzy_item(const std::string &text, BodyItem *body_item);
void handle_item_render(const sf::Vector2f pos, const float item_width, const float item_height, int item_index);
- // Returns the the body total drawn height
- float draw_list_view(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, const Json::Value &content_progress);
- void draw_card_view(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, sf::Vector2u window_size, float scissor_y);
+ // Returns the the body total height
+ double draw_list_view(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, const Json::Value &content_progress);
+ // Returns the the body total height
+ double draw_card_view(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, sf::Vector2u window_size, float scissor_y);
void draw_item(sf::RenderWindow &window, std::shared_ptr<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 draw_card_item(sf::RenderWindow &window, std::shared_ptr<BodyItem> &item, const sf::Vector2f &pos, const sf::Vector2f &pos_offset, const sf::Vector2f &body_size, const sf::Vector2f &window_size, float item_height, float scissor_y, int item_index, ThumbnailData *item_thumbnail);
void update_dirty_state(BodyItem *body_item, float width);
@@ -264,6 +267,7 @@ namespace QuickMedia {
TargetSetState target_set = TargetSetState::NOT_SET;
std::string current_filter;
bool using_filter = false;
+ sf::Shader *rounded_rectangle_shader;
sf::Shader *rounded_rectangle_mask_shader;
};
} \ No newline at end of file