From 3ac1120fd40b84507c51f867559bd05adff4eecf Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 21 Apr 2021 13:29:01 +0200 Subject: Use shader for rounded rectangle, improve circle shader --- include/SearchBar.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/SearchBar.hpp') diff --git a/include/SearchBar.hpp b/include/SearchBar.hpp index b2cdf4d..76ad24b 100644 --- a/include/SearchBar.hpp +++ b/include/SearchBar.hpp @@ -1,16 +1,17 @@ #pragma once +#include "RoundedRectangle.hpp" #include #include #include #include -#include "../external/RoundedRectangleShape.hpp" #include namespace sf { class Font; class RenderWindow; class Event; + class Shader; } namespace QuickMedia { @@ -21,7 +22,7 @@ namespace QuickMedia { class SearchBar { public: - SearchBar(sf::Texture *plugin_logo, const std::string &placeholder, bool input_masked = false); + 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 on_event(sf::Event &event); void update(); @@ -32,7 +33,6 @@ namespace QuickMedia { void set_to_autocomplete(); void set_autocomplete_text(const std::string &text); void set_vertical_position(float vertical_pos); - void set_background_color(sf::Color color); float getBottom() const; float getBottomWithoutShadow() const; @@ -53,7 +53,7 @@ namespace QuickMedia { private: sf::Text text; sf::Text autocomplete_text; - sf::RoundedRectangleShape background; + RoundedRectangle background; sf::RectangleShape background_shadow; sf::RectangleShape shade; sf::RectangleShape caret; -- cgit v1.2.3