diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-12-01 19:28:56 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-12-01 19:28:56 +0100 |
commit | b86434c629e52034ec44c7582dadfbdeb1961d15 (patch) | |
tree | c887758a20f41c7185a0aea6bddfa58b3fd830a1 /src | |
parent | 036854faf4f0a4fa851493debd17cb91ec5accbe (diff) |
Navigate back to the previous item instead of the selected item
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 1 | ||||
-rw-r--r-- | 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; |