aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 2e267c5..4f2e816 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -484,6 +484,11 @@ 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;
+ filter_search_fuzzy(current_filter);
+ }
+
sf::Vector2f scissor_pos = pos;
sf::Vector2f scissor_size = size;
const float start_y = pos.y;
@@ -1486,10 +1491,14 @@ namespace QuickMedia {
}
void Body::filter_search_fuzzy(const std::string &text) {
+ current_filter = text;
+
if(text.empty()) {
for(auto &item : items) {
item->visible = true;
}
+
+ select_first_item();
return;
}
@@ -1531,4 +1540,8 @@ namespace QuickMedia {
page_scroll = scroll;
clamp_selected_item_to_body_count = 1;
}
+
+ void Body::items_set_dirty() {
+ items_dirty = true;
+ }
}