mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
0dc9af5f7e
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
35 lines
765 B
C++
35 lines
765 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(Retained<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 };
|
|
RetainPtr<GAction> action;
|
|
};
|
|
Vector<OwnPtr<Item>> m_items;
|
|
bool m_has_frame { true };
|
|
};
|