]> git.localhorst.tv Git - blobs.git/blobdiff - src/ui/Label.hpp
track a few things
[blobs.git] / src / ui / Label.hpp
index 0b9e0ca8e4534c90bebd542a75fe8b56906deb6f..1bc7e86bc4f0de8e733818c5eb3bd427b556bf1c 100644 (file)
@@ -1,48 +1,33 @@
 #ifndef BLOBS_UI_LABEL_HPP_
 #define BLOBS_UI_LABEL_HPP_
 
-#include "align.hpp"
+#include "Widget.hpp"
 #include "../graphics/Texture.hpp"
 
 #include <string>
 
 
 namespace blobs {
-namespace app {
-       struct Assets;
-}
 namespace graphics {
        class Font;
-       class Viewport;
 }
 namespace ui {
 
-class Label {
+class Label
+: public Widget {
 
 public:
        explicit Label(const graphics::Font &);
-       ~Label();
-
-       Label(const Label &) = delete;
-       Label &operator =(const Label &) = delete;
-
-       Label(Label &&) = delete;
-       Label &operator =(Label &&) = delete;
+       ~Label() override;
 
 public:
-       Label &Text(const std::string &);
-       Label &Font(const graphics::Font &);
-       Label &Foreground(const glm::vec4 &);
-       Label &Background(const glm::vec4 &);
-
-       Label &Position(const glm::vec3 &p) noexcept { pos = p; return *this; }
-       const glm::vec3 &Position() const noexcept { return pos; }
-
-       Label &Origin(Gravity o) noexcept { origin = o; return *this; }
-       Gravity Origin() const noexcept { return origin; }
+       Label *Text(const std::string &);
+       Label *Font(const graphics::Font &);
+       Label *Foreground(const glm::vec4 &);
+       Label *Background(const glm::vec4 &);
 
-       glm::vec2 Size();
-       void Draw(app::Assets &, graphics::Viewport &) noexcept;
+       glm::vec2 Size() override;
+       void Draw(app::Assets &, graphics::Viewport &) noexcept override;
 
 private:
        void Update();
@@ -53,8 +38,6 @@ private:
        graphics::Texture tex;
        glm::vec4 fg_color;
        glm::vec4 bg_color;
-       glm::vec3 pos;
-       Gravity origin;
        bool dirty;
 
 };