diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index bbc6f91..283379a 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -535,7 +535,7 @@ namespace QuickMedia { case Page::IMAGES: { body->draw_thumbnails = false; window.setKeyRepeatEnabled(false); - window.setFramerateLimit(4); + window.setFramerateLimit(20); image_page(); body->filter_search_fuzzy(""); if(vsync_set) @@ -2181,7 +2181,6 @@ namespace QuickMedia { bool error = !error_message.getString().isEmpty(); bool redraw = true; - sf::Event event; sf::Text chapter_text(content_title + " | " + chapter_title + " | Page " + std::to_string(image_index + 1) + "/" + std::to_string(num_images), *font, 14); if(image_index == num_images) @@ -2200,6 +2199,10 @@ namespace QuickMedia { sf::Clock check_downloaded_timer; const sf::Int32 check_downloaded_timeout_ms = 500; + sf::Event event; + // Consume events sent during above call to get_number_of_images which sends a request to server which may take a while. We dont want pages to be skipped when pressing arrow up/down + while(window.pollEvent(event)) {} + // TODO: Show to user if a certain page is missing (by checking page name (number) and checking if some are skipped) while (current_page == Page::IMAGES) { while(window.pollEvent(event)) { |