From 5e29715201f3b67648728a0cd048fd1b3e1dbcf7 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 8 Dec 2019 02:25:03 +0100 Subject: Add replying to posts (image boards), changed keybinding of writing a post (image boards) --- include/Body.hpp | 4 ++-- include/SearchBar.hpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') 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 -- cgit v1.2.3