From 3609429b3d8fccd99994dde015b6516376e6835b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 20 May 2021 05:20:49 +0200 Subject: Move chat page room list logic to matrix delegate --- include/Body.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/Body.hpp b/include/Body.hpp index 8e571f1..0b0fca4 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -246,7 +246,9 @@ namespace QuickMedia { int get_num_visible_items() const { return num_visible_items; }; // Call this once after adding new items - void items_set_dirty(); + void items_set_dirty(bool force = false); + + void apply_search_filter_for_item(BodyItem *body_item); sf::Text progress_text; sf::Text replies_text; @@ -279,6 +281,12 @@ namespace QuickMedia { float get_offset_to_first_visible_item(sf::Vector2f body_size); float get_offset_to_last_visible_item(sf::Vector2f body_size); private: + enum class DirtyState { + FALSE, + TRUE, + FORCE_TRUE + }; + Program *program; int selected_item; int prev_selected_item; @@ -329,7 +337,7 @@ namespace QuickMedia { 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; + DirtyState items_dirty = DirtyState::FALSE; std::string current_filter; bool using_filter = false; }; -- cgit v1.2.3