Add settings page labels

This commit is contained in:
dec05eba
2024-08-02 20:24:16 +02:00
parent 93da082d32
commit 7c4af06d95
4 changed files with 171 additions and 14 deletions

23
include/gui/Label.hpp Normal file
View File

@@ -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;
};
}