diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-02 20:24:16 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-02 20:24:16 +0200 |
commit | 7c4af06d953ad439906f85ec996ad00dd38d2302 (patch) | |
tree | 3f516be003e189ac807080aaa4af891771aedd19 /include/gui | |
parent | 93da082d32ce3a4892fcd88f460ceab9186fa1ef (diff) |
Add settings page labels
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/Label.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/gui/Label.hpp b/include/gui/Label.hpp new file mode 100644 index 0000000..a94ff96 --- /dev/null +++ b/include/gui/Label.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "Widget.hpp" + +#include <mglpp/graphics/Color.hpp> +#include <mglpp/graphics/Text.hpp> + +namespace gsr { + class Label : public Widget { + public: + // TODO: Allow specifying max width, at which either a line-break should occur or elipses should show + Label(mgl::Font *font, const char *text, mgl::Color color); + Label(const Label&) = delete; + Label& operator=(const Label&) = delete; + + bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; + void draw(mgl::Window &window, mgl::vec2f offset) override; + + mgl::vec2f get_size(); + private: + mgl::Text text; + }; +}
\ No newline at end of file |