LibGUI: Add GAction class and make GMenu deal in actions rather than strings.

This commit is contained in:
Andreas Kling
2019-02-12 14:09:48 +01:00
parent a5a7ea3d1e
commit 3085e400bc
9 changed files with 103 additions and 43 deletions

View File

@@ -1,14 +1,14 @@
#include <LibGUI/GMenuItem.h>
#include <LibGUI/GAction.h>
GMenuItem::GMenuItem(Type type)
: m_type(type)
{
}
GMenuItem::GMenuItem(unsigned identifier, const String& text)
: m_type(Text)
, m_identifier(identifier)
, m_text(text)
GMenuItem::GMenuItem(OwnPtr<GAction>&& action)
: m_type(Action)
, m_action(move(action))
{
}