diff options
Diffstat (limited to 'include/SearchBar.hpp')
-rw-r--r-- | include/SearchBar.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/SearchBar.hpp b/include/SearchBar.hpp index 06c4c98..cad897f 100644 --- a/include/SearchBar.hpp +++ b/include/SearchBar.hpp @@ -23,7 +23,7 @@ namespace QuickMedia { class SearchBar { public: SearchBar(sf::Texture *plugin_logo, sf::Shader *rounded_rectangle_shader, const std::string &placeholder, bool input_masked = false); - void draw(sf::RenderWindow &window, bool draw_shadow = true); + void draw(sf::RenderWindow &window, sf::Vector2f size, bool draw_background); void on_event(sf::Event &event); void update(); void onWindowResize(const sf::Vector2f &window_size); @@ -32,7 +32,7 @@ namespace QuickMedia { bool is_cursor_at_start_of_line() const; void set_to_autocomplete(); void set_autocomplete_text(const std::string &text); - void set_vertical_position(float vertical_pos); + void set_position(sf::Vector2f pos); float getBottom() const; float getBottomWithoutShadow() const; @@ -46,6 +46,10 @@ namespace QuickMedia { int text_autosearch_delay; int autocomplete_search_delay; bool caret_visible; + + float padding_top = 0.0f; + float padding_bottom = 0.0f; + float padding_x = 10.0f; private: void onTextEntered(sf::Uint32 codepoint); void clear_autocomplete_if_text_not_substring(); @@ -54,7 +58,6 @@ namespace QuickMedia { sf::Text text; sf::Text autocomplete_text; RoundedRectangle background; - sf::RectangleShape background_shadow; sf::RectangleShape shade; sf::RectangleShape caret; sf::Sprite plugin_logo_sprite; @@ -68,8 +71,8 @@ namespace QuickMedia { bool typing; bool backspace_pressed; bool mouse_left_inside; - float vertical_pos; + sf::Vector2f pos; sf::Clock time_since_search_update; - sf::Vector2u prev_window_size; + sf::Vector2f prev_size; }; }
\ No newline at end of file |