aboutsummaryrefslogtreecommitdiff
path: root/include/Tabs.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Tabs.hpp')
-rw-r--r--include/Tabs.hpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/Tabs.hpp b/include/Tabs.hpp
index 51a7e9d..a5ca8ab 100644
--- a/include/Tabs.hpp
+++ b/include/Tabs.hpp
@@ -1,14 +1,15 @@
#pragma once
#include "RoundedRectangle.hpp"
-#include <SFML/Graphics/RectangleShape.hpp>
-#include <SFML/Graphics/Text.hpp>
+#include <mglpp/graphics/Rectangle.hpp>
+#include <mglpp/graphics/Text.hpp>
+#include <mglpp/graphics/Sprite.hpp>
#include <vector>
#include <functional>
-namespace sf {
+namespace mgl {
class Event;
- class RenderWindow;
+ class Window;
class Shader;
}
@@ -17,16 +18,16 @@ namespace QuickMedia {
class Tabs {
public:
- Tabs(sf::Shader *rounded_rectangle_shader);
- Tabs(sf::Shader *rounded_rectangle_shader, sf::Color shade_color);
+ Tabs(mgl::Shader *rounded_rectangle_shader);
+ Tabs(mgl::Shader *rounded_rectangle_shader, mgl::Color shade_color);
static float get_height();
static float get_shade_height();
// Returns the id (index) of the tab. The ids start from 0
- int add_tab(const std::string &title, Body *body);
- void on_event(sf::Event &event);
- void draw(sf::RenderWindow &window, sf::Vector2f pos, float width);
+ int add_tab(std::string title, Body *body);
+ void on_event(mgl::Event &event);
+ void draw(mgl::Window &window, mgl::vec2f pos, float width);
void set_text(int index, const std::string &text);
@@ -39,19 +40,19 @@ namespace QuickMedia {
float tab_index_to_x_offset(int index);
private:
struct Tab {
- sf::Text text;
- std::string label_utf8; // TODO: Remove
+ mgl::Text text;
Body *body;
};
std::vector<Tab> tabs;
RoundedRectangle background;
- sf::RectangleShape shade;
+ mgl::Rectangle shade;
int selected_tab = 0;
float scroll = 0.0f;
float width_per_tab = 0.0f;
float tab_background_width = 0.0f;
float container_width = 0.0f;
int tab_offset = 0;
- sf::Color shade_color;
+ mgl::Color shade_color;
+ mgl::Sprite arrow_sprite;
};
} \ No newline at end of file