aboutsummaryrefslogtreecommitdiff
path: root/include/gui/ScrollablePage.hpp
blob: 2ad3c92061396f2522b7dc4af86702b67e225b8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include "Page.hpp"

namespace gsr {
    class ScrollablePage : public Page {
    public:
        ScrollablePage(mgl::vec2f size);
        ScrollablePage(const ScrollablePage&) = delete;
        ScrollablePage& operator=(const ScrollablePage&) = 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 { return size; }
    private:
        float get_border_size(mgl::Window &window) const;
    private:
        mgl::vec2f size;
    };
}