diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-03 02:18:04 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-03 02:18:04 +0100 |
commit | b3fbbd12c1c623e108103c5be20febbecc730777 (patch) | |
tree | addfd449f611daa3b58243f37dbe74ac0050a86e /src/plugins | |
parent | 45740fa881c495bc91ff05c14dab6d80000cddb5 (diff) |
Matrix: update body item filter when switching tab
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Manga.cpp | 4 | ||||
-rw-r--r-- | src/plugins/Matrix.cpp | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/Manga.cpp b/src/plugins/Manga.cpp index 4685cec..f3c6814 100644 --- a/src/plugins/Manga.cpp +++ b/src/plugins/Manga.cpp @@ -10,8 +10,8 @@ namespace QuickMedia { return TrackResult::ERR; } - void MangaChaptersPage::on_navigate_to_page(BodyItems &body_items) { - (void)body_items; + void MangaChaptersPage::on_navigate_to_page(Body *body) { + (void)body; std::string manga_id; if(extract_id_from_url(content_url, manga_id)) load_manga_content_storage(get_service_name(), content_title, manga_id); diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index fd05399..2e96cd0 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -442,7 +442,7 @@ namespace QuickMedia { pending_room_messages.clear(); } - MatrixRoomsPage::MatrixRoomsPage(Program *program, Body *body, std::string title, MatrixRoomTagsPage *room_tags_page) : Page(program), body(body), title(std::move(title)), room_tags_page(room_tags_page) { + MatrixRoomsPage::MatrixRoomsPage(Program *program, Body *body, std::string title, MatrixRoomTagsPage *room_tags_page, SearchBar *search_bar) : Page(program), body(body), title(std::move(title)), room_tags_page(room_tags_page), search_bar(search_bar) { if(room_tags_page) room_tags_page->set_current_rooms_page(this); } @@ -460,6 +460,11 @@ namespace QuickMedia { return PluginResult::OK; } + void MatrixRoomsPage::on_navigate_to_page(Body *body) { + if(search_bar) + body->filter_search_fuzzy(search_bar->get_text()); + } + void MatrixRoomsPage::update() { { std::lock_guard<std::mutex> lock(mutex); @@ -548,9 +553,10 @@ namespace QuickMedia { TagData &tag_data = tag_body_items_by_name[url]; body->items = tag_data.room_body_items; sort_room_body_items(body->items); - auto rooms_page = std::make_unique<MatrixRoomsPage>(program, body_ptr, tag_data.tag_item->get_title(), this); + auto search_bar = create_search_bar("Search...", SEARCH_DELAY_FILTER); + auto rooms_page = std::make_unique<MatrixRoomsPage>(program, body_ptr, tag_data.tag_item->get_title(), this, search_bar.get()); rooms_page->matrix_delegate = matrix_delegate; - result_tabs.push_back(Tab{std::move(body), std::move(rooms_page), create_search_bar("Search...", SEARCH_DELAY_FILTER)}); + result_tabs.push_back(Tab{std::move(body), std::move(rooms_page), std::move(search_bar)}); return PluginResult::OK; } |