diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-06 08:22:42 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-06 08:22:42 +0200 |
commit | 520c61ec64c001d2c9c9d953051aa58715831731 (patch) | |
tree | 2c0e10995d1a85374f628e78a53321f727013bf3 /src/gui/DropdownButton.cpp | |
parent | 9b6033e2b97f6f572cb69a393d4d1d1ea41b5d72 (diff) |
Add checkbox, scale more sizes by window scale
Diffstat (limited to 'src/gui/DropdownButton.cpp')
-rw-r--r-- | src/gui/DropdownButton.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/DropdownButton.cpp b/src/gui/DropdownButton.cpp index 9fb4803..826d889 100644 --- a/src/gui/DropdownButton.cpp +++ b/src/gui/DropdownButton.cpp @@ -12,7 +12,7 @@ namespace gsr { static const float padding_bottom = 15.0f; static const float padding_left = 20.0f; static const float padding_right = 20.0f; - static const int border_size = 5; + static const float border_scale = 0.003f; DropdownButton::DropdownButton(mgl::Font *title_font, mgl::Font *description_font, const char *title, const char *description_activated, const char *description_deactivated, mgl::Texture *icon_texture, mgl::vec2f size) : title_font(title_font), description_font(description_font), size(size), title(title, *title_font), description(description_deactivated, *description_font), @@ -59,6 +59,7 @@ namespace gsr { update_if_dirty(); const mgl::vec2f draw_pos = position + offset; + const int border_size = border_scale * gsr::get_theme().window_height; if(show_dropdown) { // Background @@ -73,7 +74,7 @@ namespace gsr { // Green line at top { - mgl::Rectangle rect({ size.x, border_size }); + mgl::Rectangle rect({ size.x, (float)border_size }); rect.set_position(draw_pos); rect.set_color(border_color); window.draw(rect); |