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 --- src/Body.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Body.cpp') diff --git a/src/Body.cpp b/src/Body.cpp index d51ea29..72974fa 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -487,10 +487,10 @@ namespace QuickMedia { // TODO: Use a render target for the whole body so all images can be put into one. // TODO: Load thumbnails with more than one thread. void Body::draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, const Json::Value &content_progress) { - if(items_dirty) { - items_dirty = false; - if(using_filter) + if(items_dirty != DirtyState::FALSE) { + if(using_filter || items_dirty == DirtyState::FORCE_TRUE) filter_search_fuzzy(current_filter, false); + items_dirty = DirtyState::FALSE; } sf::Vector2f scissor_pos = pos; @@ -1547,7 +1547,11 @@ namespace QuickMedia { clamp_selected_item_to_body_count = 1; } - void Body::items_set_dirty() { - items_dirty = true; + void Body::items_set_dirty(bool force) { + items_dirty = force ? DirtyState::FORCE_TRUE : DirtyState::TRUE; + } + + void Body::apply_search_filter_for_item(BodyItem *body_item) { + filter_search_fuzzy_item(current_filter, body_item); } } -- cgit v1.2.3