From b86434c629e52034ec44c7582dadfbdeb1961d15 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 1 Dec 2019 19:28:56 +0100 Subject: Navigate back to the previous item instead of the selected item --- src/Body.cpp | 1 - src/QuickMedia.cpp | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Body.cpp b/src/Body.cpp index bf782bb..8412c6c 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -110,7 +110,6 @@ namespace QuickMedia { if(download_to_string(url, texture_data) == DownloadResult::OK) { if(result->loadFromMemory(texture_data.data(), texture_data.size())) { //result->generateMipmap(); - result->setSmooth(true); } } loading_thumbnail = false; diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index c1910ad..f11127d 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -1612,17 +1612,22 @@ namespace QuickMedia { } comment_navigation_stack.push(body->selected_item); } else if(event.key.code == sf::Keyboard::BackSpace && !comment_navigation_stack.empty()) { + size_t previous_selected = 0; + if(!comment_navigation_stack.empty()) { + previous_selected = comment_navigation_stack.top(); + } comment_navigation_stack.pop(); if(comment_navigation_stack.empty()) { for(auto &body_item : body->items) { body_item->visible = true; } + body->selected_item = previous_selected; } else { for(auto &body_item : body->items) { body_item->visible = false; } - body->selected_item = comment_navigation_stack.top(); - selected_item = body->items[body->selected_item].get(); + body->selected_item = previous_selected; + selected_item = body->items[comment_navigation_stack.top()].get(); selected_item->visible = true; for(size_t reply_index : selected_item->replies) { body->items[reply_index]->visible = true; -- cgit v1.2.3