aboutsummaryrefslogtreecommitdiff
path: root/src/RoundedRectangle.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-02 17:42:30 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-02 17:43:47 +0200
commitcc3a65bde2e480b2b07b74eeef20d9081d7f730f (patch)
tree1bb5b85ab764592093e8042458ec9f4be0cf904a /src/RoundedRectangle.cpp
parent1b6812348e75de21c8f398a7dc944cc427064cc4 (diff)
Add modern theme
Join matrix room by their name instead of id if there is a name. This allows you to join rooms where the homeserver that created the room is no longer participating in the room.
Diffstat (limited to 'src/RoundedRectangle.cpp')
-rw-r--r--src/RoundedRectangle.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/RoundedRectangle.cpp b/src/RoundedRectangle.cpp
index 4b06ea8..494a254 100644
--- a/src/RoundedRectangle.cpp
+++ b/src/RoundedRectangle.cpp
@@ -4,7 +4,9 @@
#include <assert.h>
namespace QuickMedia {
- RoundedRectangle::RoundedRectangle(sf::Vector2f size, float radius, sf::Color color, sf::Shader *rounded_rectangle_shader) : radius(radius), pos(0.0f, 0.0f), size(size), rounded_rectangle_shader(rounded_rectangle_shader) {
+ RoundedRectangle::RoundedRectangle(sf::Vector2f size, float radius, sf::Color color, sf::Shader *rounded_rectangle_shader) :
+ radius(radius), pos(0.0f, 0.0f), size(size), rounded_rectangle_shader(rounded_rectangle_shader), band_y(0.0f), band_height(0.0f), band_color(sf::Color::Transparent)
+ {
assert(rounded_rectangle_shader);
vertices[0].color = color;
vertices[1].color = color;
@@ -45,9 +47,21 @@ namespace QuickMedia {
return size;
}
+ void RoundedRectangle::set_band(float y, float height) {
+ band_y = y;
+ band_height = height;
+ }
+
+ void RoundedRectangle::set_band_color(sf::Color color) {
+ band_color = color;
+ }
+
void RoundedRectangle::draw(sf::RenderTarget &target) {
- rounded_rectangle_shader->setUniform("resolution", size);
rounded_rectangle_shader->setUniform("radius", radius);
+ rounded_rectangle_shader->setUniform("band_y", band_y);
+ rounded_rectangle_shader->setUniform("band_height", band_height);
+ rounded_rectangle_shader->setUniform("band_color", sf::Glsl::Vec4(band_color.r/255.0f, band_color.g/255.0f, band_color.b/255.0f, band_color.a/255.0f));
+ rounded_rectangle_shader->setUniform("resolution", size);
target.draw(vertices, 4, sf::Quads, rounded_rectangle_shader);
}
} \ No newline at end of file