diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-07 00:21:32 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-07 00:21:35 +0200 |
commit | a3e479d5b289166ff651fac4ff046656cf78cda0 (patch) | |
tree | 2ba345228acfe45acf9863bb122e163ed38db7db /src/gui/StaticPage.cpp | |
parent | b229b060add5f66bd5532698c4a790285095e98a (diff) |
Add radio button with simple/advanced view, add widget visibility
Diffstat (limited to 'src/gui/StaticPage.cpp')
-rw-r--r-- | src/gui/StaticPage.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/StaticPage.cpp b/src/gui/StaticPage.cpp index a6d9b64..73adfa0 100644 --- a/src/gui/StaticPage.cpp +++ b/src/gui/StaticPage.cpp @@ -6,6 +6,9 @@ namespace gsr { StaticPage::StaticPage(mgl::vec2f size) : size(size) {} bool StaticPage::on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) { + if(!visible) + return true; + const mgl::vec2f draw_pos = position + offset; offset = draw_pos; Widget *selected_widget = selected_child_widget; @@ -27,6 +30,9 @@ namespace gsr { } void StaticPage::draw(mgl::Window &window, mgl::vec2f offset) { + if(!visible) + return; + const mgl::vec2f draw_pos = position + offset; offset = draw_pos; Widget *selected_widget = selected_child_widget; @@ -50,4 +56,11 @@ namespace gsr { mgl_window_set_scissor(window.internal_window(), &prev_scissor); } + + mgl::vec2f StaticPage::get_size() { + if(!visible) + return {0.0f, 0.0f}; + + return size; + } }
\ No newline at end of file |