aboutsummaryrefslogtreecommitdiff
path: root/src/SearchBar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r--src/SearchBar.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp
index 9d8a168..5c3c35c 100644
--- a/src/SearchBar.cpp
+++ b/src/SearchBar.cpp
@@ -11,15 +11,16 @@ const float PADDING_HORIZONTAL = 50.0f;
const float padding_vertical = 20.0f;
namespace QuickMedia {
- SearchBar::SearchBar(sf::Font &font, sf::Texture &plugin_logo) :
+ SearchBar::SearchBar(sf::Font &font, sf::Texture &plugin_logo, const std::string &placeholder) :
onTextUpdateCallback(nullptr),
onTextSubmitCallback(nullptr),
onTextBeginTypingCallback(nullptr),
onAutocompleteRequestCallback(nullptr),
text_autosearch_delay(0),
autocomplete_search_delay(0),
- text("Search...", font, 18),
+ text(placeholder, font, 18),
autocomplete_text("", font, 18),
+ placeholder_str(placeholder),
show_placeholder(true),
updated_search(false),
updated_autocomplete(false),
@@ -116,7 +117,7 @@ namespace QuickMedia {
text.setString(str);
if(str.getSize() == 0) {
show_placeholder = true;
- text.setString("Search...");
+ text.setString(placeholder_str);
text.setFillColor(text_placeholder_color);
autocomplete_text.setString("");
} else {
@@ -158,7 +159,7 @@ namespace QuickMedia {
if(show_placeholder)
return;
show_placeholder = true;
- text.setString("Search...");
+ text.setString(placeholder_str);
text.setFillColor(text_placeholder_color);
autocomplete_text.setString("");
needs_update = true;