aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-02 20:24:16 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-02 20:24:16 +0200
commit7c4af06d953ad439906f85ec996ad00dd38d2302 (patch)
tree3f516be003e189ac807080aaa4af891771aedd19 /include
parent93da082d32ce3a4892fcd88f460ceab9186fa1ef (diff)
Add settings page labels
Diffstat (limited to 'include')
-rw-r--r--include/Theme.hpp1
-rw-r--r--include/gui/Label.hpp23
2 files changed, 24 insertions, 0 deletions
diff --git a/include/Theme.hpp b/include/Theme.hpp
index 1221b7f..37c9e82 100644
--- a/include/Theme.hpp
+++ b/include/Theme.hpp
@@ -12,6 +12,7 @@ namespace gsr {
mgl::Color tint_color = mgl::Color(118, 185, 0);
mgl::Color scrollable_page_bg_color = mgl::Color(38, 43, 47);
+ mgl::Color text_color = mgl::Color(255, 255, 255);
};
void init_theme(const gsr::GsrInfo &gsr_info);
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