aboutsummaryrefslogtreecommitdiff
path: root/src/gui/GsrPage.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-02-22 13:31:51 +0100
committerdec05eba <dec05eba@protonmail.com>2025-02-22 13:31:51 +0100
commit189736c1a96a1ad0e571ad69f01039e96455011a (patch)
tree22e1a78f698209e2ce0ef462a5d281b5b3030897 /src/gui/GsrPage.cpp
parent8003c209fea16cd164817306cb33d46ac61a44f0 (diff)
Add option to take a screenshot (default hotkey: alt+f1)
Diffstat (limited to 'src/gui/GsrPage.cpp')
-rw-r--r--src/gui/GsrPage.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/GsrPage.cpp b/src/gui/GsrPage.cpp
index c5fa263..663187c 100644
--- a/src/gui/GsrPage.cpp
+++ b/src/gui/GsrPage.cpp
@@ -8,8 +8,9 @@
namespace gsr {
static const float button_spacing_scale = 0.015f;
- GsrPage::GsrPage() :
- label_text("Settings", get_theme().title_font)
+ GsrPage::GsrPage(const char *top_text, const char *bottom_text) :
+ top_text(top_text, get_theme().title_font),
+ bottom_text(bottom_text, get_theme().title_font)
{
const float margin = 0.02f;
set_margins(margin, margin, margin, margin);
@@ -80,13 +81,17 @@ namespace gsr {
window.draw(background);
const int text_margin = background.get_size().y * 0.085;
- label_text.set_position((background.get_position() + mgl::vec2f(background.get_size().x * 0.5f - label_text.get_bounds().size.x * 0.5f, text_margin)).floor());
- window.draw(label_text);
+
+ top_text.set_position((background.get_position() + mgl::vec2f(background.get_size().x * 0.5f - top_text.get_bounds().size.x * 0.5f, text_margin)).floor());
+ window.draw(top_text);
mgl::Sprite icon(&get_theme().settings_texture);
icon.set_height((int)(background.get_size().y * 0.5f));
icon.set_position((background.get_position() + background.get_size() * 0.5f - icon.get_size() * 0.5f).floor());
window.draw(icon);
+
+ bottom_text.set_position((background.get_position() + mgl::vec2f(background.get_size().x * 0.5f - bottom_text.get_bounds().size.x * 0.5f, background.get_size().y - bottom_text.get_bounds().size.y - text_margin)).floor());
+ window.draw(bottom_text);
}
void GsrPage::draw_buttons(mgl::Window &window, mgl::vec2f body_pos, mgl::vec2f body_size) {