mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-07 23:20:26 +09:00
Change text renderer to pango (supports all languages and loads font automatically), start on game detection
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <mglpp/window/Window.hpp>
|
||||
|
||||
namespace gsr {
|
||||
Label::Label(mgl::Font *font, const char *text, mgl::Color color) : text(text, *font) {
|
||||
Label::Label(const char *font_desc, const char *text, mgl::Color color) : text(text, font_desc) {
|
||||
this->text.set_color(color);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ namespace gsr {
|
||||
window.draw(text);
|
||||
}
|
||||
|
||||
void Label::set_text(std::string str) {
|
||||
text.set_string(std::move(str));
|
||||
void Label::set_text(std::string_view str) {
|
||||
text.set_string(str);
|
||||
}
|
||||
|
||||
const std::string& Label::get_text() const {
|
||||
std::string_view Label::get_text() const {
|
||||
return text.get_string();
|
||||
}
|
||||
|
||||
@@ -32,4 +32,14 @@ namespace gsr {
|
||||
|
||||
return text.get_bounds().size;
|
||||
}
|
||||
|
||||
// Set to 0 to disable
|
||||
void Label::set_wrap_width(int width) {
|
||||
text.set_wrap_width(width);
|
||||
}
|
||||
|
||||
// Set to 0 to disable
|
||||
void Label::set_max_rows(int max_rows) {
|
||||
text.set_max_rows(max_rows);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user