diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-06-27 09:31:22 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-06-27 09:39:25 +0200 |
commit | 7c991b4d29e410c854669b36d707b684c695f047 (patch) | |
tree | 57941a778c26dcf067e5a425f7e188e06a8197b2 | |
parent | d004af8344758a6d9412a0dba83702f43f6805ee (diff) |
Allow bookmarking manga from creator page
Fix ctrl+v (or one character) search on youtube not switching to card
view.
Testing fix body navigation back scrolling when it shouldn't.
-rw-r--r-- | plugins/MangaGeneric.hpp | 1 | ||||
-rw-r--r-- | plugins/Mangadex.hpp | 1 | ||||
-rw-r--r-- | plugins/Manganelo.hpp | 1 | ||||
-rw-r--r-- | src/Body.cpp | 18 | ||||
-rw-r--r-- | src/QuickMedia.cpp | 7 |
5 files changed, 17 insertions, 11 deletions
diff --git a/plugins/MangaGeneric.hpp b/plugins/MangaGeneric.hpp index 5318e63..c9911d9 100644 --- a/plugins/MangaGeneric.hpp +++ b/plugins/MangaGeneric.hpp @@ -176,6 +176,7 @@ namespace QuickMedia { const char* get_title() const override { return creator.name.c_str(); } PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override; PluginResult lazy_fetch(BodyItems &result_items) override; + const char* get_bookmark_name() const override { return search_page->get_bookmark_name(); } private: MangaGenericSearchPage *search_page; Creator creator; diff --git a/plugins/Mangadex.hpp b/plugins/Mangadex.hpp index cd37aff..869ba80 100644 --- a/plugins/Mangadex.hpp +++ b/plugins/Mangadex.hpp @@ -42,6 +42,7 @@ namespace QuickMedia { PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override; PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; PluginResult lazy_fetch(BodyItems &result_items) override; + const char* get_bookmark_name() const override { return "mangadex"; } private: MangadexSearchPage *search_page; Creator creator; diff --git a/plugins/Manganelo.hpp b/plugins/Manganelo.hpp index f44ad2d..a44249c 100644 --- a/plugins/Manganelo.hpp +++ b/plugins/Manganelo.hpp @@ -29,6 +29,7 @@ namespace QuickMedia { const char* get_title() const override { return creator.name.c_str(); } PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override; PluginResult lazy_fetch(BodyItems &result_items) override; + const char* get_bookmark_name() const override { return "manganelo"; } private: Creator creator; }; diff --git a/src/Body.cpp b/src/Body.cpp index f9eb021..5a72165 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -1163,18 +1163,20 @@ namespace QuickMedia { item->prev_height = item->height; if(attach_side == AttachSide::TOP) { - if(index < selected_item) { - page_scroll -= height_diff; - pos.y -= height_diff; - } + // TODO: Remove + // if(index < selected_item) { + // page_scroll -= height_diff; + // pos.y -= height_diff; + // } prev_body_item = item.get(); index = get_next_visible_item(index); } else { - if(index > selected_item) { - page_scroll += height_diff; - pos.y += height_diff; - } + // TODO: Remove + // if(index > selected_item) { + // page_scroll += height_diff; + // pos.y += height_diff; + // } index = prev_index; } diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index ae3ac63..770ef18 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2614,15 +2614,17 @@ namespace QuickMedia { } if(associated_data.search_text_updated && associated_data.fetch_status == FetchStatus::NONE && !associated_data.fetching_next_page_running) { + associated_data.search_text_empty = associated_data.update_search_text.empty(); std::string update_search_text = associated_data.update_search_text; - if(!tabs[i].page->search_is_suggestion(associated_data.search_text_empty) || associated_data.search_suggestion_submitted) - tabs[i].body->clear_items(); + tabs[i].body->clear_items(); if(tabs[i].page->search_is_suggestion(associated_data.search_text_empty) && tabs[i].body) { if(update_search_text.empty()) tabs[i].body->card_view = tab_associated_data[selected_tab].card_view; else tabs[i].body->card_view = false; + } else { + tabs[i].body->card_view = tab_associated_data[selected_tab].card_view; } associated_data.search_text_updated = false; @@ -2650,7 +2652,6 @@ namespace QuickMedia { } associated_data.fetched_page = 0; associated_data.fetching_next_page_failed = false; - associated_data.search_text_empty = associated_data.update_search_text.empty(); if(fetch_result.result != PluginResult::OK) associated_data.search_result_text.set_string("Search failed!"); else if(tabs[i].body->get_num_items() == 0) |