aboutsummaryrefslogtreecommitdiff
path: root/include/SearchBar.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-04-21 13:29:01 +0200
committerdec05eba <dec05eba@protonmail.com>2021-04-21 13:29:01 +0200
commit3ac1120fd40b84507c51f867559bd05adff4eecf (patch)
tree32a3d7e037dd0fa07f764e563cfaa304470ad7f1 /include/SearchBar.hpp
parent0f151afa58c1f725a652eaa4444ce3e2b2509770 (diff)
Use shader for rounded rectangle, improve circle shader
Diffstat (limited to 'include/SearchBar.hpp')
-rw-r--r--include/SearchBar.hpp8
1 files changed, 4 insertions, 4 deletions
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 <SFML/Graphics/Text.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/System/Clock.hpp>
-#include "../external/RoundedRectangleShape.hpp"
#include <functional>
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;