aboutsummaryrefslogtreecommitdiff
path: root/src/SearchBar.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-09 05:38:12 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-09 05:38:14 +0200
commit10fcdec298ccef4971dc6d109222079a0f438004 (patch)
tree90124b9d9cfd51c582d4d212c08cd17893d0f4ea /src/SearchBar.cpp
parent452311e6bf54368a9dac94c8ee973febf015dfd1 (diff)
Do not allow search until results are available
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r--src/SearchBar.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp
index b967224..5554a37 100644
--- a/src/SearchBar.cpp
+++ b/src/SearchBar.cpp
@@ -63,10 +63,11 @@ namespace QuickMedia {
time_since_search_update.restart();
}
} else if(codepoint == 13) { // Return
+ bool clear_search = true;
if(onTextSubmitCallback)
- onTextSubmitCallback(text.getString());
+ clear_search = onTextSubmitCallback(text.getString());
- if(!show_placeholder) {
+ if(clear_search && !show_placeholder) {
show_placeholder = true;
text.setString("Search...");
text.setFillColor(text_placeholder_color);