aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp4
-rw-r--r--include/SearchBar.hpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index 35928cb..b90f64a 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -12,14 +12,14 @@ namespace QuickMedia {
class BodyItem {
public:
- BodyItem(std::string _title): visible(true), num_lines(0) {
+ BodyItem(std::string _title): visible(true), num_lines(1) {
set_title(std::move(_title));
}
void set_title(std::string new_title) {
title = std::move(new_title);
// TODO: Optimize this
- num_lines = 0;
+ num_lines = 1;
for(char c : title) {
if(c == '\n')
++num_lines;
diff --git a/include/SearchBar.hpp b/include/SearchBar.hpp
index 88eed19..e986368 100644
--- a/include/SearchBar.hpp
+++ b/include/SearchBar.hpp
@@ -20,6 +20,8 @@ namespace QuickMedia {
void onWindowResize(const sf::Vector2f &window_size);
void onTextEntered(sf::Uint32 codepoint);
void clear();
+ void append_text(const std::string &text_to_add);
+ bool is_cursor_at_start_of_line() const;
float getBottom() const;
float getBottomWithoutShadow() const;
@@ -36,6 +38,7 @@ namespace QuickMedia {
bool show_placeholder;
bool updated_search;
bool draw_logo;
+ bool needs_update;
sf::Clock time_since_search_update;
};
} \ No newline at end of file