diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-09-14 23:38:02 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-09-14 23:38:02 +0200 |
commit | 39609fe195fa0499239b7041866355a4e467f21a (patch) | |
tree | 80631db8fded86b12d13f35d1fcf525e846686c5 /src | |
parent | 503071f0f4bb943e6339e213aae69b4b8d3ddd59 (diff) |
Reset filter when switching tab
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 7027ac9..287c911 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -939,16 +939,24 @@ namespace QuickMedia { redraw = true; else if(event.type == sf::Event::KeyPressed) { if(event.key.code == sf::Keyboard::Up) { - if(tabs[selected_tab].body ) tabs[selected_tab].body->select_previous_item(); + if(tabs[selected_tab].body) tabs[selected_tab].body->select_previous_item(); } else if(event.key.code == sf::Keyboard::Down) { if(tabs[selected_tab].body) tabs[selected_tab].body->select_next_item(); } else if(event.key.code == sf::Keyboard::Escape) { current_page = Page::EXIT; exit_code = 1; } else if(event.key.code == sf::Keyboard::Left) { + if(tabs[selected_tab].body) { + tabs[selected_tab].body->filter_search_fuzzy(""); + tabs[selected_tab].body->clamp_selection(); + } selected_tab = std::max(0, selected_tab - 1); search_bar->clear(); } else if(event.key.code == sf::Keyboard::Right) { + if(tabs[selected_tab].body) { + tabs[selected_tab].body->filter_search_fuzzy(""); + tabs[selected_tab].body->clamp_selection(); + } selected_tab = std::min((int)tabs.size() - 1, selected_tab + 1); search_bar->clear(); } else if(event.key.code == sf::Keyboard::Tab) { |