diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-07 07:15:05 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-07 07:17:48 +0200 |
commit | 8b98c612f7b17feaafabc48ad584498e1198f5ee (patch) | |
tree | f1a25d8ddc5c10af466583a302b5a2dcbed65c2d /src/gui/RadioButton.cpp | |
parent | 6e133a4bbad472dc03215acd6a22b0211c30a6f3 (diff) |
Use stack for page navigation, dont add spacing between list elements if the widget is empty or not visible
Diffstat (limited to 'src/gui/RadioButton.cpp')
-rw-r--r-- | src/gui/RadioButton.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/RadioButton.cpp b/src/gui/RadioButton.cpp index e5ba02a..b3e9a4e 100644 --- a/src/gui/RadioButton.cpp +++ b/src/gui/RadioButton.cpp @@ -56,6 +56,9 @@ namespace gsr { update_if_dirty(); + if(items.empty()) + return; + const int padding_top = padding_top_scale * get_theme().window_height; const int padding_bottom = padding_bottom_scale * get_theme().window_height; const int padding_left = padding_left_scale * get_theme().window_height; @@ -106,7 +109,7 @@ namespace gsr { } mgl::vec2f RadioButton::get_size() { - if(!visible) + if(!visible || items.empty()) return {0.0f, 0.0f}; update_if_dirty(); |