Start on file chooser, page stack

This commit is contained in:
dec05eba
2024-08-22 21:44:06 +02:00
parent ba007c2b69
commit 54c60d9a18
32 changed files with 724 additions and 260 deletions

29
include/gui/PageStack.hpp Normal file
View File

@@ -0,0 +1,29 @@
#pragma once
#include "Widget.hpp"
#include "Page.hpp"
#include "../SafeVector.hpp"
#include <memory>
namespace gsr {
class PageStack : public Widget {
public:
PageStack();
PageStack(const PageStack&) = delete;
PageStack& operator=(const PageStack&) = 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;
void push(std::unique_ptr<Page> page);
// This can be used even if the stack is empty
void pop();
// This can be used even if the stack is empty
Page* top();
bool empty() const;
private:
SafeVector<std::unique_ptr<Page>> widget_stack;
};
}