ladybird/Libraries/LibGUI/GToolBar.h
Andreas Kling 04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00

34 lines
759 B
C++

#pragma once
#include <LibGUI/GWidget.h>
class GAction;
class GToolBar : public GWidget {
public:
explicit GToolBar(GWidget* parent);
virtual ~GToolBar() override;
void add_action(NonnullRefPtr<GAction>&&);
void add_separator();
bool has_frame() const { return m_has_frame; }
void set_has_frame(bool has_frame) { m_has_frame = has_frame; }
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 };
RefPtr<GAction> action;
};
Vector<OwnPtr<Item>> m_items;
bool m_has_frame { true };
};