mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
b704d3d295
The same action can be added to both a menu and a toolbar. Use this to put a toolbar into FileManager. This is pretty neat. :^)
26 lines
566 B
C++
26 lines
566 B
C++
#pragma once
|
|
|
|
#include <AK/AKString.h>
|
|
|
|
class GAction;
|
|
|
|
class GMenuItem {
|
|
public:
|
|
enum Type { Invalid, Action, Separator };
|
|
|
|
explicit GMenuItem(Type);
|
|
explicit GMenuItem(RetainPtr<GAction>&&);
|
|
~GMenuItem();
|
|
|
|
Type type() const { return m_type; }
|
|
String text() const;
|
|
const GAction* action() const { return m_action.ptr(); }
|
|
GAction* action() { return m_action.ptr(); }
|
|
unsigned identifier() const { return m_identifier; }
|
|
|
|
private:
|
|
Type m_type { Invalid };
|
|
unsigned m_identifier { 0 };
|
|
RetainPtr<GAction> m_action;
|
|
};
|
|
|