aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp2
-rw-r--r--src/QuickMedia.cpp12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 27e09f9..ac809eb 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -72,7 +72,7 @@ namespace QuickMedia {
void Body::clear_items() {
items.clear();
selected_item = 0;
- //item_thumbnail_textures.clear();
+ item_thumbnail_textures.clear();
}
BodyItem* Body::get_selected() const {
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index e2fc237..a9e5a89 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -234,7 +234,7 @@ namespace QuickMedia {
return 0;
}
- void Program::base_event_handler(sf::Event &event, Page previous_page, bool handle_keypress) {
+ void Program::base_event_handler(sf::Event &event, Page previous_page, bool handle_keypress, bool clear_on_escape) {
if (event.type == sf::Event::Closed) {
current_page = Page::EXIT;
} else if(event.type == sf::Event::Resized) {
@@ -249,9 +249,11 @@ namespace QuickMedia {
body->select_next_item();
} else if(event.key.code == sf::Keyboard::Escape) {
current_page = previous_page;
- body->clear_items();
- body->reset_selected();
- search_bar->clear();
+ if(clear_on_escape) {
+ body->clear_items();
+ body->reset_selected();
+ search_bar->clear();
+ }
}
} else if(event.type == sf::Event::TextEntered) {
search_bar->onTextEntered(event.text.unicode);
@@ -764,7 +766,7 @@ namespace QuickMedia {
while (current_page == Page::VIDEO_CONTENT) {
while (window.pollEvent(event)) {
- base_event_handler(event, previous_page);
+ base_event_handler(event, previous_page, true, false);
if(event.type == sf::Event::Resized) {
if(video_player_ui_window)
ui_resize = true;