diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-18 22:05:19 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-18 22:08:41 +0200 |
commit | d123c41cd3ad4f0d55ae134be69e7ffd144dbb74 (patch) | |
tree | f46a8e6daea5b757f4b66363c64aea6269dd83a9 /include/Body.hpp | |
parent | f6a39afa8bfd869ba661799897ac37e7d1ff7c34 (diff) |
Add mention autocomplete
Diffstat (limited to 'include/Body.hpp')
-rw-r--r-- | include/Body.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/Body.hpp b/include/Body.hpp index 84d0f14..9798992 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -232,7 +232,6 @@ namespace QuickMedia { // TODO: Highlight the part of the text that matches the search. void filter_search_fuzzy(const std::string &text); - void filter_search_fuzzy_item(const std::string &text, BodyItem *body_item); bool no_items_visible() const; @@ -246,6 +245,9 @@ namespace QuickMedia { bool is_body_full_with_items() const { return items_cut_off; } int get_num_visible_items() const { return num_visible_items; }; + // Call this once after adding new items + void items_set_dirty(); + sf::Text progress_text; sf::Text replies_text; sf::Text embedded_item_load_text; @@ -265,6 +267,7 @@ namespace QuickMedia { std::function<void()> on_top_reached = nullptr; std::function<void()> on_bottom_reached = nullptr; private: + void filter_search_fuzzy_item(const std::string &text, BodyItem *body_item); 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); void clear_body_item_cache(BodyItem *body_item); @@ -325,5 +328,8 @@ namespace QuickMedia { bool render_selected_item_bg = true; float item_background_target_pos_y = 0.0f; float item_background_target_height = 0.0f; + // TODO: Instead of using this, add functions for modifying |items| and apply the filter on those new items + bool items_dirty = false; + std::string current_filter; }; }
\ No newline at end of file |