mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
956bd23aae
This patch only hooks up the minimize and unminimize actions.
40 lines
750 B
C++
40 lines
750 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GMenuItem.h>
|
|
#include <AK/Function.h>
|
|
#include <AK/Retainable.h>
|
|
#include <AK/Retained.h>
|
|
#include <AK/Vector.h>
|
|
|
|
class GAction;
|
|
class Point;
|
|
|
|
class GMenu {
|
|
public:
|
|
explicit GMenu(const String& name);
|
|
~GMenu();
|
|
|
|
static GMenu* from_menu_id(int);
|
|
|
|
GAction* action_at(int);
|
|
|
|
void add_action(Retained<GAction>);
|
|
void add_separator();
|
|
|
|
void popup(const Point& screen_position, bool top_anchored = true);
|
|
void dismiss();
|
|
|
|
Function<void(unsigned)> on_item_activation;
|
|
|
|
private:
|
|
friend class GMenuBar;
|
|
|
|
int menu_id() const { return m_menu_id; }
|
|
int realize_menu();
|
|
void unrealize_menu();
|
|
|
|
int m_menu_id { 0 };
|
|
String m_name;
|
|
Vector<OwnPtr<GMenuItem>> m_items;
|
|
};
|