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 /plugins | |
parent | 45740fa881c495bc91ff05c14dab6d80000cddb5 (diff) |
Matrix: update body item filter when switching tab
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Manga.hpp | 2 | ||||
-rw-r--r-- | plugins/Matrix.hpp | 5 | ||||
-rw-r--r-- | plugins/Page.hpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Manga.hpp b/plugins/Manga.hpp index afd8a3c..cd0ab77 100644 --- a/plugins/Manga.hpp +++ b/plugins/Manga.hpp @@ -53,7 +53,7 @@ namespace QuickMedia { public: MangaChaptersPage(Program *program, std::string manga_name, std::string manga_url) : TrackablePage(program, std::move(manga_name), std::move(manga_url)) {} TrackResult track(const std::string &str) override; - void on_navigate_to_page(BodyItems &body_items) override; + void on_navigate_to_page(Body *body) override; protected: virtual bool extract_id_from_url(const std::string &url, std::string &manga_id) const = 0; virtual const char* get_service_name() const = 0; diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index cde502d..d9e6a97 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -252,12 +252,14 @@ namespace QuickMedia { class MatrixRoomsPage : public Page { public: - MatrixRoomsPage(Program *program, Body *body, std::string title, MatrixRoomTagsPage *room_tags_page = nullptr); + MatrixRoomsPage(Program *program, Body *body, std::string title, MatrixRoomTagsPage *room_tags_page, SearchBar *search_bar); ~MatrixRoomsPage() override; const char* get_title() const override { return title.c_str(); } PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + void on_navigate_to_page(Body *body) override; + void update() override; void add_body_item(std::shared_ptr<BodyItem> body_item); @@ -277,6 +279,7 @@ namespace QuickMedia { Body *body = nullptr; std::string title; MatrixRoomTagsPage *room_tags_page = nullptr; + SearchBar *search_bar = nullptr; MatrixChatPage *current_chat_page = nullptr; bool clear_data_on_update = false; bool sort_on_update = false; diff --git a/plugins/Page.hpp b/plugins/Page.hpp index db844c5..db11a61 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -45,7 +45,7 @@ namespace QuickMedia { virtual bool is_lazy_fetch_page() const { return false; } // This is called both when first navigating to page and when going back to page - virtual void on_navigate_to_page(BodyItems &body_items) { (void)body_items; } + virtual void on_navigate_to_page(Body *body) { (void)body; } // Called periodically (every frame right now) if this page is the currently active one virtual void update() {} |