Change global widget container to page

This commit is contained in:
dec05eba
2024-08-01 20:46:13 +02:00
parent 6624db873c
commit 27255cdb64
8 changed files with 61 additions and 100 deletions

27
include/gui/Page.hpp Normal file
View File

@@ -0,0 +1,27 @@
#pragma once
#include <vector>
#include <memory>
namespace mgl {
class Event;
class Window;
}
namespace gsr {
class Widget;
class Page {
public:
Page() = default;
Page(const Page&) = delete;
Page& operator=(const Page&) = delete;
void add_widget(std::unique_ptr<Widget> widget);
void on_event(mgl::Event &event, mgl::Window &window);
void draw(mgl::Window &window);
private:
std::vector<std::unique_ptr<Widget>> widgets;
};
}