From b145d957e3809fd6c2d814c34c58234ade983bb0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 8 Sep 2024 17:07:22 +0200 Subject: More --- include/gui/Subsection.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/gui/Subsection.hpp (limited to 'include/gui/Subsection.hpp') diff --git a/include/gui/Subsection.hpp b/include/gui/Subsection.hpp new file mode 100644 index 0000000..90cb798 --- /dev/null +++ b/include/gui/Subsection.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include "Widget.hpp" +#include "Label.hpp" +#include + +namespace gsr { + class Subsection : public Widget { + public: + // If size width or height is 0 then the size in that direction is the size of the widgets + Subsection(const char *title, std::unique_ptr inner_widget, mgl::vec2f size); + Subsection(const Subsection&) = delete; + Subsection& operator=(const Subsection&) = delete; + + bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; + void draw(mgl::Window &window, mgl::vec2f offset) override; + + mgl::vec2f get_size() override; + private: + Label label; + std::unique_ptr inner_widget; + mgl::vec2f size; + }; +} \ No newline at end of file -- cgit v1.2.3