mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-04 14:00:46 +09:00
Start on file chooser, page stack
This commit is contained in:
29
include/gui/PageStack.hpp
Normal file
29
include/gui/PageStack.hpp
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user