mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-06 23:06:24 +09:00
Add settings page labels
This commit is contained in:
21
src/gui/Label.cpp
Normal file
21
src/gui/Label.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "../../include/gui/Label.hpp"
|
||||
#include <mglpp/window/Window.hpp>
|
||||
|
||||
namespace gsr {
|
||||
Label::Label(mgl::Font *font, const char *text, mgl::Color color) : text(text, *font) {
|
||||
this->text.set_color(color);
|
||||
}
|
||||
|
||||
bool Label::on_event(mgl::Event&, mgl::Window&, mgl::vec2f) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Label::draw(mgl::Window &window, mgl::vec2f offset) {
|
||||
text.set_position((position + offset).floor());
|
||||
window.draw(text);
|
||||
}
|
||||
|
||||
mgl::vec2f Label::get_size() {
|
||||
return text.get_bounds().size;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user