summaryrefslogtreecommitdiff
path: root/LibGUI/GToolBar.h
blob: 683466449877d8163b864ae68fa398fe6e0dbd4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <LibGUI/GWidget.h>

class GAction;

class GToolBar : public GWidget {
public:
    explicit GToolBar(GWidget* parent);
    virtual ~GToolBar() override;

    void add_action(Retained<GAction>&&);
    void add_separator();

    virtual const char* class_name() const override { return "GToolBar"; }

private:
    virtual void paint_event(GPaintEvent&) override;

    struct Item {
        enum Type { Invalid, Separator, Action };
        Type type { Invalid };
        RetainPtr<GAction> action;
    };
    Vector<OwnPtr<Item>> m_items;
};